X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_configRegistry.inc;h=f895a3dac561ef9a0c1a8c04d3c426c7beb37f3c;hb=9566dc068208034acf0da2630a7efbb5a370f191;hp=9809788ef5eb76f7d65195bf63357bb4fc45be54;hpb=38a52b365b0ddccfb87f2b865505c8ba6464490a;p=gosa.git diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc index 9809788ef..f895a3dac 100644 --- a/gosa-core/include/class_configRegistry.inc +++ b/gosa-core/include/class_configRegistry.inc @@ -415,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); @@ -737,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);