plugins/admin/SecurityLog.php
changeset 326 ab66d6d1f1f4
parent 322 5f1cd51bf1be
child 345 4ccdfeee9a11
equal deleted inserted replaced
314:474f8be55943 326:ab66d6d1f1f4
     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.1.1
     5  * Version 1.0.3 (Dyrad)
     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  *
    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