ultimix
error_log_access.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
38  var $AddLimitations = '1 = 1';
39 
58  function set_add_limitations( $theAddLimitation )
59  {
60  try
61  {
62  if( $this->AddLimitations === '1 = 1' )
63  {
64  $this->AddLimitations = $theAddLimitation;
65  }
66  else
67  {
68  throw( new Exception( '"AddLimitations" was already set' ) );
69  }
70  }
71  catch( Exception $e )
72  {
73  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
74  }
75  }
76 
103  function add_message_to_log( $Severity , $Title , $Description )
104  {
105  try
106  {
107  $Security = get_package( 'security' , 'last' , __FILE__ );
108  $Severity = $Security->get( $Severity , 'integer' );
109  $Title = $Security->get( $Title , 'command' );
110  $Description = $Security->get( $Description , 'raw' );
111 
112  $Database = get_package( 'database' , 'last' , __FILE__ );
113  $Database->insert(
114  'umx_error_log' , 'severity , title , description , error_date' ,
115  "$Severity , '$Title' , '$Description' , NOW()"
116  );
117  $Database->commit();
118  }
119  catch( Exception $e )
120  {
121  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
122  }
123  }
124 
143  function unsafe_select_messages( $Condition = '1 = 1' )
144  {
145  try
146  {
147  $Database = get_package( 'database' , 'last' , __FILE__ );
148  $Database->query_as( DB_OBJECT );
149  $Results = $Database->select( '*' , 'umx_error_log' , "( $this->AddLimitations ) AND $Condition" );
150  return( $Results );
151  }
152  catch( Exception $e )
153  {
154  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
155  }
156  }
157 
176  function delete_error_log( $id )
177  {
178  try
179  {
180  $Database = get_package( 'database' , 'last' , __FILE__ );
181  $Security = get_package( 'security' , 'last' , __FILE__ );
182 
183  $id = $Security->get( $id , 'integer' );
184  $Database->delete( 'umx_error_log' , "( $this->AddLimitations ) AND id = $id" );
185  $Database->commit();
186  }
187  catch( Exception $e )
188  {
189  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
190  }
191  }
192  }
193 
194 ?>