示例#1
0
 function sc_admin_log($parm)
 {
     if (getperms('0')) {
         if (!function_exists('admin_log')) {
             function admin_log()
             {
                 global $sql, $ns;
                 $text = E_16_ADMINLOG . " <a style='cursor: pointer' onclick=\"expandit('adminlog')\">" . ADLAN_116 . "</a>\n";
                 if (e_QUERY == 'logall') {
                     $text .= "<div id='adminlog'>";
                     $cnt = $sql->db_Select('admin_log', '*', "ORDER BY `dblog_datestamp` DESC", 'no_where');
                 } else {
                     $text .= "<div style='display: none;' id='adminlog'>";
                     $cnt = $sql->db_Select('admin_log', '*', 'ORDER BY `dblog_datestamp` DESC LIMIT 0,10', 'no_where');
                 }
                 $text .= $cnt ? '<ul>' : '';
                 $gen = e107::getDateConvert();
                 while ($row = $sql->db_Fetch()) {
                     $datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
                     $text .= "<li>{$datestamp} - {$row['dblog_title']}</li>";
                 }
                 $text .= $cnt ? '</ul>' : '';
                 $text .= "[ <a href='" . e_ADMIN_ABS . "admin_log.php?adminlog'>" . ADLAN_117 . "</a> ]";
                 $text .= "<br />[ <a href='" . e_ADMIN_ABS . "admin_log.php?config'>" . ADLAN_118 . "</a> ]";
                 //			$text .= "<br />[ <a href='".e_ADMIN."admin_log.php?purge' onclick=\"return jsconfirm('".LAN_CONFIRMDEL."')\">".ADLAN_118."</a> ]\n";
                 $text .= "</div>";
                 return $ns->tablerender(ADLAN_135, $text, '', TRUE);
             }
         }
         if ($parm == 'request') {
             if (function_exists('log_request')) {
                 if (log_request()) {
                     return admin_log();
                 }
             }
         } else {
             return admin_log();
         }
     }
 }
示例#2
0
文件: ar_log.php 项目: inikoo/fact
 Autor: Raul Perusquia <*****@*****.**>
 Created: 24 September 2014 14:51:26 BST, Nottingham, UK
*/
require_once 'aes.php';
require_once 'common.php';
require_once 'ar_common.php';
include_once 'common_natural_language.php';
include_once 'common_checksum_functions.php';
include_once 'fork_functions.php';
if (!isset($_REQUEST['tipo'])) {
    $response = array('state' => 405, 'msg' => 'Non acceptable request (t)');
    echo json_encode($response);
    exit;
}
$tipo = $_REQUEST['tipo'];
switch ($tipo) {
    case 'log_request':
        $data = prepare_values($_REQUEST, array('url' => array('type' => 'string'), 'prev' => array('type' => 'string')));
        log_request($data);
        break;
    default:
        $response = array('state' => 404, 'msg' => 'Operation not found');
        echo json_encode($response);
}
function log_request($data)
{
    global $user;
    $user->log_request($data['url'], $data['prev']);
    $response = array('state' => 200);
    echo json_encode($response);
}
示例#3
0
function log_post($file = '', $prepend_str = false)
{
    log_request($file, $prepend_str, true);
}