Пример #1
0
 public static function TestCredentials($username, $password)
 {
     $obj = utopia::GetInstance(__CLASS__);
     $obj->BypassSecurity(true);
     $rec = $obj->LookupRecord(array('username' => $username));
     $obj->BypassSecurity(false);
     if (!$rec) {
         return false;
     }
     if (!uCrypt::Test($password, $rec['password'])) {
         return false;
     }
     return $rec['user_id'];
 }