Example #1
0
 protected function _auth($user, $pass)
 {
     if (!Session::exists("auth")) {
         $auth = Request::auth();
         if (is_null($auth) || $auth["user"] !== $user || $auth["pass"] !== $pass) {
             Response::setHeader('WWW-Authenticate: Basic realm="' . Config::$realm . '"');
             return false;
         }
         Session::set("auth", true);
     }
     return true;
 }
Example #2
0
 public function auth()
 {
     $auth = Request::auth();
     return !(is_null($auth) || $auth["user"] !== Config::$apiUser || $auth["pass"] !== Config::$apiPass);
 }