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());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if ($request->request->has('retrieve')) {
         $errorNotInClientDomain = false;
         $emailAddressNotExists = false;
         $httpHOST = Util::getHttpHost();
         $address = Util::cleanRegularInputField($request->request->get('address'));
         $exists = Util::checkEmailAddressExistence($address);
         if ($exists) {
             $baseURL = Util::getHttpHost();
             $userData = $this->getRepository(UbirimiUser::class)->getByEmailAddressAndBaseURL($address, $baseURL);
             if ($userData) {
                 $password = Util::updatePasswordForUserId($userData['id']);
                 $event = new UbirimiEvent(array('email' => $address, 'password' => $password));
                 UbirimiContainer::get()['dispatcher']->dispatch(UbirimiEvents::PASSWORD_RECOVER, $event);
                 return new RedirectResponse('/recover-password/response');
             } else {
                 $errorNotInClientDomain = true;
             }
         } else {
             $emailAddressNotExists = true;
         }
         return $this->render(__DIR__ . '/../Resources/views/_passwordRecoverForm.php', get_defined_vars());
     } else {
         if ($request->request->has('go_back')) {
             return new RedirectResponse('/');
         }
     }
 }
Example #3
0
 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());
 }
 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());
 }
Example #5
0
 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());
 }
Example #6
0
 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());
 }
 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());
 }
Example #8
0
 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());
 }
Example #9
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $signInError = null;
     $httpHOST = Util::getHttpHost();
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettingsByBaseURL($httpHOST);
     $clientId = $clientSettings['id'];
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $sectionPageTitle = $client['company_name'] . ' - Welcome to Customer Portal';
     return $this->render(__DIR__ . '/../../Resources/views/customer_portal/Index.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         Util::checkUserIsLoggedInAndRedirect();
         $spaces = $this->getRepository(Space::class)->getByClientId($session->get('client/id'));
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $spaces = $this->getRepository(Space::class)->getByClientIdAndAnonymous($clientId);
     }
     return $this->render(__DIR__ . '/../../Resources/views/menu/Documentador.php', get_defined_vars());
 }
Example #11
0
 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());
 }
Example #12
0
 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;
     }
     $clientAdministratorFlag = $session->get('user/client_administrator_flag');
     return $this->render(__DIR__ . '/../../Resources/views/menu/HelpDesk.php', get_defined_vars());
 }
Example #13
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
     }
     $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectsForBrowsing = array();
     for ($i = 0; $i < count($projectsMenu); $i++) {
         $projectsForBrowsing[$i] = $projectsMenu[$i]['id'];
     }
     $customFilters = $this->getRepository(IssueFilter::class)->getAllByUser($session->get('user/id'));
     return $this->render(__DIR__ . '/../../Resources/views/menu/Filters.php', get_defined_vars());
 }
