diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index ee68d2ed46836ec343471604dde32eb23770a94c..f895a3dac561ef9a0c1a8c04d3c426c7beb37f3c 100644 (file)
return($match);
}
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);
static function isWriteablePath($message,$class,$name,$value, $type)
{
$match = !empty($value)&&is_dir($value)&&is_writeable($value);