| Conditions | 6 |
| Paths | 12 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 89 | public function auth() |
||
| 90 | { |
||
| 91 | $user = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : null; |
||
| 92 | $password = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null; |
||
| 93 | |||
| 94 | if (is_null($user) || !(bool) call_user_func($this->verify, $user, $password)) { |
||
| 95 | header(sprintf('WWW-Authenticate: Basic realm="%s"', $this->realm)); |
||
| 96 | header('HTTP/1.0 401 Unauthorized'); |
||
| 97 | |||
| 98 | if ($this->deny) { |
||
| 99 | call_user_func($this->deny, $user); |
||
| 100 | } |
||
| 101 | |||
| 102 | exit; |
||
| 103 | } |
||
| 104 | |||
| 105 | $this->user = $user; |
||
| 106 | $this->password = $password; |
||
| 107 | |||
| 108 | return $this; |
||
| 109 | } |
||
| 110 | |||
| 135 |