/**
  * 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);
 }
 /**
  * Verknüpft einen Account mit E-Mail Adresse und Passwort
  * @param Application_Account_Record_Account $recordAccount
  * @param string $emailaddress
  * @param string $password
  * @param Zend_Config $configMail
  * @param function $hashmethod
  * @throws InvalidArgumentException
  */
 public function linkAccount(Application_Account_Record_Account $recordAccount, $emailaddress, $password, Zend_Config $configMail, $hashmethod)
 {
     $recordEmailaddress = new DragonX_Emailaddress_Record_Emailaddress(array('account_id' => $recordAccount->id));
     $recordEmailaddress->validateEmailaddress($emailaddress)->validatePassword($password);
     Zend_Registry::get('DragonX_Storage_Engine')->save($recordEmailaddress);
     $logicValidation = new DragonX_Emailaddress_Logic_Validation();
     $logicValidation->request($recordEmailaddress, $configMail, $hashmethod);
     Zend_Registry::get('Dragon_Plugin_Registry')->invoke('DragonX_Emailaddress_Plugin_LinkEmailaddress_Interface', array($recordAccount, $recordEmailaddress));
 }
 /**
  * Ä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));
 }
 /**
  * Ändert die E-Mail Adresse trägt eine neue Validierungabfrage ein
  */
 public function changeemailaddressAction()
 {
     try {
         $params = $this->getRequiredParams(array('newemailaddress'));
         $logicValidation = new DragonX_Emailaddress_Logic_Validation();
         $configValidation = new Dragon_Application_Config('dragonx/emailaddress/validation');
         $logicValidation->changeEmailaddress(Zend_Registry::get('recordAccount'), $params['newemailaddress'], $configValidation->validationlink, $configValidation->hashmethod);
     } catch (Exception $exception) {
         $this->_helper->FlashMessenger('<div class="alert alert-error">E-Mail Adresse nicht korrekt oder bereits vergeben</div>');
         $this->_redirect('account/showedit');
     }
     $this->_helper->FlashMessenger('<div class="alert alert-success">Änderung der E-Mail Adresse erfolgreich</div>');
     $this->_redirect('administration');
 }
 /**
  * Validiert einen Account mit dem Hash der Validierungsabfrage
  */
 public function validateAction()
 {
     try {
         $params = $this->getRequiredParams(array('validationhash'));
         $logicValidation = new DragonX_Emailaddress_Logic_Validation();
         $recordAccount = $logicValidation->validate($params['validationhash']);
         $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">Validierungslink nicht korrekt</div>');
         $this->_redirect('account/showlogin');
     }
     $this->_helper->FlashMessenger('<div class="alert alert-success">Validierung des Profils erfolgreich</div>');
     $this->_redirect('administration');
 }