Code

Allowed - un givenName and sn
[gosa.git] / html / index.php
index 9ced14d6732b888ed9abaf8207020807812b12f5..1adcf42ff6d6ed1f65fde5541d1da1bcce127f30 100644 (file)
@@ -78,6 +78,8 @@ if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
   exit();
 }
 
+/* Check for old files in compile directory */
+clean_smarty_compile_dir($smarty->compile_dir);
 
 /* Language setup */
 if ($config->data['MAIN']['LANG'] == ""){
@@ -118,7 +120,7 @@ if (!isset($HTTP_SERVER_VARS['HTTPS']) ||
 }
 
 /* If SSL is forced, just forward to the SSL enabled site */
-if ($config->data['MAIN']['FORCESSL'] == 'true'){
+if ($config->data['MAIN']['FORCESSL'] == 'true' && $ssl != ''){
   header ("Location: $ssl");
   exit;
 }
@@ -140,6 +142,24 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){
     exit();
   }
 
+  /* Check for schema file presence */
+  require_once("functions_setup.inc");
+  if(!is_schema_readable($config->current['SERVER'],$config->current['ADMIN'],$config->current['PASSWORD'])){
+    print_red(_("GOsa cannot retrieve information about the installed schema files. Please make sure, that this is possible."));
+    echo $_SESSION['errors'];
+    exit();
+  }else{
+    $str = (schema_check($config->current['SERVER'],$config->current['ADMIN'],$config->current['PASSWORD'],0,TRUE));
+    $checkarr = array();
+    foreach($str as $tr){
+      if(isset($tr['needonstartup'])){
+        print_red($tr['msg']."<br>"._("Your ldap setup contains old schema definitions. Please re-run the setup."));
+        print $_SESSION['errors'];
+        exit();
+      }
+    }
+  }
+
   /* Check for locking area */
   $ldap->cat($config->current['CONFIG']);
   $attrs= $ldap->fetch();
@@ -232,6 +252,11 @@ $smarty->assign ("PHPSESSID", session_id());
 if (isset($_SESSION['errors'])){
   $smarty->assign("errors", $_SESSION['errors']);
 }
+if ($error_collector != ""){
+  $smarty->assign("php_errors", $error_collector."</div>");
+} else {
+  $smarty->assign("php_errors", "");
+}
 $smarty->display (get_template_path('login.tpl'));
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: