Code

Added additional schema check for rfc2307bis groups
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 13:38:14 +0000 (13:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 13:38:14 +0000 (13:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6138 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_Schema.inc

index 148c7df7d6146f91a0f45ea617b14ccd7f40c152..b5bd6bbf1d86bf8cda1ec1bbf38f967cf8af36f9 100644 (file)
@@ -206,19 +206,36 @@ class Step_Schema extends setup_step
       }
     }
   
-    $this->checked = $checks;
     $tmp = $objectclasses;
-    $not_checked = array();
-    foreach($tmp as $name => $val){
-      $desc = "no description.";
-      if(preg_match("/DESC/",$val)){ 
-        $desc = preg_replace("/^.*DESC[ ]*'/i","",$val) ;
-        $desc = preg_replace("/'.*$/i","",$desc) ;
-      }  
-      $not_checked[$name] = $desc;
+
+    /* Depending on selected rfc2307bis mode, we need different schema configurations */
+    $rfc2307bis = $this->parent->captured_values['rfc2307bis'];
+    $posixGroup = $tmp['posixGroup'];
+    $structural = preg_match("/STRUCTURAL/i",$posixGroup);
+
+    /* The gosa base schema */
+    $checks['posixGroup'] = $def_check;
+    $checks['posixGroup']['REQUIRED_VERSION'] = "2.4";
+    $checks['posixGroup']['SCHEMA_FILES']     = array("gosa+samba3.schema","gosa.schema");
+    $checks['posixGroup']['CLASSES_REQUIRED'] = array("posixGroup");
+    $checks['posixGroup']['STATUS']           = TRUE;
+    $checks['posixGroup']['IS_MUST_HAVE']     = TRUE;
+    $checks['posixGroup']['MSG']              = "";
+    $checks['posixGroup']['INFO']             = "";
+
+    if($rfc2307bis && $structural){
+      $checks['posixGroup']['STATUS']           = FALSE;
+      $checks['posixGroup']['MSG']              = _("You have enabled the rfc2307bis option on the 'ldap setup' step, but your schema configuration do not support this option.");
+      $checks['posixGroup']['INFO']             = _("In order to use rfc2307bis corform groups the objectClass 'posixGroup' must be AUXILIARY");
     }
+    if(!$rfc2307bis && !$structural){
+      $checks['posixGroup']['STATUS']           = FALSE;
+      $checks['posixGroup']['MSG']              = _("You have disabled the rfc2307bis option on the 'ldap setup' step, but your schema configuration do not support this option.");
+      $checks['posixGroup']['INFO']             = _("The objectClass 'posixGroup' must be STRUCTURAL");
+    }
+
 
-    $this->not_checked = $not_checked;  
+    $this->checked = $checks;
   }
 }