当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionUtils::isAdmin方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:sbadi,项目名称:shareatrip,代码行数:17,代码来源:NotificationDAO.php

示例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;
     }
 }
开发者ID:sbadi,项目名称:shareatrip,代码行数:43,代码来源:Profile.php

示例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;
     }
 }
开发者ID:sbadi,项目名称:shareatrip,代码行数:22,代码来源:FriendsDAO.php

示例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>
开发者ID:sbadi,项目名称:shareatrip,代码行数:29,代码来源:PhotoPage.php

示例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">
开发者ID:sbadi,项目名称:shareatrip,代码行数:31,代码来源:CommentPage.php

示例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">
开发者ID:sbadi,项目名称:shareatrip,代码行数:30,代码来源:FriendsPage.php

示例7: canDeletePost

 public static function canDeletePost($autorId, $dashboardid)
 {
     return $dashboardid == $autorId || SessionUtils::isAdmin();
 }
开发者ID:sbadi,项目名称:shareatrip,代码行数:4,代码来源:SessionUtils.php

示例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>                    
开发者ID:sbadi,项目名称:shareatrip,代码行数:31,代码来源:Navigation.php


注:本文中的SessionUtils::isAdmin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。