includes/dbal.php
changeset 73 0a74676a2f2f
parent 21 663fcf528726
child 91 8079b0288e8e
equal deleted inserted replaced
72:bda11e521e8a 73:0a74676a2f2f
     1 <?php
     1 <?php
     2 
     2 
     3 /*
     3 /*
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     5  * Version 1.0 (Banshee)
     5  * Version 1.0.1 (Loch Ness)
     6  * Copyright (C) 2006-2007 Dan Fuhry
     6  * Copyright (C) 2006-2007 Dan Fuhry
     7  *
     7  *
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    10  *
    10  *
   278     else
   278     else
   279       $username = 'Unavailable';
   279       $username = 'Unavailable';
   280     $query = $this->escape($query);
   280     $query = $this->escape($query);
   281     $q = $this->sql_query('INSERT INTO '.table_prefix.'logs(log_type,     action,         time_id,    date_string, page_text,      author,            edit_summary)
   281     $q = $this->sql_query('INSERT INTO '.table_prefix.'logs(log_type,     action,         time_id,    date_string, page_text,      author,            edit_summary)
   282                                                      VALUES(\'security\', \'sql_inject\', '.time().', \'\',        \''.$query.'\', \''.$username.'\', \''.$_SERVER['REMOTE_ADDR'].'\');');
   282                                                      VALUES(\'security\', \'sql_inject\', '.time().', \'\',        \''.$query.'\', \''.$username.'\', \''.$_SERVER['REMOTE_ADDR'].'\');');
       
   283   }
       
   284   
       
   285   /**
       
   286    * Returns the ID of the row last inserted.
       
   287    * @return int
       
   288    */
       
   289   
       
   290   function insert_id()
       
   291   {
       
   292     return @mysql_insert_id();
   283   }
   293   }
   284   
   294   
   285   function fetchrow($r = false) {
   295   function fetchrow($r = false) {
   286     $this->enable_errorhandler();
   296     $this->enable_errorhandler();
   287     if(!$this->_conn) return false;
   297     if(!$this->_conn) return false;