Exemplo n.º 1
0
 /**
  * Logs in admin to cart.
  *
  * @param string $login    Administrator user login
  * @param string $password Administrator user password
  *
  * @return \XLite\Model\Profile
  */
 public function loginAdministrator($login, $password)
 {
     $profile = $this->login($login, $password);
     if ($profile instanceof \XLite\Model\Profile && !$profile->isAdmin()) {
         // Logoff user from session
         $this->logoff();
         // Reset profile object
         $profile = static::RESULT_ACCESS_DENIED;
         // Send notification about failed log in attempt
         \XLite\Core\Mailer::sendFailedAdminLoginAdmin(\XLite\Core\Request::getInstance()->login);
     }
     return $profile;
 }