plugins/admin/SecurityLog.php
changeset 320 112debff64bd
parent 166 d53cc29308f4
child 322 5f1cd51bf1be
equal deleted inserted replaced
319:8be996c3740d 320:112debff64bd
    60 function get_security_log($num = false)
    60 function get_security_log($num = false)
    61 {
    61 {
    62   global $db, $session, $paths, $template, $plugins; // Common objects
    62   global $db, $session, $paths, $template, $plugins; // Common objects
    63   if ( $session->auth_level < USER_LEVEL_ADMIN )
    63   if ( $session->auth_level < USER_LEVEL_ADMIN )
    64   {
    64   {
    65     $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,edit_summary,author) VALUES("security","seclog_unauth",UNIX_TIMESTAMP(),"' . $db->escape($_SERVER['REMOTE_ADDR']) . '","' . $db->escape($session->username) . '");');
    65     $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,edit_summary,author) VALUES(\'security\',\'seclog_unauth\',' . time() . ',"' . $db->escape($_SERVER['REMOTE_ADDR']) . '","' . $db->escape($session->username) . '");');
    66     if ( !$q )
    66     if ( !$q )
    67       $db->_die();
    67       $db->_die();
    68     die('Security log: unauthorized attempt to fetch. Call has been logged and reported to the administrators.');
    68     die('Security log: unauthorized attempt to fetch. Call has been logged and reported to the administrators.');
    69   }
    69   }
    70   
    70