From: hickert Date: Thu, 13 Dec 2007 08:11:21 +0000 (+0000) Subject: Made posix trustmodel available in multi edit X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a37fbf0269c1c1754aadbf0cad1286d17f8ab2c1;p=gosa.git Made posix trustmodel available in multi edit git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8117 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index efcef2298..5fad0db19 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -541,12 +541,11 @@ class posixAccount extends plugin } $smarty->assign("force_ids", ""); } - $smarty->assign("force_idsACL", $this->getacl("uidNumber",$SkipWrite).$this->getacl("gidNumber",$SkipWrite)); - foreach(array("primaryGroup") as $val){ + foreach(array("primaryGroup","trustmode") as $val){ if(in_array($val,$this->multi_boxes)){ $smarty->assign("use_".$val,TRUE); }else{ @@ -1424,6 +1423,10 @@ class posixAccount extends plugin if(in_array("primaryGroup",$this->multi_boxes)){ $ret['primaryGroup'] = $this->primaryGroup; } + if(in_array("trustmode",$this->multi_boxes)){ + $ret['trustModel'] = $this->trustModel; + $ret['accessTo'] = $this->accessTo; + } return($ret); } @@ -1432,12 +1435,30 @@ class posixAccount extends plugin { if(isset($_POST['posix_mulitple_edit'])){ plugin::multiple_save_object(); - foreach(array("primaryGroup") as $val){ + foreach(array("primaryGroup","trustmode") as $val){ if(isset($_POST["use_".$val])){ $this->multi_boxes[] = $val; } } + /* 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 primary group settings */ if($this->acl_is_writeable("primaryGroup") && isset($_POST['primaryGroup'])){ $data= $_POST['primaryGroup']; @@ -1495,8 +1516,25 @@ class posixAccount extends plugin } } $this->groupMembership_some = $groups_some; - $this->primaryGroup = $this->gidNumber; + + /* Is this account a trustAccount? */ + if (isset($this->multi_attrs['trustModel'])){ + $this->trustModel= $this->multi_attrs['trustModel'][0]; + $this->was_trust_account= TRUE; + $this->multi_boxes[] = "trustmode"; + } else { + $this->was_trust_account= FALSE; + $this->trustModel= ""; + } + + $this->accessTo = array(); + if (isset($this->multi_attrs['accessTo'])){ + for ($i= 0; $i<$this->multi_attrs['accessTo']['count']; $i++){ + $tmp= $this->multi_attrs['accessTo'][$i]; + $this->accessTo[$tmp]= $tmp; + } + } } diff --git a/gosa-core/plugins/personal/posix/generic.tpl b/gosa-core/plugins/personal/posix/generic.tpl index 5371c53b7..1a1305894 100644 --- a/gosa-core/plugins/personal/posix/generic.tpl +++ b/gosa-core/plugins/personal/posix/generic.tpl @@ -22,7 +22,7 @@ - + {render acl=$gidNumberACL checkbox=$multiple_support checked=$use_primaryGroup} - {html_options options=$trustmodes selected=$trustmode} - -{/render} -{render acl=$trustmodeACL} - -{/render} -
-{render acl=$trustmodeACL} -   -{/render} -{render acl=$trustmodeACL} - -{/render} +{if !$multiple_support} + {t}Trust mode{/t}  + {render acl=$trustmodeACL} + + {/render} + {render acl=$trustmodeACL} + + {/render} +
+ {render acl=$trustmodeACL} +   + {/render} + {render acl=$trustmodeACL} + + {/render} + +{else} + + {t}Trust mode{/t}  + +{/if}