summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 105fd5a)
raw | patch | inline | side by side (parent: 105fd5a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 May 2010 10:12:01 +0000 (10:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 May 2010 10:12:01 +0000 (10:12 +0000) |
-Added some check methods.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18177 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18177 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index a3f46e8356f2beaa7bd5629728e354fdc5cdb052..076f626ef6386aa4f2e95ab27f12fdb488dc45c6 100644 (file)
$this->_restoreCurrentValue();
}
+ static function isBool($message,$class,$name,$value, $type)
+ {
+ return(in_array($value,array('true','false','')));
+ }
+
+ static function isInteger($message,$class,$name,$value, $type)
+ {
+ return(is_numeric($value) && !preg_match("/[^0-9]/", $value));
+ }
+
+ static function isPath($message,$class,$name,$value, $type)
+ {
+ return(TRUE);
+ }
+
+ static function isExistingPath($message,$class,$name,$value, $type)
+ {
+ return(TRUE);
+ }
+
+ static function isCommand($message,$class,$name,$value, $type)
+ {
+ return(TRUE);
+ }
+
+ static function isDn($message,$class,$name,$value, $type)
+ {
+ return(TRUE);
+ }
+
+ static function isRdn($message,$class,$name,$value, $type)
+ {
+ return(TRUE);
+ }
+
private function _restoreCurrentValue()
{
index 947f475a009642724e834936b85148b9d2083717..ab8a50c83bfe8602b1b3596542f5d472894352d4 100644 (file)
"default" => "",
"description" =>
_("The 'passwordHook' can specify an external script to handle password settings at some other location besides the LDAP.")." ".sprintf(_("It will be called this way: %s"),"/path/to/your/script \"username\" \"oldpassword\" \"newpassword\""),
- "check" => "gosaProperty::isShellCommand",
+ "check" => "gosaProperty::isCommand",
"migrate" => "",
"group" => "password",
"mandatory" => FALSE),
"type" => "bool",
"default" => TRUE,
"description" => "The 'schemaCheck' statement enables or disables schema checking during login. It is recommended to switch this on in order to let GOsa handle object creation more efficient.",
- "check" => "gosaProperty::isInteger",
+ "check" => "gosaProperty::isBool",
"migrate" => "",
"group" => "debug",
"mandatory" => FALSE),
"type" => "bool",
"default" => FALSE,
"description" => "The 'copyPaste' statement enables copy and paste for LDAP entries managed with GOsa.",
- "check" => "gosaProperty::isInteger",
+ "check" => "gosaProperty::isBool",
"migrate" => "",
"group" => "copyPaste",
"mandatory" => FALSE),
"type" => "rdn",
"default" => "ou=winstations",
"description" => "This statement defines the location where GOsa looks for new samba workstations.",
- "check" => "gosaProperty::isRDN",
+ "check" => "gosaProperty::isRdn",
"migrate" => "",
"group" => "samba",
"mandatory" => FALSE),
array(
"name" => "minId",
"type" => "integer",
- "default" => "The 'minId' statement defines the minimum assignable user or group id to avoid security leaks with uid 0 accounts. This is used for the 'traditional' method.",
- "description" => "",
+ "default" => "",
+ "description" => "The 'minId' statement defines the minimum assignable user or group id to avoid security leaks with uid 0 accounts. This is used for the 'traditional' method.",
"check" => "gosaProperty::isInteger",
"migrate" => "",
"group" => "core",
diff --git a/gosa-core/plugins/addons/configViewer/class_configViewer.inc b/gosa-core/plugins/addons/configViewer/class_configViewer.inc
index ada7e6fb941af1773083a7884a48ca5e3d1e5b70..08d27d83ae818300a35d47ea49c21190f15d4e7c 100644 (file)
$tooltip = "<div id='tooltip_{$id}' class='tooltip' style='display:none'>".$title."</div>";
return($tooltip."<span title='tooltip_{$id}'>{$cn[0]}</span>");
}
- static function propertyValue($class,$cn,$value,$type,$default,$defaults)
+ static function propertyValue($class,$cn,$value,$type,$default,$defaults,$check)
{
$ssize = "208px";
$isize = "200px";
default: echo $type[0].$name." ";$res = "";
}
- return($res." <i>(".$value).")</i>";
+ // Color row in red if the check methods returns false.
+ if(!empty($check[0])){
+ $check = call_user_func(preg_split("/::/", $check[0]),$displayMessage=FALSE, $class[0], $cn[0], $value, $type[0]);
+ if(!$check){
+ $res.= "<rowClass:entry-error/>";
+ }
+ }
+
+ return($res." <i>(".$value.")</i>");
}
}
?>
diff --git a/gosa-core/plugins/addons/configViewer/property-list.xml b/gosa-core/plugins/addons/configViewer/property-list.xml
index 54794a1405fb80a2672916b791c7b4d85790b0be..562ecdb1e732e47693ffc78046b4188ce13ec670 100644 (file)
<label>Value</label>
<sortAttribute>value</sortAttribute>
<sortType>string</sortType>
- <value>%{filter:propertyValue(class,cn,value,type,default,defaults)}</value>
+ <value>%{filter:propertyValue(class,cn,value,type,default,defaults,check)}</value>
<export>true</export>
</column>