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


PHP UserClass::get_privilege方法代碼示例

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


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

示例1: dirname

require_once dirname(__FILE__) . '/includes/mail.class.php';
require_once dirname(__FILE__) . '/includes/user.class.php';
require_once dirname(__FILE__) . '/includes/plugin.class.php';
setcookie('uid', $_SESSION['uid'], time() + 3600);
$login_uid = $_SESSION['uid'];
$_COOKIE['uid'] = $login_uid;
//獲取登錄用戶信息
$CUser = new UserClass();
//獲取登錄用戶名
$json_str = $CUser->get_userinfo($login_uid);
$user_obj = json_decode($json_str);
$username = $user_obj[0]->name;
//獲取登錄用戶頭像
$user_avatar = $CUser->get_avatar($login_uid);
//獲取登錄用戶權限
$user_privilege = $CUser->get_privilege($_SESSION['uid']);
//獲取站內信信息
$CMail = new MailClass($login_uid);
//獲取未讀站內信數量
$json_str = $CMail->get_mail_count();
$result_array = json_decode($json_str);
$unread_mail_count = $result_array->unread;
//獲取站內信數組
$json_str = $CMail->get_mail_list(1);
$unread_mail_array = json_decode($json_str);
$unread_mail_list = array();
if (!isset($unread_mail_array->result)) {
    foreach ($unread_mail_array as $mail_obj) {
        $fromuser_avatar = $CUser->get_avatar($mail_obj->fromuid);
        $item = array('mid' => $mail_obj->mid, 'title' => $mail_obj->title, 'date' => $mail_obj->date, 'fromuser_avatar' => $fromuser_avatar);
        array_push($unread_mail_list, $item);
開發者ID:Knightnoob,項目名稱:cs-xiyoulinux,代碼行數:31,代碼來源:init.php

示例2: dirname

<?php

require_once dirname(__FILE__) . '/includes/user.class.php';
if (!isset($_SESSION['uid'])) {
    exit;
}
$userObj = new UserClass();
$permisson = $userObj->get_privilege($_SESSION['uid']);
if ($permisson != '1') {
    echo '<script type="text/javascript">javascript:history.back(1);</script>';
    //header('location: ' . $_SERVER["HTTP_REFERER"]);
    exit;
}
開發者ID:Knightnoob,項目名稱:cs-xiyoulinux,代碼行數:13,代碼來源:privilege_ctrl.php

示例3: update

function update()
{
    if ($_POST['lid'] == "" || $_POST['title'] == "" || $_POST['time'] == "" || $_POST['location'] == "") {
        return "-1";
    }
    $db = new DBClass();
    $sql = "SELECT uid FROM `app_lecture_info` WHERE lid = " . $_POST['lid'];
    $result = $db->query($sql);
    if ($result->num_rows <= 0) {
        return "-2";
    } else {
        $row = $result->fetch_assoc();
        $userObj = new UserClass();
        $permisson = $userObj->get_privilege($_SESSION['uid']);
        if ($_SESSION['uid'] != $row["uid"] && $permisson != '1') {
            return "-3";
        }
    }
    $lecture_inc = new LectureClass();
    $result = $lecture_inc->update_lecture($_POST['lid'], $_POST['title'], $_POST['time'], $_POST['location'], $_POST['tag'], $_POST['description'], $_POST['slide']);
    return $result;
}
開發者ID:Knightnoob,項目名稱:cs-xiyoulinux,代碼行數:22,代碼來源:lecture.server.php


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