repos
/
httpauth
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
Prevent caching of ajax-login.php
Annotate for file /ajax-login.php
2010-10-27 pix
1
<?php
04:18:01 '
2
'
3
if ('authenticate' === $_SERVER['PHP_AUTH_USER'] &&
'
4
'successfully' === $_SERVER['PHP_AUTH_PW']) {
'
5
header('HTTP/1.1 200 OK');
2010-10-27 pix
6
header('WWW-Authenticate: Basic Realm="Form-Based HTTP Auth Test"', false, 200);
2010-10-27 pix
7
} elseif ($_SERVER['PHP_AUTH_USER'] || $_SERVER['PHP_AUTH_PW']) {
04:18:01 '
8
/* Suppress the browser's login UI */
'
9
header('HTTP/1.1 403 Invalid Credentials');
'
10
header('WWW-Authenticate: Basic Realm="Form-Based HTTP Auth Test"', false, 403);
'
11
} else {
'
12
header('HTTP/1.1 401 Log In, Bitches');
'
13
header('WWW-Authenticate: Basic Realm="Form-Based HTTP Auth Test"', false, 401);
'
14
}
2010-10-27 pix
15
23:21:30 '
16
/* no caching */
'
17
header('Pragma: no-cache');
'
18
header('Cache-Control: no-cache');