Changeset 661 for trunk/Modules/Log/Log.php
- Timestamp:
- May 31, 2014, 1:07:01 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Log/Log.php
r608 r661 13 13 $this->Dependencies = array('User'); 14 14 } 15 15 16 16 function DoInstall() 17 17 { … … 20 20 function DoUnInstall() 21 21 { 22 } 23 22 } 23 24 24 function DoStart() 25 25 { … … 28 28 'Table' => 'Log', 29 29 'DefaultSortColumn' => 'Time', 30 'DefaultSortOrder' => 1, 30 31 'Items' => array( 31 32 'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => '', 'ReadOnly' => true), … … 37 38 ), 38 39 )); 39 40 40 41 } 41 42 42 43 function DoStop() 43 44 { 44 45 } 45 46 46 47 function NewRecord($Module, $Operation, $Value = '') 47 48 { 48 if(array_key_exists('User', $this->System->ModuleManager->Modules) and 49 if(array_key_exists('User', $this->System->ModuleManager->Modules) and 49 50 array_key_exists('Id', $this->System->User->User)) 50 51 $UserId = $this->System->User->User['Id']; … … 52 53 if(array_key_exists('REMOTE_ADDR', $_SERVER)) $IPAddress = $_SERVER['REMOTE_ADDR']; 53 54 else $IPAddress = ''; 54 $this->Database->insert('Log', array('Time' => 'NOW()', 55 'User' => $UserId, 'Module' => $Module, 55 $this->Database->insert('Log', array('Time' => 'NOW()', 56 'User' => $UserId, 'Module' => $Module, 56 57 'Operation' => $Operation, 'Value' => $Value, 'IPAddress' => $IPAddress)); 57 58 }
Note:
See TracChangeset
for help on using the changeset viewer.