File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,15 @@ public function getMethod() {
39
39
* @return string|null
40
40
*/
41
41
public function getUser () {
42
- $ data = http_digest_parse ($ _SERVER ['PHP_AUTH_DIGEST ' ]);
43
- return (isset ($ data ['username ' ])) ? $ data ['username ' ] : null ;
42
+ return (isset ($ _SERVER ['PHP_AUTH_USER ' ])) ? $ _SERVER ['PHP_AUTH_USER ' ]: null ;
43
+ }
44
+
45
+ /**
46
+ * Get http basic auth password
47
+ * @return string|null
48
+ */
49
+ public function getPassword () {
50
+ return (isset ($ _SERVER ['PHP_AUTH_PW ' ])) ? $ _SERVER ['PHP_AUTH_PW ' ]: null ;
44
51
}
45
52
46
53
}
Original file line number Diff line number Diff line change @@ -29,4 +29,9 @@ public function refresh() {
29
29
$ this ->redirect (url ());
30
30
}
31
31
32
+ public function auth ($ name = '' ) {
33
+ header ('WWW-Authenticate: Basic realm=" ' . $ name . '" ' );
34
+ header ('HTTP/1.0 401 Unauthorized ' );
35
+ }
36
+
32
37
}
You can’t perform that action at this time.
0 commit comments