Code

Updatd index.php
[gosa.git] / html / index.php
index 14379e0129682433f3054b4feb024dede5694534..c33e7bbcd51c8dd10d7c658ff7ef9b39166db3a0 100644 (file)
@@ -223,15 +223,23 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
       displayLogin();
       exit();
     }else{
-#      $str = (schema_check($config->current['SERVER'],$config->current['ADMIN'],$config->current['PASSWORD'], $recursive, $tls, 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."));
-#          displayLogin();
-#          exit();
-#        }
-#      }
+      $cfg = array(); 
+      $cfg['admin']     = $config->current['ADMIN'];
+      $cfg['password']  = $config->current['PASSWORD'];
+      $cfg['connection']= $config->current['SERVER'];
+      $cfg['tls']       = $tls;
+  
+      $str = check_schema($cfg,isset($config->current['RFC2307BIS']) && preg_match("/(true|yes|on|1)/i",$config->current['RFC2307BIS']));
+
+      $checkarr = array();
+      foreach($str as $tr){
+        if(isset($tr['IS_MUST_HAVE']) && !$tr['STATUS']){
+          print_red($tr['MSG']."<br>"._("Your ldap setup contains old schema definitions. Please re-run the setup."));
+          displayLogin();
+          exit();
+        }
+      }
     }
   }
   /* Check for locking area */
@@ -262,7 +270,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){
 
     /* Login as user, initialize user ACL's */
     $ui= ldap_login_user($username, $_POST["password"]);
-    if ($ui === NULL || $ui == 0){
+    if ($ui === NULL || !$ui ){
       $message= _("Please check the username/password combination.");
       $smarty->assign ('nextfield', 'password');
       gosa_log ("Authentication failed for user \"$username\"");