From: cajus Date: Tue, 16 Mar 2010 12:57:16 +0000 (+0000) Subject: Added browser blacklisting X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bc6564d7a078233fab93256107d49fc90fe83263;p=gosa.git Added browser blacklisting git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16627 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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"])){