/**
  * Authenticate log in
  *
  * @access	public
  * @param	string		Username (from $this->request)
  * @param	string		Password (from $this->request)
  * @return	mixed		TRUE if successful, string (message) if not
  */
 public function authenticateLogIn($username, $password)
 {
     require_once IPS_ROOT_PATH . 'sources/handlers/han_login.php';
     $han_login = new han_login($this->registry);
     $han_login->is_admin_auth = 1;
     $han_login->init();
     $email = '';
     /* Is this a username or email address? */
     if (IPSText::checkEmailAddress($username)) {
         $email = $username;
         $username = '';
     }
     $han_login->loginAuthenticate($username, $email, $password);
     $mem = $han_login->member_data;
     if (!$mem['member_id'] or $han_login->return_code == 'NO_USER') {
         return 'No user found by that sign in name';
     }
     if ($han_login->return_code == 'NO_ACCESS') {
         return 'You do not have access to the upgrade system';
     } else {
         if ($han_login->return_code != 'SUCCESS') {
             return 'Password or sign in name incorrect';
         }
     }
     /* Test seconday groups */
     $mem = ipsRegistry::member()->setUpSecondaryGroups($mem);
     if ($mem['g_access_cp'] != 1) {
         return 'You do not have access to the upgrade system';
     }
     /* Set up _member */
     $this->loadMemberData($mem['member_id']);
     /* Still here? */
     return TRUE;
 }
Exemple #2
0
 /**
  * Authenticate log in
  *
  * @access	public
  * @param	string		Username (from $this->request)
  * @param	string		Password (from $this->request)
  * @return	mixed		TRUE if successful, string (message) if not
  */
 public function authenticateLogIn($username, $password)
 {
     require_once IPS_ROOT_PATH . 'sources/handlers/han_login.php';
     /*noLibHook*/
     $han_login = new han_login($this->registry);
     $han_login->is_admin_auth = 1;
     $han_login->init();
     $email = '';
     /* Is this a username or email address? */
     if (IPSText::checkEmailAddress($username)) {
         $email = $username;
         $username = '';
     }
     $han_login->loginAuthenticate($username, $email, $password);
     $mem = $han_login->member_data;
     if (!$mem['member_id'] or $han_login->return_code == 'NO_USER') {
         return 'Пользователь не найден';
     }
     if ($han_login->return_code == 'NO_ACCESS') {
         return 'У вас нет доступа к системе обновления';
     } else {
         if ($han_login->return_code != 'SUCCESS') {
             return 'Имя пользователя или пароль неверны';
         }
     }
     /* Test seconday groups */
     $mem = ipsRegistry::member()->setUpSecondaryGroups($mem);
     if ($mem['g_access_cp'] != 1) {
         return 'У вас нет доступа к системе обновления';
     }
     /* Set up _member */
     $this->loadMemberData($mem['member_id']);
     /* Still here? */
     return TRUE;
 }