/* @var $userService PW_UserService */ $userdb = $userService->getByUserName($admin_name); if ($userdb) { $uid = $userdb['uid']; $slog = $db->get_value("SELECT slog FROM pw_administrators WHERE uid=" . S::sqlEscape($uid, false)); $slog = explode(";", $slog); $slog = array_reverse($slog); foreach ($slog as $key => $value) { !$value && ($value = $timestamp . ',' . $onlineip); list($lastinfo[$key]['time'], $lastinfo[$key]['ip']) = explode(',', $value); $lastinfo[$key]['time'] = get_date($lastinfo[$key]['time']); } } if ($db_adminrecord == '1') { $bbscrecordfile = D_P . "data/bbscache/adminrecord.php"; $recorddb = readlog($bbscrecordfile); $recorddb = array_reverse($recorddb); for ($i = 0; $i <= 4; $i++) { $detail = explode("|", $recorddb[$i]); if ($detail[1] && $detail[3] && $detail[4] && $detail[6]) { $winddate = get_date($detail[4]); $detail[6] = htmlspecialchars($detail[6]); $adlogfor .= "\r\n<tr class=\"tr1\">\r\n<td class=\"td2\"><a href='{$admin_file}?adminjob=usermanage&adminitem=edit&action=search&schname={$detail['1']}&schname_s=1' onclick=\"openNewUrl('usermanage','Óû§¹ÜÀí',this.href);return false;\">{$detail['1']}</a></td>\r\n<td class=\"td2\">{$detail['3']}</td>\r\n<td class=\"td2\">{$winddate}</td>\r\n<td class=\"td2\">{$detail['6']}</td>\r\n</tr>"; } } } } if ($job == 'shortcut') { require GetLang('left'); foreach ($nav_left['mode']['items'] as $key => $value) { $nav_left[$key] = $value;
<?php !function_exists('adminmsg') && exit('Forbidden'); require_once GetLang('all'); $basename = "{$admin_file}?adminjob=record&admintype=adminlog"; $bbsrecordfile = D_P . "data/bbscache/admin_record.php"; InitGP(array('del', 'keyword')); if (file_exists($bbsrecordfile)) { $bbslogfiledata = readlog($bbsrecordfile); } else { $bbslogfiledata = array(); } $bbslogfiledata = array_reverse($bbslogfiledata); $count = count($bbslogfiledata); if ($del == 'Y') { PostCheck($verify); if ($admin_gid == 3) { if ($count > 100) { $output = array_slice($bbslogfiledata, 0, 100); $output = array_reverse($output); $output = "<?php die;?>\r\n" . implode("", $output); writeover($bbsrecordfile, $output); adminmsg('log_del'); } else { adminmsg('log_min'); } } else { adminmsg('record_aminonly'); } } $db_perpage = 50;
function getHotOpration() { if (file_exists(D_P . 'data/bbscache/admin_record.php')) { $bbslogfiledata = readlog(D_P . 'data/bbscache/admin_record.php', 10000); } $newopration = array(); if ($bbslogfiledata) { unset($bbslogfiledata[0]); $newopration = getPurviewKeys($bbslogfiledata); $newopration = sortArrayByValue($newopration, 'DESC'); } if (is_array($newopration)) { $newopration = array_slice($newopration, 0, 5); return array_keys($newopration); } return false; }
/** * * @param <type> $action * @param <type> $filename 公用的删除接口 admin / php / mysql * @return <type> */ public static function log_admin_delete($action, $filename = 'admin') { $delete_file = ''; $delete_filename = ''; switch ($filename) { case 'admin': $delete_filename = 'admin_log.php'; break; case 'php': $delete_filename = 'php_error.log'; break; case 'mysql': $delete_filename = 'mysql_error.php'; break; } if ('yes' == $action and !empty($delete_filename)) { //PostCheck($verify); //取消判断 if (1 == If_manager) { $adminlogfile = PATH_ADMIN . "/data/log/" . $delete_filename; $logfiledata = ''; if (file_exists($adminlogfile)) { $logfiledata = readlog($adminlogfile); } else { $logfiledata = array(); } $logfiledata = array_reverse($logfiledata); $count = count($logfiledata); if ($count > 100) { if (file_exists($adminlogfile)) { $logfiledata = readlog($adminlogfile); } else { $logfiledata = array(); } $output = array_slice($logfiledata, 0, 100); $output = array_reverse($output); $output = implode("", $output); writeover($adminlogfile, $output); return true; } else { throw new Exception("日志小于100条,无需删除."); } } else { throw new Exception("没有删除权限."); } } else { throw new Exception("删除参数错误."); } }