Example #14
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
     }
     $issueId = $request->request->get('issue_id');
     $projectId = $request->request->get('project_id');
     $workLogs = $this->getRepository(WorkLog::class)->getByIssueId($issueId);
     $hasEditOwnWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_EDIT_OWN_WORKLOGS, $session->get('user/id'));
     $hasEditAllWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_EDIT_ALL_WORKLOGS, $session->get('user/id'));
     $hasDeleteOwnWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_DELETE_OWN_WORKLOGS, $session->get('user/id'));
     $hasDeleteAllWorklogsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectId, Permission::PERM_DELETE_ALL_WORKLOGS, $session->get('user/id'));
     return $this->render(__DIR__ . '/../../../Resources/views/issue/log_work/View.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     $projectId = $request->request->get('id');
     $loggedInUserId = $session->get('user/id');
     $clientId = $session->get('client/id');
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     if (Util::checkUserIsLoggedIn()) {
         $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS, $loggedInUserId);
     } else {
         $loggedInUserId = null;
         $httpHOST = Util::getHttpHost();
         $hasBrowsingPermission = $this->getRepository(YongoProject::class)->userHasPermission(array($projectId), Permission::PERM_BROWSE_PROJECTS);
     }
     if ($hasBrowsingPermission) {
         $helpDeskFlag = 0;
         if ($session->get('selected_product_id') == SystemProduct::SYS_PRODUCT_HELP_DESK) {
             $helpDeskFlag = 1;
         }
         $endDate = Util::getServerCurrentDateTime();
         $startDate = date_sub(new \DateTime($endDate, new \DateTimeZone($clientSettings['timezone'])), date_interval_create_from_date_string('2 days'));
         $historyList = null;
         do {
             $historyList = Util::getProjectHistory(array($projectId), $helpDeskFlag, null, date_format($startDate, 'Y-m-d'), $endDate);
             if (null == $historyList && date_format($startDate, 'Y-m-d H:i:s') == $client['date_created']) {
                 break;
             }
             $startDate = date_sub($startDate, date_interval_create_from_date_string('2 days'));
             $startDate->setTime(0, 0, 0);
             if (date_format($startDate, 'Y-m-d') < $client['date_created']) {
                 $startDate = new \DateTime($client['date_created'], new \DateTimeZone($clientSettings['timezone']));
                 break;
             }
         } while ($historyList == null);
         $historyData = array();
         $userData = array();
         while ($historyList && ($history = $historyList->fetch_array(MYSQLI_ASSOC))) {
             $historyData[substr($history['date_created'], 0, 10)][$history['user_id']][$history['date_created']][] = $history;
             $userData[$history['user_id']] = array('picture' => $history['avatar_picture'], 'first_name' => $history['first_name'], 'last_name' => $history['last_name']);
         }
     }
     $index = 0;
     return $this->render(__DIR__ . '/../../Resources/views/project/ViewActivityStream.php', get_defined_vars());
 }
Example #16
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $httpHOST = Util::getHttpHost();
     $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     $errors = array('empty_email' => false, 'email_not_valid' => false, 'empty_first_name' => false, 'empty_last_name' => false, 'email_already_exists' => false, 'empty_password' => false, 'password_mismatch' => false);
     if ($request->request->has('create_account')) {
         $email = Util::cleanRegularInputField($request->request->get('email_address'));
         $firstName = Util::cleanRegularInputField($request->request->get('first_name'));
         $lastName = Util::cleanRegularInputField($request->request->get('last_name'));
         $password = Util::cleanRegularInputField($request->request->get('password'));
         $passwordAgain = Util::cleanRegularInputField($request->request->get('password_repeat'));
         if (empty($email)) {
             $errors['empty_email'] = true;
         } else {
             if (!Util::isValidEmail($email)) {
                 $errors['email_not_valid'] = true;
             }
         }
         $emailData = $this->getRepository(UbirimiUser::class)->getUserByClientIdAndEmailAddress($clientId, mb_strtolower($email));
         if ($emailData) {
             $errors['email_already_exists'] = true;
         }
         if (empty($firstName)) {
             $errors['empty_first_name'] = true;
         }
         if (empty($lastName)) {
             $errors['empty_last_name'] = true;
         }
         if (empty($password)) {
             $errors['empty_password'] = true;
         }
         if ($password != $passwordAgain) {
             $errors['password_mismatch'] = true;
         }
         if (Util::hasNoErrors($errors)) {
             $userId = UbirimiContainer::get()['user']->newUser(array('clientId' => $clientId, 'firstName' => $firstName, 'lastName' => $lastName, 'email' => $email, 'isCustomer' => true, 'password' => $password));
             return new RedirectResponse('/helpdesk/customer-portal');
         }
     }
     return $this->render(__DIR__ . '/../../Resources/views/customer_portal/SignUp.php', get_defined_vars());
 }
Example #17
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $sectionPageTitle = $session->get('client/settings/title_name') . ' / ' . SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Search';
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $sectionPageTitle = SystemProduct::SYS_PRODUCT_DOCUMENTADOR_NAME . ' / Search';
     }
     if ($request->request->has('search')) {
         $searchQuery = $request->request->get('keyword');
         return new RedirectResponse('/documentador/search?search_query=' . $searchQuery);
     }
     $searchQuery = $request->get('search_query');
     $menuSelectedCategory = 'documentator';
     $pages = $this->getRepository(Space::class)->searchForPages($session->get('client/id'), $searchQuery);
     return $this->render(__DIR__ . '/../Resources/views/Search.php', get_defined_vars());
 }
