Code

Added last check, ..... ....
[gosa.git] / html / index.php
index 74591d847f0adeea7f4b7fe9e38ed5ba66fcc455..f11f8514a536c26e8478b966f4d97118a194fe0f 100644 (file)
@@ -122,7 +122,7 @@ if ($config->data['MAIN']['FORCESSL'] == 'true' && $ssl != ''){
 }
 
 /* Got a formular answer, validate and try to log in */
-if ($_SERVER["REQUEST_METHOD"] == "POST"){
+if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
 
   /* Reset error messages */
   $message= "";
@@ -140,23 +140,24 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){
   }
 
   /* 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();
+  if(preg_match("/true/i",$config->data['MAIN']['SCHEMA_CHECK'])){
+    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();
@@ -284,7 +285,7 @@ function displayLogin()
 
     /* Displasy SSL mode warning? */
     if ($ssl != "" && $config->data['MAIN']['WARNSSL'] == 'true'){
-      $smarty->assign ("ssl", "<b>"._("Warning").":</b> "._("Session will not be encrypted.")." <a style=\"color:red;\" href=\"$ssl\"><b>"._("Enter         SSL         session")."</b></a>!");
+      $smarty->assign ("ssl", "<b>"._("Warning").":</b> "._("Session will not be encrypted.")." <a style=\"color:red;\" href=\"$ssl\"><b>"._("Enter SSL session")."</b></a>!");
     } else {
       $smarty->assign ("ssl", "");
     }