Esempio n. 1
0
 public function confirmnewaccountAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper("layout")->disableLayout();
     $oModelUser = new Admin_Model_User();
     $oModelUserNewAccount = new Admin_Model_UserNewAccount();
     $sActivatingCode = $this->_request->getParam("code");
     if (isset($sActivatingCode) && is_string($sActivatingCode) && strlen($sActivatingCode) == 32) {
         $nUserId = $oModelUserNewAccount->confirmNewAccount($sActivatingCode);
         if (!is_numeric($nUserId)) {
             $this->_redirect("admin/user/login");
         }
         if ($oModelUser->activatingNewUser($nUserId)) {
             $sEmailAddress = $oModelUser->findEmailAddress($nUserId);
             $oModelUserNewAccount->deleteConfirmCode($sActivatingCode);
             $oMail = new AppCms2_Controller_Plugin_Mail();
             $oMail->sendUserAccountActivation($sEmailAddress);
         }
     }
     $this->_redirect("admin/user/login");
 }