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

Merge pull request #1 from Kloadut/master

Fix different mail from user
This commit is contained in:
titoko 2013-11-29 06:58:46 -08:00
commit a7ee9e196d

View file

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