本文整理汇总了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);
示例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;
}
示例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;
}