diff --git a/source/php/functions.php b/source/php/functions.php index 0c8af39..f06e7c0 100755 --- a/source/php/functions.php +++ b/source/php/functions.php @@ -754,14 +754,21 @@ function httpAuthEnabled() { // The function to authenticate with HTTP function httpAuthentication() { - $host = (isset($_SERVER['HTTP_EMAIL'])) ? substr(strrchr($_SERVER['HTTP_EMAIL'], "@"), 1) : HOST_MAIN; + if (isset($_SERVER['HTTP_EMAIL'])) { + $user = strstr($_SERVER['HTTP_EMAIL'], "@", true); + $host = substr(strrchr($_SERVER['HTTP_EMAIL'], "@"), 1); + } else { + $user = $_SERVER['PHP_AUTH_USER']; + $host = HOST_MAIN; + } echo ''; } + // The function to quickly translate a string function _e($string) { echo T_gettext($string);