Пример #1
0
 public function send($email)
 {
     try {
         $aParse['email'] = htmlspecialchars($email);
         UsersForgot::send($email);
     } catch (Exception $e) {
         CMSLog::addMessage('users', $e);
         if (!empty($_REQUEST['ajaxRequest'])) {
             $this->aParse['forgotFailed'] = true;
             $this->output('');
         } else {
             /**
              * @todo Избавиться от этой зависимости
              */
             $this->addAlert(\plugins\MessageDictionary\Plugin::getMessage('users.forgot.accountNotFound'));
             $this->jumpBack();
         }
     }
     if (!empty($_REQUEST['ajaxRequest'])) {
         $this->aParse['forgotSuccess'] = true;
         $this->output();
     } else {
         /**
          * @todo Избавиться от этой зависимости
          */
         $this->addAlert(\plugins\MessageDictionary\Plugin::getMessage('users.forgot.sent'));
         $this->jumpBack();
     }
 }
Пример #2
0
 /**
  * @expectedException \Extasy\Users\login\LoginAttemptsException
  */
 public function testForgotUserHostLimit()
 {
     self::configureLoginAttempts(10, 0);
     \UsersForgot::send(self::Email);
 }