summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30cce8a)
raw | patch | inline | side by side (parent: 30cce8a)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Sep 2009 08:46:50 +0000 (08:46 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 28 Sep 2009 08:46:50 +0000 (08:46 +0000) |
enables to let all member objects inherit from the objectgroup,
instead of doing this manually from each object.
(Trac: #3020)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14360 594d385d-05f5-0310-b6e9-bd551577e9d8
instead of doing this manually from each object.
(Trac: #3020)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14360 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc | patch | blob | history | |
trunk/gosa-plugins/goto/admin/ogroups/goto/termgroup.tpl | patch | blob | history |
diff --git a/trunk/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc b/trunk/gosa-plugins/goto/admin/ogroups/goto/class_termgroup.inc
index 889acaf16c1cce3b7e7cb1022f7d6fc48fae3442..5bf886ddbced63152818a527e9f47edfe095d6a5 100644 (file)
/* attribute list for save action */
var $members= array();
+ /* Stores a list of the member dn's */
+ var $member_dn = array();
+
var $gotoMode = "locked";
var $gotoSyslogServer = "";
var $gotoNtpServer = array();
var $nfsservers = array();
var $swapservers = array();
var $member_of_ogroup= false;
-
+ var $members_inherit_from_group = true;
function termgroup (&$config, $dn= NULL, $parent= NULL)
{
if(isset($this->attrs['member'])){
for ($i= 0; $i<$this->attrs['member']['count']; $i++){
$member= $this->attrs['member'][$i];
+ array_push($this->member_dn, $member);
$ldap->cat($member, array('objectClass', 'macAddress', 'cn'));
if ($ldap->success()){
$attrs = $ldap->fetch();
Handle requested action
***************/
+ /* Handle the inherit to members button */
+ if (isset($_POST['inheritToMembers'])) {
+ $this->members_inherit_from_group = true;
+ }
+
/* Watch for events */
if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate")) && isset($this->mapActions[$_POST['saction']]) ){
plugin::save();
+ /* Tell members to inherit all attributes if the flag is set */
+ $this->inherit_attributes_to_members();
+
/***************
Prepare special vars
***************/
));
}
+ function inherit_attributes_to_members()
+ {
+ if ($this->members_inherit_from_group) {
+ foreach ($this->member_dn as $dn) {
+ $member_obj = new worktabs($this->config, $this->config->data['TABS']['WORKTABS'], $dn);
+ $member_obj->by_object['workgeneric']->set_everything_to_inherited();
+ $member_obj->save();
+ }
+ }
+ }
+
function PrepareForCopyPaste($source)
{
/* Create used ntp server array */
diff --git a/trunk/gosa-plugins/goto/admin/ogroups/goto/termgroup.tpl b/trunk/gosa-plugins/goto/admin/ogroups/goto/termgroup.tpl
index af2d0a5d7484722fca129037fa7546633c838b27..4c265def4f66711c86dec578261afcaa6ba65bed 100644 (file)
</td>
<td style="vertical-align:top;border-left:1px solid #A0A0A0;">
<!-- Bottom right -->
+ <input type='submit' name='inheritToMembers' value='{t}Inherit all values to group members{/t}'>
</td>
</tr>
</table>