Exemplo n.º 1
0
 /** Get the user's redirect from the model
  * @access private
  * @return $string
  */
 private function _getUserRedirect()
 {
     $redirects = new LoginRedirect();
     $redirect = $redirects->getConfig();
     if (is_array($redirect)) {
         $clean = array_flip($redirect);
         $uri = array_values($clean);
     } else {
         $uri = array('/database' => 'Simple search');
     }
     return $uri[0];
 }
 /** Set up the redirect action for a user
  * @access public
  * @return void
  */
 public function redirectAction()
 {
     $form = new ConfigureLoginRedirectForm();
     $this->view->form = $form;
     $loginRedirect = new LoginRedirect();
     $current = $loginRedirect->getConfig();
     $currentUri = array_keys($current);
     $form->populate(array('uri' => $currentUri[0]));
     if ($this->_request->isPost()) {
         $formData = $this->_request->getPost();
         if ($form->isValid($formData)) {
             $loginRedirect->updateConfig($form->getValues());
             $this->getFlash()->addMessage('Page after logging in updated');
             $this->redirect('/users/configuration/');
         } else {
             $form->populate($current);
         }
     }
 }