Revert "How did that not ever cause any issues?"

This reverts commit cc3cb6e99c
This commit is contained in:
Klaus-Uwe Mitterer 2017-10-12 11:52:55 +02:00
parent 59e19cdac2
commit 357c84848c

View file

@ -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.');
}