From bc6564d7a078233fab93256107d49fc90fe83263 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 16 Mar 2010 12:57:16 +0000 Subject: [PATCH] Added browser blacklisting git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16627 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/index.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gosa-core/html/index.php b/gosa-core/html/index.php index ebae5e52f..d48712db6 100644 --- a/gosa-core/html/index.php +++ b/gosa-core/html/index.php @@ -33,8 +33,20 @@ header("Content-type: text/html; charset=UTF-8"); */ function displayLogin() { - global $smarty,$message,$config,$ssl,$error_collector; + global $smarty,$message,$config,$ssl,$error_collector, $BASE_DIR; error_reporting(E_ALL | E_STRICT); + + /* Check theme compatibility */ + $theme= $config->get_cfg_value('theme', 'default'); + if (file_exists("$BASE_DIR/ihtml/themes/$theme/blacklist")) { + $blocks= file("$BASE_DIR/ihtml/themes/$theme/blacklist"); + foreach ($blocks as $block) { + if (preg_match('/'.preg_quote($block).'/', $_SERVER['HTTP_USER_AGENT'])) { + die(sprintf(_("Your browser (%s) is blacklisted for the current theme."), $block)); + } + } + } + /* Fill template with required values */ $username = ""; if(isset($_POST["username"])){ -- 2.30.2