1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jappix_ynh.git synced 2024-09-03 19:26:19 +02:00

Fix different mail from user

This commit is contained in:
Kload 2013-11-29 15:56:17 +01:00
parent 5c7f4a72d4
commit 8d54e94006

View file

@ -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 '<script type="text/javascript">
jQuery(document).ready(function() {
doHttpLogin("'.$_SERVER['PHP_AUTH_USER'].'", "'.$_SERVER['PHP_AUTH_PW'].'", "'.$host.'", 10);
doHttpLogin("'.$user.'", "'.$_SERVER['PHP_AUTH_PW'].'", "'.$host.'", 10);
});
</script>';
}
// The function to quickly translate a string
function _e($string) {
echo T_gettext($string);