Ejemplo n.º 1
0
 public function beforeAction()
 {
     parent::beforeAction();
     if (!$this->isPreviewMode()) {
         throw new \Jazzee\Exception("Applicant #{$this->_applicant->getId()} {$this->_applicant->getFullName()} attempted to acces apply preview functions when not in preview mode.", E_USER_ERROR);
     }
 }
Ejemplo n.º 2
0
 public function beforeAction()
 {
     parent::beforeAction();
     //if the applicant hasn't locked and the application isn't closed
     if (!($this->_applicant->isLocked() or $this->_applicant->isDeactivated()) and ($this->_application->getClose() > new DateTime('now') or $this->_applicant->getDeadlineExtension() and $this->_applicant->getDeadlineExtension() > new \DateTime('now'))) {
         $this->addMessage('notice', "You have not completed your application.");
         $this->redirectApplyFirstPage();
     }
 }
Ejemplo n.º 3
0
 public function beforeAction()
 {
     parent::beforeAction();
     $layoutContentTop = '<p class="links">';
     $layoutContentTop .= '<a href="' . $this->applyPath('account') . '">My Account</a>';
     $layoutContentTop .= '<a href="' . $this->applyPath('support') . '">Support</a>';
     if ($count = $this->_applicant->unreadMessageCount()) {
         $layoutContentTop .= '<sup class="count">' . $count . '</sup>';
     }
     $layoutContentTop .= '<a href="' . $this->applyPath('applicant/logout') . '">Log Out</a></p>';
     $this->setLayoutVar('layoutContentTop', $layoutContentTop);
 }
Ejemplo n.º 4
0
 /**
  * Lookup applicant and make sure we are authorized to view the page
  * @see ApplyController::beforeAction()
  */
 public function beforeAction()
 {
     parent::beforeAction();
     $pageID = $this->actionParams['pageID'];
     if (!array_key_exists($pageID, $this->_pages)) {
         $this->addMessage('error', "You are not authorized to view that page.");
         $this->redirectApplyFirstPage();
     }
     if ($this->_applicant->isDeactivated() or $this->_applicant->isLocked() or $this->_application->getClose() < new DateTime('now') and (!$this->_applicant->getDeadlineExtension() or $this->_applicant->getDeadlineExtension() < new \DateTime('now'))) {
         $this->redirectApplyPath('status');
     }
     $this->addScript($this->path('resource/scripts/controllers/apply_page.controller.js'));
     $this->_page = $this->_pages[$pageID];
     $this->setVar('page', $this->_page);
     $this->setVar('currentAnswerID', false);
 }
Ejemplo n.º 5
0
 public function beforeAction()
 {
     parent::beforeAction();
     $restricted = array('changeEmail' => 'getAllowApplicantEmailChange', 'changePassword' => 'getAllowApplicantPasswordChange', 'changeName' => 'getAllowApplicantNameChange', 'printApplication' => 'getAllowApplicantPrintApplication');
     if (array_key_exists($this->actionName, $restricted)) {
         if (!$this->_config->{$restricted}[$this->actionName]()) {
             $this->addMessage('error', 'You are not allowed to do that.');
             $this->redirectApplyPath('account');
         }
     }
     $layoutContentTop = '<p class="links">';
     $layoutContentTop .= '<a href="' . $this->applyPath('account') . '">My Account</a>';
     $layoutContentTop .= '<a href="' . $this->applyPath('support') . '">Support</a>';
     if ($count = $this->_applicant->unreadMessageCount()) {
         $layoutContentTop .= '<sup class="count">' . $count . '</sup>';
     }
     $layoutContentTop .= '<a href="' . $this->applyPath('applicant/logout') . '">Log Out</a></p>';
     $this->setLayoutVar('layoutContentTop', $layoutContentTop);
 }