Code

Updated dumpTable function
[gosa.git] / gosa-core / include / class_configRegistry.inc
index d14f4ef4401c7c4801ee24706aaf2f62a927b5b0..f895a3dac561ef9a0c1a8c04d3c426c7beb37f3c 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
@@ -406,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);    
 
@@ -728,6 +743,31 @@ class gosaProperty
         return($match);
     }
 
+    static function isWriteableFile($message,$class,$name,$value, $type)
+    {
+        $match = (file_exists($value) && is_writeable($value)) || 
+                 (!file_exists($value) && is_writeable(dirname($value)));
+                
+   
+        // Display the reason for failing this check.         
+        if($message && ! $match){
+
+            if(!file_exists($value) && !is_writeable(dirname($value))){
+                msg_dialog::display(_("Warning"), 
+                        sprintf(_("The file '%s' specified for '%s:%s' cannot be created neither be used for writing!"), 
+                            bold($value),bold($class),bold($name)), 
+                        WARNING_DIALOG);
+            }elseif(file_exists($value) && !is_writeable($value)){
+                msg_dialog::display(_("Warning"), 
+                        sprintf(_("The file '%s' specified for '%s:%s' cannot be used for writing!"), 
+                            bold($value),bold($class),bold($name)), 
+                        WARNING_DIALOG);
+            }
+        }
+
+        return($match);
+    }
+
     static function isWriteablePath($message,$class,$name,$value, $type)
     {
         $match = !empty($value)&&is_dir($value)&&is_writeable($value);