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


PHP admin::logout方法代碼示例

本文整理匯總了PHP中admin::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP admin::logout方法的具體用法?PHP admin::logout怎麽用?PHP admin::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在admin的用法示例。


在下文中一共展示了admin::logout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: load

 function load($user_id)
 {
     if (self::$user) {
         return true;
     }
     db::table('admin_users');
     db::where('user_id', $user_id);
     db::where('user_pub', 1);
     db::limit(1);
     self::$user = db::assoc();
     if (db::rows() == 0) {
         admin::logout();
     }
     define("ADMIN_USER_ID", $user_id);
     define("ADMIN_USER_SITE_ID", self::get('site_id'));
     define("ADMIN_USER_GROUP_ID", self::get('group_id'));
     s::set('ADMIN_USER_LOGIN', self::get('user_login'));
     s::set('ADMIN_USER_ID', $user_id);
     return true;
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:20,代碼來源:adminUser.php

示例2: header

     break;
 case "login":
     if ($ps->login()) {
         if ($_POST['forward_url']) {
             header("Location: " . $_POST['forward_url']);
         }
         $ps->select_gallery($_POST['gallery']);
         $adminMessage = "Welcome to Organize";
         $includeFile = "view";
     } else {
         $adminMessage = $ps->last_error();
         $includeFile = "login";
     }
     break;
 case "logout":
     $ps->logout();
     $adminMessage = "Thank you and goodbye!";
     $includeFile = "login";
     break;
 case "manageusers":
     if (!$ps->is_admin()) {
         $ps->select_gallery();
         $adminMessage = "You do not have permission to perform this operation.";
         $includeFile = "view";
     } else {
         $includeFile = "manageusers";
     }
     break;
 case "newuser":
     if (!$ps->is_admin()) {
         $ps->select_gallery();
開發者ID:noeljackson,項目名稱:PhotoStack,代碼行數:31,代碼來源:organize.php

示例3: load_class

<?php

/**
 * Load required classes
 */
load_class(array('login', 'admin'));
$login_obj = new login();
if (isset($_GET["logout"])) {
    admin::logout();
}
if (isset($_POST["method"]) && $_POST["method"] == 'change_password') {
    $current_password = $_POST["current_password"];
    $new_password = $_POST["new_password"];
    $user_id = $_SESSION["admin_data"]["user_id"];
    $data_array = array("password" => $new_password, "modified" => currentDate());
    $login_obj->db->where("user_id", $user_id);
    $login_obj->db->where("password", $current_password);
    $row = $login_obj->db->get($login_obj->tableName, null, 'user_id');
    if ($row) {
        $login_obj->db->where("user_id", $user_id);
        $row = $login_obj->db->update($login_obj->tableName, $data_array);
        echo "success";
    } else {
        echo "invaild";
    }
    die;
}
開發者ID:sarbjit399,項目名稱:timeshare-code,代碼行數:27,代碼來源:change_password_code.php


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