本文整理汇总了PHP中SessionUtils::isAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionUtils::isAdmin方法的具体用法?PHP SessionUtils::isAdmin怎么用?PHP SessionUtils::isAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionUtils
的用法示例。
在下文中一共展示了SessionUtils::isAdmin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setAllNotificationsAsRead
public function setAllNotificationsAsRead()
{
$userLogged = SessionUtils::getUserLogged();
if (SessionUtils::isAdmin()) {
$query = "UPDATE sat_notify SET is_read = '1' WHERE subject_id = " . $userLogged->getUserId() . " AND context <> '" . REGISTRATION_FORM . "'";
} else {
$query = "UPDATE sat_notify SET is_read = '1' WHERE subject_id = " . $userLogged->getUserId() . " AND context <> 'add_friend_' ";
}
try {
$objectArray = $this->getDB()->execQuery($query, false);
return $objectArray;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
示例2: loadProfile
function loadProfile($view, $model)
{
try {
if (!is_null(SessionUtils::getAuthorId()) && !is_null(SessionUtils::getPost()) && !SessionUtils::isAdmin()) {
$postDto = $model->getPostModel(SessionUtils::getPost());
$view->setArg("notificationPost", $postDto);
$commentPostList = $model->getCommentPostList(SessionUtils::getPost());
$commentListIndex = 'notificationCommentList' . SessionUtils::getPost();
$view->setArg($commentListIndex, $commentPostList);
SessionUtils::setPost(NULL);
SessionUtils::setAuthorId(NULL);
} else {
$userAlbumListDTO = $model->getUserAlbumList(SessionUtils::getDashboardId());
$view->setArg('userAlbumList', $userAlbumListDTO);
$postList = $model->getPostsListModel(SessionUtils::getDashboardId());
$view->setArg('postList', $postList);
if (!is_null($postList)) {
for ($i = 0; $i < sizeof($postList); $i++) {
$index = 'post' . $i;
$postId = $postList[$index]->getPostId();
$commentPostList = $model->getCommentPostList($postId);
$commentListIndex = 'commentPostList' . $postId;
$view->setArg($commentListIndex, $commentPostList);
}
}
if (!is_null(SessionUtils::getError())) {
$view->setResponse(SessionUtils::getError());
if (!is_null(SessionUtils::getFormValue())) {
$view->setFormData(SessionUtils::getFormValue(), WRITE_POST_FORM);
}
SessionUtils::setError(NULL);
SessionUtils::setFormValue(NULL);
}
}
$view->loadPage();
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
throw $authExp;
} catch (Exception $e) {
throw $e;
}
}
示例3: getFriendsList
public function getFriendsList($userProfile)
{
if (!SessionUtils::isAdmin()) {
$query = "select ut.*, pt.*, tmp.FRIENDSSINCE \n from sat_user ut, sat_photo pt, ( \n select FRIENDID as USERID,FRIENDSSINCE \n from sat_user_friends \n where USERID = {$userProfile} \n UNION \n select USERID, FRIENDSSINCE \n from sat_user_friends \n where FRIENDID = {$userProfile} \n ) tmp \n where ut.profilephoto = pt.photoid and tmp.USERID = ut.USERID";
} else {
$query = "select distinct ut.*, pt.*, NULL AS FRIENDSSINCE from sat_user ut, sat_photo pt where ut.role <> 'ADMIN' and ut.profilephoto = pt.photoid ";
}
try {
$this->userAutentication();
$objectArray = $this->getDB()->execQuery($query);
if (is_null($objectArray)) {
return NULL;
} else {
$objectListDTO = DataModelUtils::getObjectList(FRIENDSDTO, $objectArray);
return $objectListDTO;
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
示例4:
</div>
<div class="errorDiv" id="add_photo_<?php
echo $photoId;
?>
_response" >
<?php
echo $this->getArg("add_photo_" . $photoId . "_response");
?>
</div>
</div>
</div>
<?php
}
} else {
if ($this->getArg('userCanWrite') && !SessionUtils::isAdmin()) {
?>
<div id="no_photo" class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
Non è presente nessuna foto. aggiungila!
</div>
<?php
}
}
?>
</div>
</div>
</div>
示例5:
echo $commentText;
?>
"</label>
<div class="errorDiv" id ="delete_comment_<?php
echo $commentId;
?>
_response">
<?php
echo $this->getArg("delete_comment_. {$commentId}._response");
?>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
<?php
if (SessionUtils::canDeletePost($userLogged->getUserId(), $authorId) || SessionUtils::canDeletePost($userLogged->getUserId(), $dashboardId) || SessionUtils::isAdmin()) {
?>
<form id="deleteCommentForm<?php
echo $commentId;
?>
" name="deleteCommentForm<?php
echo $commentId;
?>
" action="deleteComment/<?php
echo $commentId;
?>
" method = "post" novalidate>
<label for="delete_comment_<?php
echo $commentId;
?>
_submit" class="btn btn-danger btn-block glyphicon glyphicon-remove">
示例6:
<img src="<?php
echo URL . $friendProfilePhotoUrl;
?>
" class="img-responsive friendPhoto photoImageSize" alt=""/>
</div>
<div id="friend<?php
echo $friendId;
?>
Action">
<?php
if (!SessionUtils::isAdmin()) {
?>
<?php
if (is_null($friendsSince)) {
?>
<form id="addFriendForm<?php
echo $friendId;
?>
" name="addFriendForm<?php
echo $friendId;
?>
" action="addFriend/<?php
echo $friendId;
?>
" method = "POST">
示例7: canDeletePost
public static function canDeletePost($autorId, $dashboardid)
{
return $dashboardid == $autorId || SessionUtils::isAdmin();
}
示例8:
<?php
if (!(SessionUtils::isAdmin() && is_null(SessionUtils::getDashboardId()))) {
?>
<div class="thumbnail">
<nav class="navbar">
<ul id="commonNavBarItem" class="nav nav-pills nav-stacked ">
<?php
$lastNavbarItemSelected = $this->getArg(LAST_NAV_ITEM_SELECTED);
if ($lastNavbarItemSelected == 4) {
?>
<li class="active">
<a href="<?php
echo URL . PROFILE_CONTROLLER;
?>
">
<span class="glyphicon glyphicon-send"></span>
<span class="lateralNavBarItemName">Profile</span>
</a>
</li>
<li>
<a href="<?php
echo URL . ALBUM_CONTROLLER;
?>
">
<span class="glyphicon glyphicon-plane"></span>
<span class="lateralNavBarItemName">Album</span>
</a>
</li>