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


PHP Util::signOutAndRedirect方法代码示例

本文整理汇总了PHP中Ubirimi\Util::signOutAndRedirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::signOutAndRedirect方法的具体用法?PHP Util::signOutAndRedirect怎么用?PHP Util::signOutAndRedirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ubirimi\Util的用法示例。


在下文中一共展示了Util::signOutAndRedirect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $entityId = $request->get('id');
     if (Util::checkUserIsLoggedIn()) {
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $loggedInUserId = $session->get('user/id');
         $page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
         if ($page) {
             $spaceId = $page['space_id'];
         }
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'] . ' / Attachments';
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
         $documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
         $page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
         if ($page) {
             $spaceId = $page['space_id'];
             $spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
             if (!($documentatorUseAnonymous && $spaceHasAnonymousAccess)) {
                 Util::signOutAndRedirect();
                 die;
             }
         }
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'] . ' / Attachments';
     }
     $menuSelectedCategory = 'documentator';
     if ($page) {
         $attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
     }
     return $this->render(__DIR__ . '/../../../Resources/views/page/attachment/View.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:34,代码来源:ViewController.php

示例2: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientSettings = $session->get('client/settings');
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $clientId = $session->get('client/id');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $clientSettings = $this->getRepository(UbirimiClient::class)->getById($clientId);
         $loggedInUserId = null;
         $settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
         $documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
         $documentatorAnonymousViewUserProfiles = $settingsDocumentador['anonymous_view_user_profile_flag'];
         if (!($documentatorUseAnonymous && $documentatorAnonymousViewUserProfiles)) {
             Util::signOutAndRedirect();
             die;
         }
     }
     $userId = $request->get('id');
     $user = $this->getRepository(UbirimiUser::class)->getById($userId);
     if ($user['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $menuSelectedCategory = 'documentator';
     $activities = $this->getRepository(UbirimiUser::class)->getDocumentadorActivityStream($userId);
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $user['first_name'] . ' ' . $user['last_name'] . ' / Activity';
     return $this->render(__DIR__ . '/../../Resources/views/user/Activity.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:ActivityController.php

示例3: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $entityId = $request->get('id');
     if (Util::checkUserIsLoggedIn()) {
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $page = $this->getRepository(Entity::class)->getById($entityId, $session->get('user/id'));
         if ($page) {
             $spaceId = $page['space_id'];
         }
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'];
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $settingsDocumentador = $this->getRepository(UbirimiClient::class)->getDocumentadorSettings($clientId);
         $documentatorUseAnonymous = $settingsDocumentador['anonymous_use_flag'];
         $page = $this->getRepository(Entity::class)->getById($entityId, $loggedInUserId);
         if ($page) {
             $spaceId = $page['space_id'];
             $spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
             if (!($documentatorUseAnonymous && $spaceHasAnonymousAccess)) {
                 Util::signOutAndRedirect();
                 die;
             }
         }
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / ' . $page['name'];
     }
     $menuSelectedCategory = 'documentator';
     if ($page) {
         $parentEntityId = $page['parent_entity_id'];
         $parentPage = null;
         if ($parentEntityId) {
             $parentPage = $this->getRepository(Entity::class)->getById($parentEntityId);
         }
         $revisionId = $request->attributes->has('rev_id') ? str_replace('/', '', $request->get('rev_id')) : null;
         if ($revisionId) {
             $revision = $this->getRepository(Entity::class)->getRevisionsByPageIdAndRevisionId($entityId, $revisionId);
         }
         $space = $this->getRepository(Space::class)->getById($spaceId);
         if ($space['client_id'] != $session->get('client/id')) {
             return new RedirectResponse('/general-settings/bad-link-access-denied');
         }
         $pagesInSpace = $this->getRepository(Entity::class)->getAllBySpaceId($spaceId);
         $treeStructure = $this->getRepository(Space::class)->generateTreeStructure($pagesInSpace, $entityId);
         $comments = $this->getRepository(EntityComment::class)->getComments($entityId, 'array');
         $lastRevision = $this->getRepository(Entity::class)->getLastRevisionByPageId($entityId);
         $childPages = $this->getRepository(Entity::class)->getChildren($entityId);
         $pageFiles = $this->getRepository(Entity::class)->getFilesByEntityId($entityId);
         $attachments = $this->getRepository(EntityAttachment::class)->getByEntityId($entityId);
     }
     return $this->render(__DIR__ . '/../../Resources/views/page/View.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:52,代码来源:ViewController.php

示例4: checkUserIsLoggedInAndRedirect

 public static function checkUserIsLoggedInAndRedirect($context = null)
 {
     if (!Util::checkUserIsLoggedIn()) {
         Util::signOutAndRedirect($context);
     }
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:6,代码来源:Util.php


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