當前位置: 首頁>>代碼示例>>PHP>>正文


PHP admin::delete_admin方法代碼示例

本文整理匯總了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);
         }
開發者ID:hiproz,項目名稱:zhaotaoci.cc,代碼行數:31,代碼來源:admin.inc.php

示例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();
開發者ID:vincentywang,項目名稱:simplenote,代碼行數:31,代碼來源:delete_admin.php


注:本文中的admin::delete_admin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。