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 c8072711949ab4eebde08e95445c36b8174b48d3..53e23ec4e152dafb7e3763f53ec51ffe4e2ae666 100644 (file)
var $nfsservers = array();
var $swapservers = array();
var $member_of_ogroup= false;
- var $members_inherit_from_group = true;
+ var $inherit_confirmation;
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);
+ array_push($this->member_dn, @LDAP::convert($member));
$ldap->cat($member, array('objectClass', 'macAddress', 'cn'));
if ($ldap->success()){
$attrs = $ldap->fetch();
/* Handle the inherit to members button */
if (isset($_POST['inheritToMembers'])) {
- $this->members_inherit_from_group = true;
+ $this->inherit_confirmation = new msg_dialog(_("Pass on all attributes to group members"), _("This action will overwrite all attributes of the group members with the values specified in this object group. Do you want to proceed?"),CONFIRM_DIALOG);
+ }
+
+ if (is_object($this->inherit_confirmation) && ($this->inherit_confirmation->is_confirmed())) {
+ $this->pass_attributes_to_members();
}
/* Watch for events */
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()
+ function pass_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, 'workstation/workgeneric');
- $member_obj->by_object['workgeneric']->set_everything_to_inherited();
- $member_obj->save();
- }
+ foreach ($this->member_dn as $dn) {
+ $member_obj = new worktabs($this->config, $this->config->data['TABS']['WORKTABS'], $dn, 'workstation');
+ $member_obj->by_object['workgeneric']->set_everything_to_inherited();
+ $member_obj->save();
}
}