Revert "How did that not ever cause any issues?"
This reverts commit cc3cb6e99c
This commit is contained in:
parent
59e19cdac2
commit
357c84848c
1 changed files with 4 additions and 6 deletions
10
auth.php
10
auth.php
|
@ -15,14 +15,14 @@ $realm = 'GPS Tracker';
|
|||
if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
|
||||
die('Authentication failed.');
|
||||
}
|
||||
|
||||
if (!($data = http_digest_parse($_SERVER['PHP_AUTH_DIGEST']))) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"'); '",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm. '",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
|
||||
die ('Authentication failed.');
|
||||
}
|
||||
|
@ -32,8 +32,7 @@ $result = $conn->query($sql);
|
|||
|
||||
if ($result->num_rows != 1) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"'); '",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm. '",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
|
||||
die('Authentication failed.');
|
||||
}
|
||||
|
@ -44,8 +43,7 @@ $valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce']
|
|||
|
||||
if ($data['response'] != $valid_response) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm.
|
||||
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"'); '",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
header('WWW-Authenticate: Digest realm="'.$realm. '",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
|
||||
die('Authentication failed.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue