Пример #1
0
 private function __verifyLogin($loginName, $password)
 {
     if (empty($loginName) || !$password) {
         pamAccount::setLoginErrorCount();
         throw new \LogicException(app::get('desktop')->_('用户名或密码错误'));
     }
     $rows = app::get('desktop')->model('account')->getRow('*', array('login_name' => trim($loginName), 'disabled' => 0));
     if ($rows && pam_encrypt::check($password, $rows['login_password'])) {
         pamAccount::setLoginErrorCount(true);
     } else {
         pamAccount::setLoginErrorCount();
         throw new \LogicException(app::get('desktop')->_('用户名或密码错误'));
     }
     return $rows['account_id'];
 }