From 823c4546c547afcb509fa7e90f3b0a6991d05e6b Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 14 Aug 2008 06:20:59 +0000 Subject: [PATCH] Updated groups -Fixed problem with mutliple edit. Nagios and trust settings will now be saved correctly. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12213 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/groups/class_groupGeneric.inc | 31 ++++++++++++-- gosa-core/plugins/admin/groups/generic.tpl | 42 ++++++++++++++++++- 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc index 955216970..13c16fac5 100644 --- a/gosa-core/plugins/admin/groups/class_groupGeneric.inc +++ b/gosa-core/plugins/admin/groups/class_groupGeneric.inc @@ -593,7 +593,7 @@ class group extends plugin $smarty->assign("use_".$val,FALSE); } } - foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group") as $val){ + foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group","trustmode") as $val){ if(in_array($val,$this->multi_boxes)){ $smarty->assign("use_".$val,TRUE); }else{ @@ -1287,7 +1287,7 @@ class group extends plugin plugin::save_object(); $this->base = $base_tmp; - foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group") as $attr){ + foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group","trustmode") as $attr){ if(isset($_POST['use_'.$attr])){ $this->multi_boxes[] = $attr; } @@ -1301,7 +1301,7 @@ class group extends plugin } } - foreach (array( "smbgroup" => "sambaGroupType") as $val => $aclname) { + foreach (array( "smbgroup" => "sambaGroupType" ,"nagios_group" => "nagios_group") as $val => $aclname) { if ($this->acl_is_writeable($aclname)){ if(isset($_POST["$val"])){ $this->$val= TRUE; @@ -1317,6 +1317,23 @@ class group extends plugin $this->groupType= $_POST['groupType']; } + /* Trust mode - special handling */ + if($this->acl_is_writeable("trustModel")){ + if (isset($_POST['trustmode'])){ + $saved= $this->trustModel; + if ($_POST['trustmode'] == "1"){ + $this->trustModel= "fullaccess"; + } elseif ($_POST['trustmode'] == "2"){ + $this->trustModel= "byhost"; + } else { + $this->trustModel= ""; + } + if ($this->trustModel != $saved){ + $this->is_modified= TRUE; + } + } + } + /* Save fon attribute */ if ($this->acl_is_writeable("fonGroup")){ if (isset ($_POST['fon_group'])){ @@ -1333,11 +1350,17 @@ class group extends plugin { $ret = plugin::get_multi_edit_values(); - foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group") as $attr){ + foreach(array("base","smbgroup","groupType","sambaDomainName","fon_group","nagios_group") as $attr){ if(in_array($attr,$this->multi_boxes)){ $ret[$attr] = $this->$attr; } } + + if(in_array("trustmode",$this->multi_boxes)){ + $ret['trustModel'] = $this->trustModel; + $ret['accessTo'] = $this->accessTo; + } + $ret['memberUid'] = $this->memberUid; $ret['memberUid_used_by_some'] = $this->memberUid_used_by_some; return($ret); diff --git a/gosa-core/plugins/admin/groups/generic.tpl b/gosa-core/plugins/admin/groups/generic.tpl index 726d1e12d..45e95d516 100644 --- a/gosa-core/plugins/admin/groups/generic.tpl +++ b/gosa-core/plugins/admin/groups/generic.tpl @@ -151,8 +151,8 @@ -{render acl=$nagiosGroupACL} - {t}Members are in a nagios group{/t} +{render acl=$nagiosGroupACL checkbox=$multiple_support checked=$use_nagios_group} + {t}Members are in a nagios group{/t} {/render} @@ -163,6 +163,7 @@
+{if !$multiple_support} {t}Trust mode{/t}  @@ -192,6 +193,43 @@ + +{else} + + + + + {t}Trust mode{/t}  + + + + +{/if} -- 2.30.2