本文整理汇总了PHP中admin_log函数的典型用法代码示例。如果您正苦于以下问题:PHP admin_log函数的具体用法?PHP admin_log怎么用?PHP admin_log使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了admin_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_permissions
function admin_permissions($login, $year)
{
global $conf_sysadmins, $conf_data_path;
$perms = array();
if (!in_array($login, $conf_sysadmins)) {
$perms_path = $conf_data_path . "/permissions.json";
if (file_exists($perms_path)) {
$all_perms = json_decode(file_get_contents($perms_path), true);
$perms = $all_perms[$login];
}
if ($conf_zamger) {
// Sysadmins can see all courses, other just those they are teachers for
require_once "zamger/courses.php";
$tcs = teacher_courses($year);
if ($tcs == false) {
admin_log("failed to retrieve courses");
niceerror("Neuspješno preuzimanje spiska predmeta");
print "<p>Konekcija na Zamger ne funkcioniše. Probajte logout pa login...</p>\n";
print "</body></html>\n";
return 0;
}
if (empty($tcs)) {
niceerror("Izgleda da nemate status nastavnika niti na jednom predmetu.");
return 0;
}
foreach ($tcs as $tc) {
$c9id = "X" . $tc['id'] . "_" . $year;
if (!in_array($c9id, $perms)) {
$perms[] = $c9id;
}
}
}
}
return $perms;
}
示例2: remove
public function remove($pr_id)
{
if (!$pr_id && ($pr_id = $this->input->get('pr_ids'))) {
$pr_id = implode(',', $pr_id);
}
if (!Validate::isJoinedIntStr($pr_id)) {
message('请选择需要删除的职业能力倾向');
}
if (ProfessionRelatedModel::removeProfessionRelated($pr_id)) {
admin_log('delete', 'vocational_aptitude', $pr_id);
message('删除成功', '/admin/vocational_aptitude/index');
} else {
message('删除失败', '/admin/vocational_aptitude/index');
}
}
示例3: remove
public function remove($profession_id)
{
if (!$profession_id && ($profession_id = $this->input->get('profession_ids'))) {
$profession_id = implode(',', $profession_id);
}
if (!Validate::isJoinedIntStr($profession_id)) {
message('请选择需要删除的职业');
}
if (ProfessionModel::removeProfession($profession_id)) {
admin_log('delete', 'profession', $profession_id);
message('删除成功', '/admin/profession/index');
} else {
message('删除失败', '/admin/profession/index');
}
}
示例4: auto_archive
/**
* Archive articles (cron task function).
*
* @param vivvo_lite_site $sm
*/
function auto_archive($sm)
{
require_once VIVVO_FS_INSTALL_ROOT . 'lib/vivvo/core/Articles.class.php';
if (VIVVO_ARTICLE_AUTO_ARCHIVE > 0) {
$article_list = new Articles_list();
$search_params = array('search_cid' => VIVVO_ARTICLE_AUTO_ARCHIVE_ITEMS, 'search_before_after' => 0, 'search_search_date' => VIVVO_ARTICLE_AUTO_ARCHIVE);
$article_list->search($search_params, '', 'ascending', 0, 0, false);
require_once VIVVO_FS_FRAMEWORK . 'vivvo_post.php';
$article_list->sql_update_list(new vivvo_post_master(), array('status' => '-1'), null, true);
if (defined('VIVVO_CRONJOB_MODE')) {
echo 'auto_archive: Finished.' . PHP_EOL;
} else {
admin_log('(Cron task: Auto Archive)', 'Finished.');
}
}
}
示例5: update_status
/**
* 修改借款信息状态
* @param integer $id ID
* @param integer $status 状态值
* @return boolean
*/
public function update_status($id, $status)
{
$data['status'] = $status;
if ($status == 'verified' || $status == 'auto_lock') {
$data['verified_time'] = time();
}
if ($status == 'repayment') {
$data['reverified_time'] = time();
}
$result = $this->update($id, $data);
if ($result) {
isset($_SESSION['user']) ? admin_log($_SESSION['user']['username'] . "修改了借款信息状态:将" . $id . '状态修改为:' . $this->status[$status]) : '';
return TRUE;
} else {
return FALSE;
}
}
示例6: auto_delete
/**
* Delete articles (cron task function).
*
* @param vivvo_lite_site $sm
*/
function auto_delete($sm)
{
require_once VIVVO_FS_INSTALL_ROOT . 'lib/vivvo/core/Articles.class.php';
if (VIVVO_ARTICLE_AUTO_DELETE > 0) {
$al = new Articles_list($sm);
$al->_query->add_where('created < ( DATE_SUB( \'' . date('Y-m-d H:i:s') . '\', INTERVAL ' . VIVVO_ARTICLE_AUTO_DELETE . ' DAY ))');
$al->_query->set_from('`' . VIVVO_DB_PREFIX . 'articles`');
$al->_query->add_fields('*');
$article_params['search_options']['search_cid'] = VIVVO_ARTICLE_AUTO_DELETE_ITEMS;
$al->search($article_params['search_options'], '', 'ascending', 0, 0, false);
require_once VIVVO_FS_FRAMEWORK . 'vivvo_post.php';
$pm = new vivvo_post_master($sm);
$al->sql_delete_list($pm, NULL, true);
if (defined('VIVVO_CRONJOB_MODE')) {
echo 'auto_delete: Finished.' . PHP_EOL;
} else {
admin_log('(Cron task: Auto Delete)', 'Finished.');
}
}
}
示例7: do_restore
function do_restore()
{
global $config, $plugin_config, $db;
$file = $_FILES['file']['tmp_name'];
$f = file($file);
$first_line = trim($f[0]);
$second_line = trim($f[1]);
global $t;
$t->assign('backup_header', "{$first_line}<br />{$second_line}");
$f = join('', $f);
if (!strlen($f)) {
fatal_error("Uploaded file is empty!");
}
if (!preg_match('/^### aMember Pro .+? database backup/', $first_line)) {
fatal_error("Uploaded file is not valid aMember Pro backup");
}
foreach (preg_split('/;\\n/', $f) as $sql) {
if (strlen($sql)) {
$db->query($sql);
}
}
admin_log("Restored from {$first_line}");
}
示例8: login
public function login()
{
$u = t(v('uname'));
$p = t(v('psw'));
if (true !== $this->loginCheck($u, $p)) {
return ajax_json(array('title' => '登录失败:', 'status' => 1, 'msg' => '用户名或者密码错误!'));
}
// $p=md5(v('psw'));
$sql = "select name from admin_user as u where u.name=" . s($u);
$result = get_line($sql);
//var_dump($result);
if (!$result) {
return ajax_json(array('title' => '登录失败:', 'status' => 1, 'msg' => '用户名或者密码错误1!'));
} elseif ($result['status'] == 'delete') {
return ajax_json(array('title' => '登录失败:', 'status' => 1, 'msg' => '用户已经被封禁!'));
} elseif ($result['status'] == 'active') {
ss_set('uid', $result['id']);
ss_set('email', $result['email']);
ss_set('nickname', $result['nickname']);
ss_set('uname', $u);
admin_log($result['id'], "登录后台管理系统.");
return ajax_json(array('title' => '登录成功:', 'status' => 0, 'msg' => '您已成功登录!'));
}
}
示例9: new_region_id
$delete_region[] = $id;
$new_region_id = $id;
if ($region_type < 6) {
for ($i = 1; $i < 6 - $region_type; $i++) {
$new_region_id = new_region_id($new_region_id);
if (count($new_region_id)) {
$delete_region = array_merge($delete_region, $new_region_id);
} else {
continue;
}
}
}
$sql = "DELETE FROM " . $ecs->table("region") . "WHERE region_id" . db_create_in($delete_region);
$db->query($sql);
if ($exc->drop($id)) {
admin_log(addslashes($region['region_name']), 'remove', 'area');
/* 获取地区列表 */
$region_arr = area_list($region['parent_id']);
$smarty->assign('region_arr', $region_arr);
$smarty->assign('region_type', $region['region_type']);
make_json_result($smarty->fetch('area_list.htm'));
} else {
make_json_error($db->error());
}
}
function new_region_id($region_id)
{
$regions_id = array();
if (empty($region_id)) {
return $regions_id;
}
示例10: gmtime
$sql = "INSERT INTO " . $ecs->table('admin_message') . " (sender_id, receiver_id, sent_time, " . "read_time, readed, deleted, title, message) " . "VALUES ('" . $_SESSION['admin_id'] . "', '{$_POST['receiver_id']}', '" . gmtime() . "', " . "0, '0', '0', '{$_POST['title']}', '{$_POST['message']}')";
$db->query($sql);
$link[0]['text'] = $_LANG['back_list'];
$link[0]['href'] = 'message.php?act=list';
sys_msg($_LANG['send_msg'] . ' ' . $_LANG['action_succeed'], 0, $link);
/* 记录管理员操作 */
admin_log(addslashes($_LANG['send_msg']), 'add', 'admin_message');
} elseif ($_REQUEST['act'] == 'drop_msg') {
if (isset($_POST['checkboxes'])) {
$count = 0;
foreach ($_POST['checkboxes'] as $key => $id) {
$sql = "UPDATE " . $ecs->table('admin_message') . " SET " . "deleted = '1'" . "WHERE message_id = '{$id}' AND (sender_id='{$_SESSION['admin_id']}' OR receiver_id='{$_SESSION['admin_id']}')";
$db->query($sql);
$count++;
}
admin_log('', 'remove', 'admin_message');
$link[] = array('text' => $_LANG['back_list'], 'href' => 'message.php?act=list');
sys_msg(sprintf($_LANG['batch_drop_success'], $count), 0, $link);
} else {
sys_msg($_LANG['no_select_msg'], 1);
}
} elseif ($_REQUEST['act'] == 'remove') {
$id = intval($_GET['id']);
$sql = "UPDATE " . $ecs->table('admin_message') . " SET deleted=1 " . " WHERE message_id={$id} AND (sender_id='{$_SESSION['admin_id']}' OR receiver_id='{$_SESSION['admin_id']}')";
$db->query($sql);
$url = 'message.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
ecs_header("Location: {$url}\n");
exit;
}
/**
* 获取管理员留言列表
示例11: admin_log
//insert
$sql = "insert into " . $ecs->table("teacher") . " (name,sexuality,birthday,\r\n\t\tnational,id_card,phone,email,address,\r\n\t\ttitle,is_header,level,class_code,\r\n\t\tcreated )\r\n\t\tvalues \r\n\t\t\t('" . $_REQUEST["name"] . "','" . $_REQUEST["sexuality"] . "',\r\n\t\t\t'" . $_REQUEST["birthday"] . "','" . $_REQUEST["national"] . "',\r\n\t\t\t'" . $_REQUEST["id_card"] . "','" . $_REQUEST["phone"] . "','" . $_REQUEST["email"] . "',\r\n\t\t\t'" . $_REQUEST["address"] . "','" . $_REQUEST["title"] . "','" . $_REQUEST["is_header"] . "',\r\n\t\t\t'" . $_REQUEST["level"] . "','" . $_SESSION["class_code"] . "',\r\n\t\t\tnow())";
$db->query($sql);
admin_log(addslashes($_REQUEST["name"]), 'add', 'teacher');
make_json_result("添加“" . $_REQUEST["name"] . "”成功!");
} else {
$sql = "update " . $ecs->table("teacher") . " set name='" . $_REQUEST["name"] . "',\r\n\t\t\tsexuality='" . $_REQUEST["sexuality"] . "',\r\n\t\t\tbirthday='" . $_REQUEST["birthday"] . "',\r\n\t\t\tnational='" . $_REQUEST["national"] . "',\r\n\t\t\tid_card='" . $_REQUEST["id_card"] . "',\r\n\t\t\tphone='" . $_REQUEST["phone"] . "',\r\n\t\t\temail='" . $_REQUEST["email"] . "',\r\n\t\t\taddress='" . $_REQUEST["address"] . "',\r\n\t\t\ttitle='" . $_REQUEST["title"] . "',\r\n\t\t\tis_header='" . $_REQUEST["is_header"] . "',\r\n\t\t\tlevel='" . $_REQUEST["level"] . "'\r\n\t\t\twhere teacher_id=" . $id;
$db->query($sql);
admin_log(addslashes($_REQUEST["name"]), 'update', 'teacher');
make_json_result("修改“" . $_REQUEST["name"] . "”成功!");
}
} elseif ($_REQUEST['act'] == 'ajax_delete') {
$id = !empty($_REQUEST['teacher_id']) ? intval($_REQUEST['teacher_id']) : 0;
$sql = "delete from " . $ecs->table("teacher") . " where teacher_id=" . $id;
$db->query($sql);
admin_log($_REQUEST["teacher_id"], 'delete', 'teacher');
make_json_result("删除成功!");
}
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function teacher_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
示例12: check_authz_json
/* 检查权限 */
check_authz_json('shop_config');
/* 取得参数 */
$code = trim($_GET['code']);
$filename = $_CFG[$code];
//删除文件
@unlink($filename);
//更新设置
update_configure($code, '');
/* 记录日志 */
admin_log('', 'edit', 'shop_config');
/* 清除缓存 */
clear_all_files();
sys_msg($_LANG['save_success'], 0);
}
/**
* 设置系统设置
*
* @param string $key
* @param string $val
*
* @return boolean
示例13: foreach
foreach ($order_id_list as $id_order) {
/* 检查能否操作 */
$order = order_info('', $id_order);
$operable_list = operable_list($order);
if (!isset($operable_list['remove'])) {
$sn_not_list[] = $id_order;
continue;
}
/* 删除订单 */
$db->query("DELETE FROM " . $ecs->table('order_info') . " WHERE order_id = '{$order['order_id']}'");
$db->query("DELETE FROM " . $ecs->table('order_goods') . " WHERE order_id = '{$order['order_id']}'");
$db->query("DELETE FROM " . $ecs->table('order_action') . " WHERE order_id = '{$order['order_id']}'");
$action_array = array('delivery', 'back');
del_delivery($order['order_id'], $action_array);
/* todo 记录日志 */
admin_log($order['order_sn'], 'remove', 'order');
$sn_list[] = $order['order_sn'];
}
$sn_str = $_LANG['remove_order'];
} else {
die('invalid params');
}
/* 取得备注信息 */
// $action_note = $_REQUEST['action_note'];
if (empty($sn_not_list)) {
$sn_list = empty($sn_list) ? '' : $_LANG['updated_order'] . join($sn_list, ',');
$msg = $sn_list;
$links[] = array('text' => $_LANG['return_list'], 'href' => 'order.php?act=list&' . list_link_postfix());
sys_msg($msg, 0, $links);
} else {
$order_list_no_fail = array();
示例14: batch_unshenhe
public function batch_unshenhe()
{
$ids = $this->input->post('ids');
if (empty($ids) or !is_array($ids)) {
message('请选择要取消审核的题目!');
return;
}
$success = $fail = 0;
foreach ($ids as $id) {
$this->examine_permission($id);
$be_tested = QuestionModel::question_has_test_action($id);
$question = QuestionModel::get_question($id);
if ($be_tested || !$this->has_question_check($question) || $question['is_original'] != 1 || $question['check'] != 1) {
$fail++;
continue;
}
$sql = "update {pre}question set `check`=0 where ques_id='{$id}'";
$return = $this->db->query($sql);
if ($return === true) {
$liyo = 'unexamine';
admin_log($liyo, 'question', $id);
$success++;
} else {
$fail++;
}
}
$back_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'admin/question_external/index';
message('批量操作完成,成功取消审核:' . $success . ' 个,失败:' . $fail . ' 个。', $back_url);
}
示例15: sys_msg
sys_msg($_LANG['no_select_goods'], 1);
}
$count = 0;
foreach ($_POST['checkboxes'] as $key => $id) {
if ($exc->drop($id)) {
admin_log($id, 'remove', 'exchange_goods');
$count++;
}
}
$lnk[] = array('text' => $_LANG['back_list'], 'href' => 'exchange_goods.php?act=list');
sys_msg(sprintf($_LANG['batch_remove_succeed'], $count), 0, $lnk);
} elseif ($_REQUEST['act'] == 'remove') {
check_authz_json('exchange_goods');
$id = intval($_GET['id']);
if ($exc->drop($id)) {
admin_log($id, 'remove', 'article');
clear_cache_files();
}
$url = 'exchange_goods.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
ecs_header("Location: {$url}\n");
exit;
} elseif ($_REQUEST['act'] == 'search_goods') {
include_once ROOT_PATH . 'includes/cls_json.php';
$json = new JSON();
$filters = $json->decode($_GET['JSON']);
$arr = get_goods_list($filters);
make_json_result($arr);
}
/* 获得商品列表 */
function get_exchange_goodslist()
{