mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:18:57 +01:00
fixed setup to deal with proxies: behind a non-transparent proxy the cookie domain was wrong, which cause the browser to refuse the setup cookies, which throw you always back to setup login
This commit is contained in:
parent
9e525b0989
commit
11a9afc1ba
@ -34,6 +34,7 @@
|
||||
var $hooks_table = 'egw_hooks';
|
||||
var $cats_table = 'egw_categories';
|
||||
var $oProc;
|
||||
var $cookie_domain;
|
||||
|
||||
var $detection;
|
||||
var $process;
|
||||
@ -134,7 +135,8 @@
|
||||
*/
|
||||
function set_cookiedomain()
|
||||
{
|
||||
$this->cookie_domain = $_SERVER['HTTP_HOST'];
|
||||
// Use HTTP_X_FORWARDED_HOST if set, which is the case behind a none-transparent proxy
|
||||
$this->cookie_domain = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
|
||||
|
||||
// remove port from HTTP_HOST
|
||||
if (preg_match("/^(.*):(.*)$/",$this->cookie_domain,$arr))
|
||||
@ -157,7 +159,7 @@
|
||||
*/
|
||||
function set_cookie($cookiename,$cookievalue='',$cookietime=0)
|
||||
{
|
||||
if(!isset($this->cookie_domain) || !$this->cookie_domain)
|
||||
if(!isset($this->cookie_domain))
|
||||
{
|
||||
$this->set_cookiedomain();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user