mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 04:35:26 +00:00
use http_authorization header with nginx
This commit is contained in:
parent
5e83c58a95
commit
87e7deacf9
1 changed files with 10 additions and 0 deletions
|
@ -96,6 +96,16 @@ require_once('include/security.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(x($_SERVER,'HTTP_AUTHORIZATION')) {
|
||||||
|
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"],6)) ;
|
||||||
|
if(strlen($userpass)) {
|
||||||
|
list($name, $password) = explode(':', $userpass);
|
||||||
|
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||||
|
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
logger('API_login: ' . print_r($_SERVER,true), LOGGER_DEBUG);
|
logger('API_login: ' . print_r($_SERVER,true), LOGGER_DEBUG);
|
||||||
header('WWW-Authenticate: Basic realm="Red"');
|
header('WWW-Authenticate: Basic realm="Red"');
|
||||||
|
|
Loading…
Reference in a new issue