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


PHP Util::checkUserIsLoggedIn方法代码示例

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


在下文中一共展示了Util::checkUserIsLoggedIn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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()) {
         $clientId = $session->get('client/id');
         $issuesPerPage = $session->get('user/issues_per_page');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $issuesPerPage = 25;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / 2 Dimensional Filter Statistics';
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $allProjects = $this->getRepository(UbirimiClient::class)->getProjects($clientId);
     $menuSelectedCategory = 'home';
     $section = '2-dimensional-filter-statistics';
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectIdsArray = array();
     $projectIdsNames = array();
     for ($i = 0; $i < count($projects); $i++) {
         $projectIdsArray[] = $projects[$i]['id'];
         $projectIdsNames[] = array($projects[$i]['id'], $projects[$i]['name']);
     }
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $twoDimensionalData = null;
     if (count($projectIdsArray)) {
         $twoDimensionalData = $this->getRepository(Issue::class)->get2DimensionalFilter(-1, 'array');
     }
     $issueStatuses = $this->getRepository(IssueSettings::class)->getAllIssueSettings('status', $clientId, 'array');
     $usersAsAssignee = $this->getRepository(UbirimiUser::class)->getByClientId($clientId);
     return $this->render(__DIR__ . '/../Resources/views/TwoDimensionalFilterStatistics.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:33,代码来源:TwoDimensionalFilterStatisticsController.php

示例3: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $clientId = $session->get('client/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $loggedInUserId = null;
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     if ($request->request->has('show_report')) {
         $statisticType = Util::cleanRegularInputField($request->request->get('statistic_type'));
         $chartType = Util::cleanRegularInputField($request->request->get('chart_type'));
         return new RedirectResponse('/yongo/project/reports/' . $projectId . '/chart-report/' . $statisticType . '/' . $chartType);
     }
     $issueQueryParameters = array('project' => array($projectId), 'resolution' => array(-2));
     $issues = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $hasAdministerProjectsPermission = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_ADMINISTER_PROJECTS);
     $hasAdministerProject = $hasGlobalSystemAdministrationPermission || $hasGlobalAdministrationPermission || $hasAdministerProjectsPermission;
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Reports / Chart';
     $menuSelectedCategory = 'project';
     return $this->render(__DIR__ . '/../../../Resources/views/project/report/ViewChart.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:ViewChartController.php

示例4: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $Id = $request->get('id');
     $loggedInUserId = $session->get('user/id');
     $clientId = $session->get('client/id');
     if (Util::checkUserIsLoggedIn()) {
         $issue = $this->getRepository(Issue::class)->getById($Id, $loggedInUserId);
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $issue['project_code'] . '-' . $issue['nr'];
         $clientSettings = $session->get('client/settings');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $issue = $this->getRepository(Issue::class)->getById($Id, $loggedInUserId);
         $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $issue['project_code'] . '-' . $issue['nr'];
     }
     $issueProject = $this->getRepository(YongoProject::class)->getById($issue['issue_project_id']);
     if ($issueProject['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $issueId = $issue['id'];
     $components = $this->getRepository(IssueComponent::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id']);
     $versionsAffected = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id'], Issue::ISSUE_AFFECTED_VERSION_FLAG);
     $versionsTargeted = $this->getRepository(IssueVersion::class)->getByIssueIdAndProjectId($issueId, $issue['issue_project_id'], Issue::ISSUE_FIX_VERSION_FLAG);
     $attachments = $this->getRepository(IssueAttachment::class)->getByIssueId($issueId);
     $countAttachments = 0;
     if ($attachments) {
         $countAttachments = $attachments->num_rows;
     }
     return $this->render(__DIR__ . '/../../Resources/views/issue/Print.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:32,代码来源:PrintController.php

示例5: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $clientId = $session->get('client/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $loggedInUserId = null;
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $currentDate = Util::getServerCurrentDateTime();
     $dateFrom = date_create(Util::getServerCurrentDateTime());
     $dateTo = date_format(date_create(Util::getServerCurrentDateTime()), 'Y-m-d');
     date_sub($dateFrom, date_interval_create_from_date_string('1 months'));
     $dateFrom = date_format($dateFrom, 'Y-m-d');
     $issueQueryParameters = array('project' => array($projectId), 'resolution' => array(-2));
     $issues = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $hasAdministerProjectsPermission = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_ADMINISTER_PROJECTS);
     $hasAdministerProject = $hasGlobalSystemAdministrationPermission || $hasGlobalAdministrationPermission || $hasAdministerProjectsPermission;
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Reports';
     $menuSelectedCategory = 'project';
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewReportsSummary.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:31,代码来源:ViewReportsSummaryController.php

示例6: 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

示例7: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $loggedInUserId = null;
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Dashboard';
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Dashboard';
     }
     $type = $request->get('type');
     $menuSelectedCategory = 'documentator';
     if ($type == 'spaces') {
         if (Util::checkUserIsLoggedIn()) {
             $spaces = $this->getRepository(Space::class)->getByClientId($session->get('client/id'), 1);
         } else {
             $spaces = $this->getRepository(Space::class)->getByClientIdAndAnonymous($session->get('client/id'));
         }
     } else {
         if ($type == 'pages') {
             $pages = $this->getRepository(Entity::class)->getFavouritePagesByClientIdAndUserId($session->get('client/id'), $loggedInUserId);
         }
     }
     return $this->render(__DIR__ . '/../Resources/views/Dashboard.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:27,代码来源:DashboardController.php

示例8: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $loggedInUserId = $session->get('user/id');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
     }
     $projectId = $request->request->get('id');
     $selectedProjectId = $projectId;
     if ($projectId == -1) {
         $projects = array();
         $projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS, 'array');
         for ($i = 0; $i < count($projectsForBrowsing); $i++) {
             $projects[] = $projectsForBrowsing[$i]['id'];
         }
     } else {
         $projects = array((int) $projectId);
     }
     $issueQueryParameters = array('issues_per_page' => 20, 'resolution' => array(-2), 'sort' => 'code', 'sort_order' => 'desc', 'project' => $projects);
     if ($loggedInUserId) {
         $issueQueryParameters['not_assignee'] = $loggedInUserId;
     }
     $issuesUnresolvedOthers = $this->getRepository(Issue::class)->getByParameters($issueQueryParameters, $loggedInUserId, null, $loggedInUserId);
     $renderParameters = array('issues' => $issuesUnresolvedOthers, 'render_checkbox' => false, 'show_header' => true);
     $renderColumns = array('code', 'summary', 'priority', 'assignee');
     $projects = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectIdsNames = array();
     for ($i = 0; $i < count($projects); $i++) {
         $projectIdsNames[] = array($projects[$i]['id'], $projects[$i]['name']);
     }
     $clientSettings = $session->get('client/settings');
     return $this->render(__DIR__ . '/../../Resources/views/charts/ViewUnresolvedOthers.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:35,代码来源:ViewUnresolvedOthersController.php

示例9: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $clientId = $session->get('client/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $versionId = $request->get('id');
     $version = $this->getRepository(YongoProject::class)->getVersionById($versionId);
     $projectId = $version['project_id'];
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $menuSelectedCategory = 'project';
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Version: ' . $version['name'] . ' / Summary';
     $issuesResult = $this->getRepository(Issue::class)->getByParameters(array('project' => $projectId, 'resolution' => array(-2), 'page' => 1, 'version' => array($versionId), 'issues_per_page' => 10), $loggedInUserId);
     $issues = $issuesResult[0];
     $issuesResultUpdatedRecently = $this->getRepository(Issue::class)->getByParameters(array('project' => $projectId, 'resolution' => array(-2), 'page' => 1, 'issues_per_page' => 10, 'sort' => 'updated', 'version' => array($versionId), 'sort_order' => 'desc'), $loggedInUserId);
     $issuesUpdatedRecently = $issuesResultUpdatedRecently[0];
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewVersionSummary.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:26,代码来源:ViewVersionSummaryController.php

示例10: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $projectId = $request->get('id');
     if (Util::checkUserIsLoggedIn()) {
         $loggedInUserId = $session->get('user/id');
         $clientId = $session->get('client/id');
         $project = $this->getRepository(YongoProject::class)->getById($projectId);
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'];
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $project = $this->getRepository(YongoProject::class)->getById($projectId);
         $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'];
     }
     $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS, $loggedInUserId);
     if ($project['client_id'] != $clientId || !$hasBrowsingPermission) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $session->set('selected_project_id', $projectId);
     $menuSelectedCategory = 'project';
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $hasAdministerProjectsPermission = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_ADMINISTER_PROJECTS);
     $hasAdministerProject = $hasGlobalSystemAdministrationPermission || $hasGlobalAdministrationPermission || $hasAdministerProjectsPermission;
     $menuProjectCategory = 'summary';
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewSummary.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:29,代码来源:ViewSummaryController.php

示例11: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $clientId = $session->get('client/id');
     $helpdeskFlag = 0;
     $loggedInUser = Util::checkUserIsLoggedIn();
     if ($loggedInUser) {
         if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_HELP_DESK) {
             $helpdeskFlag = 1;
         }
     }
     $projectId = $request->request->get('id');
     $date = date("Y-m-d", strtotime("-1 month"));
     $date = date('Y-m-d', strtotime("+1 day", strtotime($date)));
     $dateWithoutYear = date("d M", strtotime("-1 month"));
     $currentDate = date("Y-m-d");
     $result = array();
     while (strtotime($date) <= strtotime($currentDate)) {
         $countAllIssues = $this->getRepository(YongoProject::class)->getTotalIssuesPreviousDate($clientId, $projectId, $date, $helpdeskFlag);
         $resolvedCount = $this->getRepository(YongoProject::class)->getTotalIssuesResolvedOnDate($clientId, $projectId, $date, $helpdeskFlag);
         $result[] = array($dateWithoutYear, $countAllIssues, $resolvedCount);
         $dateWithoutYear = date('d M', strtotime("+1 day", strtotime($date)));
         $date = date('Y-m-d', strtotime("+1 day", strtotime($date)));
     }
     return new JsonResponse($result);
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:25,代码来源:ViewCreatedVsResolvedController.php

示例12: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $clientId = $session->get('client/id');
         $loggedInUserId = $session->get('user/id');
         $clientSettings = $session->get('client/settings');
     } else {
         $clientId = $this->getRepository(UbirimiClient::class)->getClientIdAnonymous();
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $projectId = $request->get('id');
     $month = $request->get('month');
     $year = $request->get('year');
     $project = $this->getRepository(YongoProject::class)->getById($projectId);
     if ($project['client_id'] != $clientId) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $session->set('selected_project_id', $projectId);
     $menuSelectedCategory = 'project';
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     $hasAdministerProjectsPermission = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_ADMINISTER_PROJECTS);
     $hasAdministerProject = $hasGlobalSystemAdministrationPermission || $hasGlobalAdministrationPermission || $hasAdministerProjectsPermission;
     $previousMonthName = date("F", mktime(0, 0, 0, $month - 1));
     $currentMonthName = date("F", mktime(0, 0, 0, $month));
     $nextMonthName = date("F", mktime(0, 0, 0, $month + 1));
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / ' . $project['name'] . ' / Calendar (due date)';
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewCalendar.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:30,代码来源:ViewCalendarController.php

示例13: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_DOCUMENTADOR);
         $clientSettings = $session->get('client/settings');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
         $loggedInUserId = null;
     }
     $spaceId = $request->get('space_id');
     $space = $this->getRepository(Space::class)->getById($spaceId);
     $menuSelectedCategory = 'documentator';
     $space = $this->getRepository(Space::class)->getById($spaceId);
     if ($space['client_id'] != $session->get('client/id')) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     $spaceHasAnonymousAccess = $this->getRepository(Space::class)->hasAnonymousAccess($spaceId);
     $pages = $this->getRepository(Entity::class)->getAllBySpaceId($spaceId, 0);
     $homePage = $this->getRepository(Entity::class)->getById($space['home_entity_id']);
     if ($homePage['in_trash_flag']) {
         $homePage = null;
     }
     $treeStructure = $this->getRepository(Space::class)->generateTreeStructure($pages, $space['home_entity_id']);
     $pages->data_seek(0);
     return $this->render(__DIR__ . '/../Resources/views/ListPages.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:28,代码来源:ListPagesController.php

示例14: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $selectedProjectId = $session->get('selected_project_id');
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $selectedProjectId = null;
     }
     if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_YONGO) {
         $urlPrefix = '/yongo/project/';
         $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     } else {
         $urlPrefix = '/helpdesk/customer-portal/project/';
         $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjects($session->get('client/id'), 'array', null, 1);
     }
     $selectedProjectMenu = null;
     if ($selectedProjectId) {
         $selectedProjectMenu = $this->getRepository(YongoProject::class)->getById($selectedProjectId);
     }
     $hasGlobalAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_ADMINISTRATORS);
     $hasGlobalSystemAdministrationPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($session->get('client/id'), $session->get('user/id'), GlobalPermission::GLOBAL_PERMISSION_YONGO_SYSTEM_ADMINISTRATORS);
     return $this->render(__DIR__ . '/../../Resources/views/menu/Projects.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:25,代码来源:ProjectsController.php

示例15: indexAction

 public function indexAction(Request $request, SessionInterface $session)
 {
     $clientId = $session->get('client/id');
     $loggedInUserId = $session->get('user/id');
     $issuesPerPage = $session->get('user/issues_per_page');
     $searchParameters = array();
     $parseURLData = null;
     $getFilter = $request->get('filter');
     $getPage = $request->get('page');
     $getSortColumn = $request->get('sort') ? $request->get('sort') : 'created';
     $getSortOrder = $request->get('order') ? $request->get('order') : 'desc';
     $getSearchQuery = $request->get('search_query');
     $getSummaryFlag = $request->get('summary_flag');
     $getDescriptionFlag = $request->get('description_flag');
     $getCommentsFlag = $request->get('comments_flag');
     $getProjectIds = $request->get('project') ? explode('|', $request->get('project')) : null;
     if ($getProjectIds) {
         $projectsData = $this->getRepository(YongoProject::class)->getByIds($getProjectIds);
         if (!$projectsData) {
             return new RedirectResponse('/general-settings/bad-link-access-denied');
         }
         while ($projectsData && ($data = $projectsData->fetch_array(MYSQLI_ASSOC))) {
             if (Util::checkUserIsLoggedIn()) {
                 if ($data['client_id'] != $clientId) {
                     return new RedirectResponse('/general-settings/bad-link-access-denied');
                 }
             } else {
                 $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($data['id']), Permission::PERM_BROWSE_PROJECTS);
                 if (!$hasBrowsingPermission) {
                     return new RedirectResponse('/general-settings/bad-link-access-denied');
                 }
             }
         }
     }
     $getAssigneeIds = $request->get('assignee') ? explode('|', $request->get('assignee')) : null;
     $getReportedIds = $request->get('reporter') ? explode('|', $request->get('reporter')) : null;
     $getIssueTypeIds = $request->get('type') ? explode('|', $request->get('type')) : null;
     $getIssueStatusIds = $request->get('status') ? explode('|', $request->get('status')) : null;
     $getIssuePriorityIds = $request->get('priority') ? explode('|', $request->get('priority')) : null;
     $getProjectComponentIds = $request->get('component') ? explode('|', $request->get('component')) : null;
     $getProjectVersionIds = $request->get('version') ? explode('|', $request->get('version')) : null;
     $getIssueResolutionIds = $request->get('resolution') ? explode('|', $request->get('resolution')) : null;
     $getSearchParameters = array('search_query' => $getSearchQuery, 'summary_flag' => $getSummaryFlag, 'description_flag' => $getDescriptionFlag, 'comments_flag' => $getCommentsFlag, 'project' => $getProjectIds, 'assignee' => $getAssigneeIds, 'reporter' => $getReportedIds, 'filter' => $getFilter, 'type' => $getIssueTypeIds, 'status' => $getIssueStatusIds, 'priority' => $getIssuePriorityIds, 'component' => $getProjectComponentIds, 'version' => $getProjectVersionIds, 'resolution' => $getIssueResolutionIds, 'sort' => $getSortColumn, 'sort_order' => $getSortOrder);
     $parseURLData = parse_url($_SERVER['REQUEST_URI']);
     if (!$parseURLData['query']) {
         return new RedirectResponse('/general-settings/bad-link-access-denied');
     }
     if (Util::searchQueryNotEmpty($getSearchParameters)) {
         $issues = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $loggedInUserId, null, $loggedInUserId);
         $issuesCount = $issues->num_rows;
         $getSearchParameters['link_to_page'] = '/yongo/issue/printable-list';
     }
     $columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee');
     $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Print List';
     $menuSelectedCategory = null;
     return $this->render(__DIR__ . '/../../Resources/views/issue/search/SearchListPrintable.php', get_defined_vars());
 }
开发者ID:spiasecki,项目名称:ubirimi,代码行数:57,代码来源:SearchListPrintableController.php


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