initial commit of file from CVS for smeserver-php on Sat Mar 23 15:31:58 AEDT 2024
This commit is contained in:
22
root/usr/share/php/auth_translation.php
Normal file
22
root/usr/share/php/auth_translation.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if (isset($_SERVER['REDIRECT_REMOTE_USER'])) {
|
||||
$_SERVER['REMOTE_USER']= $_SERVER['REDIRECT_REMOTE_USER'];
|
||||
}
|
||||
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
|
||||
$_SERVER['HTTP_AUTHORIZATION']=$_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
|
||||
$hash = str_replace('Basic ', '', $_SERVER['HTTP_AUTHORIZATION']);
|
||||
$hash = base64_decode($hash);error_log($hash);
|
||||
if (strpos($hash, ':') !== false) {
|
||||
list( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $hash, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_SERVER['HTTP_AUTH_TKT'])) {
|
||||
$hash = base64_decode($_SERVER['HTTP_AUTH_TKT']);
|
||||
if (strpos($hash, '!') !== false) {
|
||||
list ( $auth, $timehost) = explode('!', $hash, 2);
|
||||
$_SERVER['TOKEN'] = substr($auth,0,72);
|
||||
$_SERVER['PHP_AUTH_USER']= $_SERVER['REMOTE_USER'];
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user