Code

-Updated jsonRPC calls - use ssl certs
[gosa.git] / gosa-core / include / class_configRegistry.inc
index 47355e5747c17b980a253698bb6a1e878732ccae..ee68d2ed46836ec343471604dde32eb23770a94c 100644 (file)
@@ -57,6 +57,15 @@ class configRegistry{
         $this->reload();
     }
 
+    
+    /*! \brief      Returns a list of plugins used by GOsa.
+        @return     Array       An array containing all plugins with theis plInfo data.
+     */
+    function getListOfPlugins()
+    {
+        return($this->classesWithInfo);
+    }
+
 
     /*! \brief      Checks whether the schema check was called in the current session or not.
      *  @return     Boolean     True if check was already called
@@ -138,12 +147,26 @@ class configRegistry{
         foreach($this->classesWithInfo as $cname => $defs){
             if(isset($defs['plRequirements'])){
 
+                // Check only if required plugin is enabled in gosa.conf
+                // Normally this is the class name itself, but may be overridden
+                //  in plInfo using the plRequirements::activePlugin statement.
+                $requiresActivePlugin = $cname;
+                if(isset($defs['plRequirements']['activePlugin'])){
+                    $requiresActivePlugin = $defs['plRequirements']['activePlugin'];
+                }
+
                 // Only queue checks for active plugins. 
-                if(isset($this->activePlugins[strtolower($cname)])){
+                if(isset($this->activePlugins[strtolower($requiresActivePlugin)])){
                     $this->pluginRequirements[$cname] = $defs['plRequirements'];
                 }else{
-                    new log("debug","schemaValidation","Skipped schema check for '{$cname}' plugin is inactive!",
-                        array(),'');
+                    if($cname == $requiresActivePlugin){
+                        new log("debug","","Skipped schema check for '{$cname}' plugin is inactive!",
+                                array(),'');
+                    }else{
+                        new log("debug","","Skipped schema check for class '{$cname}' skipped,".
+                                    " required plugin '{$requiresActivePlugin}' is inactive!",
+                                array(),'');
+                    }
                 }
             }
         }
@@ -161,7 +184,7 @@ class configRegistry{
                         $this->schemaCheckFailed = TRUE;
                         $failure = TRUE;
 
-                        new log("debug","schemaValidation","LDAP objectClass missing '{$oc}'!",
+                        new log("debug","","LDAP objectClass missing '{$oc}'!",
                                 array(),'');
 
                     }elseif(!empty($version)){
@@ -175,7 +198,7 @@ class configRegistry{
                             $this->schemaCheckFailed = TRUE;
                             $failure = TRUE;
 
-                            new log("debug","schemaValidation","LDAP objectClass version mismatch '{$oc}' ".
+                            new log("debug","","LDAP objectClass version mismatch '{$oc}' ".
                                     "has '{$currentVersion}' but {$version} required!",
                                     array(),'');
                         }
@@ -374,7 +397,6 @@ class configRegistry{
                     $this->ldapStoredProperties[$class][$name] = $value;
                 }
             }
-            $this->status = 'finished';
         }
 
         // Register plugin properties.
@@ -393,6 +415,12 @@ class configRegistry{
             $this->register($cname, $data);    
             $data = array('name' => 'postmodify','type' => 'command');
             $this->register($cname, $data);    
+            $data = array('name' => 'precreate','type' => 'command');
+            $this->register($cname, $data);    
+            $data = array('name' => 'preremove','type' => 'command');
+            $this->register($cname, $data);    
+            $data = array('name' => 'premodify','type' => 'command');
+            $this->register($cname, $data);    
             $data = array('name' => 'check', 'type' => 'command');
             $this->register($cname, $data);    
 
@@ -403,6 +431,19 @@ class configRegistry{
                 }
             }
         }
+
+        // We are only finsihed once we are logged in.
+        if(!empty($this->config->current['CONFIG'])){
+            $this->status = 'finished';
+        }
+    }
+
+   
+    /*! \brief      Returns TRUE if the property registration has finished without any error.
+     */ 
+    function propertyInitializationComplete()
+    {
+        return($this->status == 'finished');
     }