Example #18
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $content = 'Signin.php';
     $signInError = null;
     $httpHOST = $_SERVER['SERVER_NAME'];
     $httpHOST = Util::getHttpHost();
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettingsByBaseURL($httpHOST);
     $clientId = $clientSettings['id'];
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     if ($session->has('user') && Util::getSubdomain() == $session->get('client/company_domain')) {
         return new RedirectResponse($httpHOST . '/yongo/my-dashboard');
     }
     $context = $request->get('context');
     if ($request->request->has('sign_in')) {
         $username = $request->request->get('username');
         $password = $request->request->get('password');
         $userData = $this->getRepository(UbirimiUser::class)->getByUsernameAndClientId($username, $clientId);
         if ($userData['id']) {
             if (UbirimiContainer::get()['password']->check($password, $userData['password'])) {
                 $session->invalidate();
                 $clientId = $userData['client_id'];
                 UbirimiContainer::get()['warmup']->warmUpClient($userData, true, true);
                 UbirimiContainer::get()['login.time']->userSaveLoginTime($userData['id']);
                 $date = Util::getServerCurrentDateTime();
                 $this->getLogger()->addInfo('LOG IN', $this->getLoggerContext());
                 if ($context) {
                     return new RedirectResponse($httpHOST . $context);
                 } else {
                     return new RedirectResponse($httpHOST . '/yongo/my-dashboard');
                 }
             } else {
                 $signInError = true;
             }
         } else {
             $signInError = true;
         }
     } else {
         if ($request->request->has('create_account')) {
             return new RedirectResponse('/sign-up');
         }
     }
     return $this->render(__DIR__ . '/../Resources/views/_main.php', get_defined_vars());
 }
Example #19
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
     } else {
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
     }
     $projectsMenu = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($session->get('client/id'), $session->get('user/id'), Permission::PERM_BROWSE_PROJECTS, 'array');
     $projectsForBrowsing = array();
     for ($i = 0; $i < count($projectsMenu); $i++) {
         $projectsForBrowsing[$i] = $projectsMenu[$i]['id'];
     }
     $hasCreateIssuePermission = false;
     if (count($projectsForBrowsing)) {
         $hasCreateIssuePermission = $this->getRepository(YongoProject::class)->userHasPermission($projectsForBrowsing, Permission::PERM_CREATE_ISSUE, $session->get('user/id'));
     }
     $recentIssues = $session->get('yongo/recent_issues');
     return $this->render(__DIR__ . '/../../Resources/views/menu/Issues.php', get_defined_vars());
 }
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $yongoSettings = $session->get('yongo/settings');
         $clientId = $session->get('client/id');
         $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);
         $yongoSettings = $this->getRepository(UbirimiClient::class)->getYongoSettings($clientId);
     }
     $issueId = $request->request->get('issue_id');
     $userId = $request->request->get('user_id');
     $projectId = $request->request->get('project_id');
     $historyList = $this->getRepository(IssueHistory::class)->getByIssueIdAndUserId($issueId, $userId, $projectId);
     $color = null;
     $hoursPerDay = $yongoSettings['time_tracking_hours_per_day'];
     $daysPerWeek = $yongoSettings['time_tracking_days_per_week'];
     return $this->render(__DIR__ . '/../../Resources/views/issue/ViewEntityHistory.php', get_defined_vars());
 }
