Code

Added browser blacklisting
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Mar 2010 12:57:16 +0000 (12:57 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Mar 2010 12:57:16 +0000 (12:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16627 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/index.php

index ebae5e52f7393fd19fcd7bf03632e85fdbd6fac5..d48712db64370de07fb8a5846eaf0fb4c91d8faf 100644 (file)
@@ -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"])){