summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d56e3bc)
raw | patch | inline | side by side (parent: d56e3bc)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 May 2010 09:53:06 +0000 (09:53 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 May 2010 09:53:06 +0000 (09:53 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18194 594d385d-05f5-0310-b6e9-bd551577e9d8
index 6e939144447e7a245b3a6619f06d9db33027ed24..2ea2668a21bc692425edd6036d589a10c389d8e0 100644 (file)
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
}else{
/* check GOsa.conf for defined session lifetime */
- $max_life= $config->get_cfg_value("core","sessionLifetime", 60*60*2);
+ $max_life= $config->get_cfg_value("core","sessionLifetime");
/* get time difference between last page reload */
$request_time = (time()- session::global_get('_LAST_PAGE_REQUEST'));
diff --git a/gosa-core/plugins/addons/configViewer/class_configViewer.inc b/gosa-core/plugins/addons/configViewer/class_configViewer.inc
index 08d27d83ae818300a35d47ea49c21190f15d4e7c..41db5b37aa67f938d25a40605b25658a746366fe 100644 (file)
function saveProperties()
{
- $this->config->configRegistry->saveChanges();
+ $all = $this->config->configRegistry->getAllProperties();
+ $valid = TRUE;
+ foreach($all as $prop){
+ $valid &= $prop->check();
+ }
+
+ if($valid){
+ $this->config->configRegistry->saveChanges();
+ }
}
function detectPostActions()
}
return($class);
}
- static function propertyName($class,$cn, $description = array())
+ static function propertyName($class,$cn, $description,$mandatory)
{
$id = "{$class[0]}_{$cn[0]}";
if(isset($description[0])) $title = htmlentities($description[0],ENT_COMPAT, 'UTF-8');
$title = preg_replace("/\n/", "<br>", $title);
$tooltip = "<div id='tooltip_{$id}' class='tooltip' style='display:none'>".$title."</div>";
- return($tooltip."<span title='tooltip_{$id}'>{$cn[0]}</span>");
+
+ $must = ($mandatory[0]) ? "<span class='required'>*</span>" : "";
+
+ return($tooltip."<span title='tooltip_{$id}'>{$cn[0]}{$must}</span>");
}
- static function propertyValue($class,$cn,$value,$type,$default,$defaults,$check)
+ static function propertyValue($class,$cn,$value,$type,$default,$defaults,$check,$mandatory)
{
$ssize = "208px";
$isize = "200px";
break;
default: echo $type[0].$name." ";$res = "";
}
-
+
+ // Check if it is a required value.
+ if($mandatory[0] && empty($value)){
+ $res.= "<rowClass:entry-error/>";
+ }
+
// Color row in red if the check methods returns false.
- if(!empty($check[0])){
+ if(!empty($check[0]) && !empty($value)){
$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>");
+ return($res);
}
}
?>
diff --git a/gosa-core/plugins/addons/configViewer/class_filterProperties.inc b/gosa-core/plugins/addons/configViewer/class_filterProperties.inc
index 15ac1aa5d4400695628b32feeb4811c250ec54d8..4bb74f0b5759a6f2a6f32e8b4de11d02d003bf37 100644 (file)
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'status', $property->getStatus());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'description', $property->getDescription());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'value', $property->getValue($temporary = TRUE));
+ $entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'mandatory', $property->isMandatory());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'default', $property->getDefault());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'defaults', $property->getDefaults());
$entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'check', $property->getCheck());
diff --git a/gosa-core/plugins/addons/configViewer/property-list.xml b/gosa-core/plugins/addons/configViewer/property-list.xml
index 562ecdb1e732e47693ffc78046b4188ce13ec670..eed237679e3a7d21c2d443cdce0c5f9247923e5b 100644 (file)
<label>Name</label>
<sortAttribute>cn</sortAttribute>
<sortType>string</sortType>
- <value>%{filter:propertyName(class,cn,description)}</value>
+ <value>%{filter:propertyName(class,cn,description,mandatory)}</value>
<export>true</export>
</column>
<label>Value</label>
<sortAttribute>value</sortAttribute>
<sortType>string</sortType>
- <value>%{filter:propertyValue(class,cn,value,type,default,defaults,check)}</value>
+ <value>%{filter:propertyValue(class,cn,value,type,default,defaults,check,mandatory)}</value>
<export>true</export>
</column>