Example #21
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $Id = $request->request->get('id');
     $loggedInUserId = $session->get('user/id');
     if (false === Util::checkUserIsLoggedIn()) {
         $loggedInUserId = null;
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     } else {
         $clientSettings = $session->get('client/settings');
     }
     $projectData = $this->getRepository(YongoProject::class)->getByIssueId($Id);
     $comments = $this->getRepository(IssueComment::class)->getByIssueId($Id);
     $hasAddCommentsPermission = $this->getRepository(YongoProject::class)->userHasPermission($projectData['id'], Permission::PERM_ADD_COMMENTS, $loggedInUserId);
     $hasDeleteAllComments = $this->getRepository(YongoProject::class)->userHasPermission($projectData['id'], Permission::PERM_DELETE_ALL_COMMENTS, $loggedInUserId);
     $hasDeleteOwnComments = $this->getRepository(YongoProject::class)->userHasPermission($projectData['id'], Permission::PERM_DELETE_OWN_COMMENTS, $loggedInUserId);
     $hasEditAllComments = $this->getRepository(YongoProject::class)->userHasPermission($projectData['id'], Permission::PERM_EDIT_ALL_COMMENTS, $loggedInUserId);
     $hasEditOwnComments = $this->getRepository(YongoProject::class)->userHasPermission($projectData['id'], Permission::PERM_EDIT_OWN_COMMENTS, $loggedInUserId);
     $actionButtonsFlag = true;
     return $this->render(__DIR__ . '/../../../Resources/views/issue/comment/View.php', get_defined_vars());
 }
Example #22
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $signInError = null;
     $httpHOST = Util::getHttpHost();
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettingsByBaseURL($httpHOST);
     $clientId = $clientSettings['id'];
     if ($session->has('user') && Util::getSubdomain() == $session->get('client/company_domain')) {
         return new RedirectResponse($httpHOST . '/helpdesk/customer-portal/dashboard');
     }
     if ($request->request->has('sign_in')) {
         $username = $request->request->get('username');
         $password = $request->request->get('password');
         $userData = $this->getRepository(UbirimiUser::class)->getCustomerByEmailAddressAndClientId($username, $clientId);
         if ($userData['id']) {
             if (UbirimiContainer::get()['password']->check($password, $userData['password'])) {
                 $session->invalidate();
                 UbirimiContainer::get()['warmup']->warmUpCustomer($userData);
                 return new RedirectResponse($httpHOST . '/helpdesk/customer-portal/dashboard');
             } else {
                 $signInError = true;
             }
         } else {
             $signInError = true;
         }
         if ($signInError) {
             return new RedirectResponse('/helpdesk/customer-portal');
         }
     } else {
         if ($request->request->has('create_account')) {
             return new RedirectResponse('/helpdesk/customer-portal/sign-up');
         } else {
             if ($request->request->has('get_password')) {
                 return new RedirectResponse('/helpdesk/customer-portal/get-password');
             }
         }
     }
 }
Example #23
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     $session->remove('user_account_created');
     $httpHOST = Util::getHttpHost();
     $clientDomain = Util::getSubdomain();
     $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
     $client = $this->getRepository(UbirimiClient::class)->getById($clientId);
     $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     $countries = Util::getCountries();
     $errors = array('empty_email' => false, 'email_not_valid' => false, 'empty_first_name' => false, 'empty_last_name' => false, 'email_already_exists' => false, 'empty_username' => false, 'empty_password' => false, 'password_mismatch' => false, 'duplicate_username' => false, 'invalid_username' => false);
     if ($request->request->has('cancel')) {
         return new RedirectResponse('/');
     } else {
         if ($request->request->has('create-user-account')) {
             $email = Util::cleanRegularInputField($request->request->get('email'));
             $firstName = Util::cleanRegularInputField($request->request->get('first_name'));
             $lastName = Util::cleanRegularInputField($request->request->get('last_name'));
             $username = Util::cleanRegularInputField($request->request->get('username'));
             $password = Util::cleanRegularInputField($request->request->get('password'));
             $passwordAgain = Util::cleanRegularInputField($request->request->get('password_again'));
             $countryId = $request->request->get('country');
             if (empty($email)) {
                 $errors['empty_email'] = true;
             } else {
                 if (!Util::isValidEmail($email)) {
                     $errors['email_not_valid'] = true;
                 }
             }
             $emailData = $this->getRepository(UbirimiUser::class)->getUserByClientIdAndEmailAddress($clientId, mb_strtolower($email));
             if (!Util::validateUsername($username)) {
                 $errors['invalid_username'] = true;
             } else {
                 $userData = $this->getRepository(UbirimiUser::class)->getByUsernameAndClientId($username, $clientId);
                 if ($userData) {
                     $errors['duplicate_username'] = true;
                 }
             }
             if ($emailData) {
                 $errors['email_already_exists'] = true;
             }
             if (empty($firstName)) {
                 $errors['empty_first_name'] = true;
             }
             if (empty($lastName)) {
                 $errors['empty_last_name'] = true;
             }
             if (empty($username)) {
                 $errors['empty_username'] = true;
             }
             if (empty($password)) {
                 $errors['empty_password'] = true;
             }
             if ($password != $passwordAgain) {
                 $errors['password_mismatch'] = true;
             }
             if (Util::hasNoErrors($errors)) {
                 $userId = UbirimiContainer::get()['user']->newUser(array('clientId' => $clientId, 'firstName' => $firstName, 'lastName' => $lastName, 'email' => $email, 'username' => $username, 'password' => $password, 'clientDomain' => $client['company_domain'], 'country' => $countryId));
                 $session->set('user_account_created', true);
                 $email = $firstName = $lastName = $username = $password = $passwordAgain = $email = null;
             }
         }
     }
     $content = 'Signup.php';
     return $this->render(__DIR__ . '/../Resources/views/_main.php', get_defined_vars());
 }
