Changeset 568 for trunk/Modules/Log/Log.php
- Timestamp:
- Aug 21, 2013, 9:27:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Log/Log.php
r567 r568 13 13 $this->License = 'GNU/GPL'; 14 14 $this->Description = 'Log various application events'; 15 $this->Dependencies = array( );15 $this->Dependencies = array('Error'); 16 16 17 17 $this->Excludes = array(); … … 21 21 { 22 22 $this->System->RegisterPage('log.php', 'PageLog'); 23 $this->System->ModuleManager->Modules['Error']->OnError[] = array($this, 'DoAddItem'); 23 24 } 25 26 function DoAddItem($Message) 27 { 28 WriteLog($Message, LOG_TYPE_ERROR); 29 } 24 30 } 25 31 … … 41 47 42 48 if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole'; 43 else $IP = addslashes($_SERVER['REMOTE_ADDR']);49 else $IP = addslashes($_SERVER['REMOTE_ADDR']); 44 50 45 51 if(!is_null($User->Id)) $UserId = $User->Id; 46 else $UserId = 'NULL';47 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) 48 VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")';52 else $UserId = 'NULL'; 53 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '. 54 'VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'", "'.$_SERVER['REQUEST_URI'].'")'; 49 55 $System->Database->query($Query); 56 echo($Query); 50 57 } 51 58
Note:
See TracChangeset
for help on using the changeset viewer.