本文整理汇总了PHP中admin::delete_admin方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::delete_admin方法的具体用法?PHP admin::delete_admin怎么用?PHP admin::delete_admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::delete_admin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dmsg
$do->cache_right($userid);
$do->cache_menu($userid);
}
dmsg('修改成功', '?file=' . $file);
}
msg($do->errmsg);
} else {
if (!$userid) {
msg();
}
$user = $do->get_one($userid, 0);
include tpl('admin_edit');
}
break;
case 'delete':
if ($do->delete_admin($username)) {
dmsg('撤销成功', $this_forward);
}
msg($do->errmsg);
break;
case 'right':
if (!$userid) {
msg();
}
$user = $do->get_one($userid, 0);
if ($submit) {
$right[0]['action'] = $right[0]['action'] ? implode('|', $right[0]['action']) : '';
$right[0]['catid'] = $right[0]['catid'] ? implode('|', $right[0]['catid']) : '';
if ($do->update($userid, $right, $user['admin'])) {
dmsg('更新成功', '?file=' . $file . '&action=right&userid=' . $userid);
}
示例2:
$current_admin = admin::find_admin_by_id($_GET["admin"]);
?>
<?php
if (!$current_admin) {
$_SESSION["message"] = "Can't find this admin.";
utility::redirect_to("manage_admins.php");
}
?>
<?php
$key = "admin_id";
$subject_set = subject::find_subjects_by_admin($current_admin["id"], false);
if ($current_admin["id"] == $my_session->return_session_data($key)) {
$_SESSION["message"] = "YOU CAN'T DELETE YOURSELF!!";
utility::redirect_to("manage_admins.php");
}
if ($current_admin["id"] == admin::$super_user) {
$_SESSION["message"] = "YOU DON'T HAVE PRIVILEGE TO DELETE SUPERUSER";
utility::redirect_to("manage_admins.php");
}
if (subject::subjectset_not_empty($subject_set)) {
$_SESSION["message"] = "DELETION FAILED, THIS USER STILL HAVE POSTED NOTES!";
utility::redirect_to("manage_admins.php");
}
?>
<?php
admin::delete_admin($current_admin["id"]);
ob_end_flush();