Example #24
0
 public function getClientIdAnonymous()
 {
     $httpHOST = Util::getHttpHost();
     return UbirimiContainer::get()['repository']->get(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
 }
Example #25
0
 public function indexAction(Request $request, SessionInterface $session)
 {
     if (Util::checkUserIsLoggedIn()) {
         $issuesPerPage = $session->get('user/issues_per_page');
         $clientSettings = $session->get('client/settings');
     } else {
         $issuesPerPage = 25;
         $httpHOST = Util::getHttpHost();
         $clientId = $this->getRepository(UbirimiClient::class)->getByBaseURL($httpHOST, 'array', 'id');
         $loggedInUserId = null;
         $clientSettings = $this->getRepository(UbirimiClient::class)->getSettings($clientId);
     }
     $clientId = $session->get('client/id');
     $loggedInUserId = $session->get('user/id');
     $sectionPageTitle = $clientSettings['title_name'] . ' / ' . SystemProduct::SYS_PRODUCT_YONGO_NAME . ' / Search';
     $session->set('selected_product_id', SystemProduct::SYS_PRODUCT_YONGO);
     $selectedProductId = $session->get('selected_product_id');
     $cliMode = false;
     $projectsForBrowsing = $this->getRepository(UbirimiClient::class)->getProjectsByPermission($clientId, $loggedInUserId, Permission::PERM_BROWSE_PROJECTS);
     $searchParameters = array();
     $parseURLData = null;
     $projectIds = null;
     if ($projectsForBrowsing) {
         $projectIdsAndNames = Util::getAsArray($projectsForBrowsing, array('id', 'name'));
         $projectsForBrowsing->data_seek(0);
         $projectIds = Util::getAsArray($projectsForBrowsing, array('id'));
         $searchCriteria = $this->getRepository(Issue::class)->getSearchParameters($projectsForBrowsing, $clientId);
         $issuesResult = null;
         $SLAs = UbirimiContainer::get()['repository']->get(Sla::class)->getByProjectIds($projectIds);
     }
     if ($request->request->has('search')) {
         $searchParameters = $this->getRepository(Issue::class)->prepareDataForSearchFromPostGet($projectIds, $_POST, $_GET);
         $redirectLink = str_replace("%7C", "|", http_build_query($searchParameters));
         return new RedirectResponse('/yongo/issue/search?' . $redirectLink);
     } else {
         $getFilter = $request->get('filter');
         $currentSearchPage = $request->get('page');
         $currentSearchPage = isset($currentSearchPage) ? $currentSearchPage : 1;
         $getSearchParameters = $this->getRepository(Issue::class)->prepareDataForSearchFromURL($_GET, $issuesPerPage);
         // check to see if the project Ids are all belonging to the client
         $getProjectIds = isset($_GET['project']) ? explode('|', $_GET['project']) : null;
         if ($getProjectIds && !(count($getProjectIds) == 1 && $getProjectIds[0] == -1)) {
             if (!$this->getRepository(YongoProject::class)->checkProjectsBelongToClient($clientId, $getProjectIds)) {
                 return new RedirectResponse('/general-settings/bad-link-access-denied');
             }
         }
         $parseURLData = parse_url($_SERVER['REQUEST_URI']);
         if (isset($parseURLData['query']) && $projectsForBrowsing) {
             if (Util::searchQueryNotEmpty($getSearchParameters)) {
                 $issuesResult = $this->getRepository(Issue::class)->getByParameters($getSearchParameters, $loggedInUserId, null, $loggedInUserId);
                 $issues = $issuesResult[0];
                 $issuesCount = $issuesResult[1];
                 $countPages = ceil($issuesCount / $issuesPerPage);
                 $getSearchParameters['count_pages'] = $countPages;
                 $getSearchParameters['link_to_page'] = '/yongo/issue/search';
             }
         }
     }
     $columns = array('code', 'summary', 'priority', 'status', 'created', 'updated', 'reporter', 'assignee', 'settings_menu');
     if (Util::checkUserIsLoggedIn()) {
         $columns = explode('#', $session->get('user/issues_display_columns'));
         $columns[] = 'settings_menu';
         $columns[] = '';
     }
     $hasGlobalBulkPermission = $this->getRepository(UbirimiUser::class)->hasGlobalPermission($clientId, $loggedInUserId, GlobalPermission::GLOBAL_PERMISSION_YONGO_BULK_CHANGE);
     $customFilters = $this->getRepository(IssueFilter::class)->getAllByUser($loggedInUserId);
     if ($getFilter) {
         $menuSelectedCategory = 'filters';
     } else {
         $menuSelectedCategory = 'issue';
     }
     $extraParameters = array();
     if ($getFilter) {
         $extraParameters[] = 'filter=' . $getFilter;
     }
     $extraParametersURL = '';
     if (count($extraParameters)) {
         $extraParametersURL = implode('&', $extraParameters);
     }
     $urlIssuePrefix = '/yongo/issue/';
     $parseData = parse_url($_SERVER['REQUEST_URI']);
     $query = isset($parseData['query']) ? $parseData['query'] : '';
     if (isset($query) && $query != '') {
         $session->set('last_search_parameters', $parseData['query']);
     } else {
         $session->remove('last_search_parameters');
     }
     return $this->render(__DIR__ . '/../../Resources/views/issue/search/Search.php', get_defined_vars());
 }
Example #26
0
<?php

use Ubirimi\Util;
require_once __DIR__ . '/_header.php';
$httpHOST = Util::getHttpHost();
?>

<div style="color: #333333; font: 17px Trebuchet MS, sans-serif; white-space: nowrap; padding-top: 5px;text-align: left;padding-left: 2px;">
    Hello <?php 
echo $this->firstName . ' ' . $this->lastName;
?>
    <br />
    A new account has been created for you.
    <br /><br />
    You can log in at:
    <br />
    <?php 
if (isset($this->isCustomer) && $this->isCustomer) {
    ?>
        <a href="<?php 
    echo $httpHOST;
    ?>
/helpdesk/customer-portal"><?php 
    echo $httpHOST;
    ?>
/helpdesk/customer-portal</a>
    <?php 
} else {
    ?>
        <a href="<?php 
    echo $httpHOST;
Example #27
0
" height="33px" style="vertical-align: middle" />
                            </span>
                            <span class="arrow" style="top: 12px;"></span>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            <?php 
} else {
    ?>
                <table align="right" border="0" cellpadding="0" cellspacing="0" style="height: 44px">
                    <tr>
                        <td style="height:44px; border-left: 1px #9c9c9c solid;" width="100px" class="product-menu" align="center" valign="middle">
                            <div>
                                <a href="<?php 
    echo Util::getHttpHost();
    ?>
" title="Log In">
                                    Log In
                                </a>
                            </div>
                        </td>
                    </tr>
                </table>
            <?php 
}
?>
        </td>
    </tr>
</table>