コード例 #1
0
 /**
  * Sendet die Validierungsanfrage erneut zu
  * @dragonx_account_authenticate
  */
 public function resendValidation()
 {
     $logicValidation = new DragonX_Emailaddress_Logic_Validation();
     $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
     $configValidation = new Dragon_Application_Config('dragonx/emailaddress/validation');
     $logicValidation->resendValidation($logicEmailaddress->getEmailaddress(Zend_Registry::get('recordAccount')), $configValidation->validationhash);
 }
コード例 #2
0
 /**
  * Ändert das Passwort für den Account
  * @param Application_Account_Record_Account $recordAccount
  * @param string $newpassword
  */
 public function changePassword(Application_Account_Record_Account $recordAccount, $newpassword)
 {
     $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
     $recordEmailaddress = $logicEmailaddress->getEmailaddress($recordAccount);
     $recordEmailaddress->validatePassword($newpassword);
     Zend_Registry::get('DragonX_Storage_Engine')->save($recordEmailaddress);
 }
コード例 #3
0
 /**
  * Setzt alle Daten des Layouts aus den Einstellungsdateien
  * @throw Zend_Controller_Dispatcher_Exception
  */
 public function preDispatch()
 {
     parent::preDispatch();
     $modulename = $this->getRequest()->getModuleName();
     $this->view->modulename = $modulename;
     $controllername = $this->getRequest()->getControllerName();
     $this->view->controllername = $controllername;
     $actionname = $this->getRequest()->getActionName();
     $recordAccount = null;
     if (Zend_Registry::get('Dragon_Package_Registry')->isAvailable('DragonX', 'Account') && Zend_Registry::get('Dragon_Package_Registry')->isAvailable('DragonX', 'Emailaddress')) {
         $sessionNamespace = new Zend_Session_Namespace();
         if (isset($sessionNamespace->sessionhash)) {
             $logicSession = new DragonX_Account_Logic_Session();
             try {
                 $recordAccount = $logicSession->getAccount($sessionNamespace->sessionhash);
                 $this->view->sessionhash = $sessionNamespace->sessionhash;
                 Zend_Registry::set('recordAccount', $recordAccount);
                 $this->view->recordAccount = $recordAccount;
                 $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
                 $this->view->recordEmailaddress = $logicEmailaddress->getEmailaddress($recordAccount);
                 $logicDeletion = new DragonX_Account_Logic_Deletion();
                 $recordDeletion = $logicDeletion->getDeletion($recordAccount);
                 if (isset($recordDeletion)) {
                     $this->view->recordDeletion = $recordDeletion;
                 }
             } catch (Exception $exception) {
                 $sessionNamespace->unsetAll();
                 if ($modulename == 'homepage' && $controllername == 'account' && $actionname == 'logout') {
                     $this->_helper->FlashMessenger('<div class="alert alert-success">Abmeldung erfolgreich</div>');
                 } else {
                     $this->_helper->FlashMessenger('<div class="alert alert-error">Die Session ist abgelaufen. Profil muss neu angemeldet werden</div>');
                 }
             }
         }
     }
     $this->view->configApplication = new Dragon_Application_Config('dragon/application/application');
     $modulenamearray = explode('_', $modulename);
     $controllerarea = end($modulenamearray);
     $this->view->controllerarea = $controllerarea;
     switch ($controllerarea) {
         case 'homepage':
             $this->view->configNavigation = new Dragon_Application_Config('dragonx/homepage/navigation/homepage');
             break;
         case 'administration':
             if (!Zend_Registry::get('Dragon_Package_Registry')->isAvailable('DragonX', 'Account') || !Zend_Registry::get('Dragon_Package_Registry')->isAvailable('DragonX', 'Emailaddress')) {
                 throw new Dragon_Application_Exception_User('incorrect controller', array('controllername' => $controllername));
             }
             if (!isset($recordAccount)) {
                 $this->_helper->FlashMessenger('<div class="alert alert-error">Die Session wurde noch nicht gestartet oder ist abgelaufen. Profil muss angemeldet werden</div>');
                 $this->_redirect('account/showlogin?' . http_build_query(array('redirect' => $modulename . '/' . $controllername . '/' . $actionname)));
             }
             if (Zend_Registry::get('Dragon_Package_Registry')->isAvailable('DragonX', 'Acl')) {
                 $logicAcl = new DragonX_Acl_Logic_Acl();
                 $this->view->resources = $logicAcl->getResources($recordAccount);
             }
             $this->view->configNavigation = new Dragon_Application_Config('dragonx/homepage/navigation/administration');
             break;
     }
 }
コード例 #4
0
 /**
  * Wird vor der Löschung eines Accounts aufgerufen
  * @param Application_Account_Record_Account $recordAccount
  */
 public function deleteAccount(Application_Account_Record_Account $recordAccount)
 {
     try {
         $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
         $logicEmailaddress->unlinkAccount($recordAccount);
     } catch (Exception $exception) {
     }
 }
コード例 #5
0
 /**
  * Ändert die E-Mail Adresse trägt eine neue Validierungabfrage ein
  * @param Application_Account_Record_Account $recordAccount
  * @param string $newemailaddress
  * @param Zend_Config $configMail
  * @throws InvalidArgumentException
  */
 public function changeEmailaddress(Application_Account_Record_Account $recordAccount, $newemailaddress, Zend_Config $configMail)
 {
     $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
     $recordEmailaddress = $logicEmailaddress->getEmailaddress($recordAccount);
     $recordEmailaddress->validateEmailaddress($newemailaddress);
     Zend_Registry::get('DragonX_Storage_Engine')->save($recordEmailaddress);
     $logicValidation = new DragonX_Emailaddress_Logic_Validation();
     $logicValidation->request($recordEmailaddress, $configMail);
     Zend_Registry::get('Dragon_Plugin_Registry')->invoke('DragonX_Emailaddress_Plugin_ChangeEmailaddress_Interface', array($recordEmailaddress));
 }
コード例 #6
0
 /**
  * Entfernt die Verknüpfung eines Accounts mit E-Mail Adresse und Passwort
  * @dragonx_account_authenticate
  */
 public function unlinkAccount()
 {
     $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
     $logicEmailaddress->unlinkAccount(Zend_Registry::get('recordAccount'));
 }
コード例 #7
0
 /**
  * Meldet den übergebenen Account an
  */
 public function loginAction()
 {
     $redirect = $this->getOptionalParam('redirect', 'administration');
     try {
         $params = $this->getRequiredParams(array('emailaddress', 'password'));
         $logicEmailaddress = new DragonX_Emailaddress_Logic_Emailaddress();
         list($recordAccount) = $logicEmailaddress->getAccount($params['emailaddress'], $params['password']);
         $logicSession = new DragonX_Account_Logic_Session();
         $sessionNamespace = new Zend_Session_Namespace();
         $sessionNamespace->sessionhash = $logicSession->loginAccount($recordAccount);
     } catch (Exception $exception) {
         $this->_helper->FlashMessenger('<div class="alert alert-error">E-Mail Adresse oder Passwort nicht korrekt</div>');
         if ($redirect == 'administration') {
             $redirect = '';
         } else {
             $redirect = '?' . http_build_query(array('redirect' => $redirect));
         }
         $this->_redirect('account/showlogin' . $redirect);
     }
     $this->_helper->FlashMessenger('<div class="alert alert-success">Anmeldung erfolgreich</div>');
     $this->_redirect($redirect);
 }