From: cajus Date: Mon, 24 Sep 2007 15:57:59 +0000 (+0000) Subject: * Fixed problem with non defined ui during login X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f630ada6bef52a1cc46dd9b21140082b1ef03537;p=gosa.git * Fixed problem with non defined ui during login * Added option to enabled compressed output git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7393 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/index.php b/html/index.php index 2f7a401ae..6886f908b 100644 --- a/html/index.php +++ b/html/index.php @@ -130,6 +130,11 @@ if ($_SERVER["REQUEST_METHOD"] != "POST"){ @DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config"); } +/* Enable compressed output */ +if (isset($config->data['MAIN']['COMPRESSED']) && preg_match('/^(true|on)$/i', $config->data['MAIN']['COMPRESSED'])){ + ob_start("ob_gzhandler"); +} + /* Set template compile directory */ if (isset ($config->data['MAIN']['COMPILE'])){ $smarty->compile_dir= $config->data['MAIN']['COMPILE']; diff --git a/html/main.php b/html/main.php index 3620bce81..745a2d2d7 100644 --- a/html/main.php +++ b/html/main.php @@ -76,6 +76,11 @@ if ($_SERVER['REMOTE_ADDR'] != $ui->ip){ } $config= $_SESSION['config']; +/* Enable compressed output */ +if (isset($config->data['MAIN']['COMPRESSED']) && preg_match('/^(true|on)$/i', $config->data['MAIN']['COMPRESSED'])){ + ob_start("ob_gzhandler"); +} + /* Check for invalid sessions */ if(empty($_SESSION['_LAST_PAGE_REQUEST'])){ $_SESSION['_LAST_PAGE_REQUEST']= time(); diff --git a/include/functions.inc b/include/functions.inc index 8e2de5bdd..6eb6c4ef9 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -135,7 +135,7 @@ function get_browser_language() /* Try to use users primary language */ global $config; $ui= get_userinfo(); - if ($ui !== NULL){ + if (isset($ui) && $ui !== NULL){ if ($ui->language != ""){ return ($ui->language.".UTF-8"); }