1 <?php
3 class grouptabs extends tabs
4 {
6 function grouptabs($config, $data, $dn,$acl_category)
7 {
8 tabs::tabs($config, $data, $dn,$acl_category);
9 $baseobject= $this->by_object['group'];
10 foreach ($this->by_object as $name => $obj){
11 if(isset($obj->parent)){
12 $this->by_object[$name]->parent = $this;
13 }
14 }
16 /* Add references/acls/snapshots */
17 $this->addSpecialTabs();
18 }
20 function save_object($save_current= FALSE)
21 {
22 tabs::save_object($save_current);
24 /* Update reference, transfer variables */
25 $baseobject= $this->by_object['group'];
26 foreach ($this->by_object as $name => $obj){
27 /* Don't touch base object */
28 if ($name != 'group'){
29 $obj->parent= &$this;
30 $obj->cn= $baseobject->cn;
31 $this->by_object[$name]= $obj;
32 }
33 }
34 }
36 function save()
37 {
38 $baseobject= $this->by_object['group'];
40 /* Check for new 'dn', in order to propagate the
41 'dn' to all plugins */
42 $new_dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
44 /* Put baseobjects 'cn' to mailobjects 'uid' */
45 if (isset($this->by_object['mailgroup'])){
46 $this->by_object['mailgroup']->uid= $baseobject->cn;
47 }
50 /* Update reference, transfer variables */
51 foreach ($this->by_object as $name => $obj){
52 /* Transfer attributes for mailgroup account */
53 if ($name == 'mailgroup'){
54 $this->by_object['mailgroup']->members= $baseobject->memberUid;;
55 }
56 }
58 /* Move group? */
59 if ($this->dn != $new_dn){
61 /* Write entry on new 'dn' */
62 if ($this->dn != "new"){
63 $baseobject->move($this->dn, $new_dn);
64 $this->by_object['group']= $baseobject;
65 }
67 /* Happen to use the new one */
68 $this->dn= $new_dn;
69 }
71 $ret= tabs::save();
73 /* Fix tagging if needed */
74 $baseobject->dn= $new_dn;
75 $baseobject->handle_object_tagging();
77 return $ret;
78 }
80 function saveCopyDialog()
81 {
82 tabs::saveCopyDialog();
84 /* Update reference, transfer variables */
85 $baseobject= $this->by_object['group'];
86 foreach ($this->by_object as $name => $obj){
87 /* Don't touch base object */
88 if ($name != 'group'){
89 $obj->parent= &$this;
90 $obj->cn= $baseobject->cn;
91 $this->by_object[$name]= $obj;
92 }
93 }
94 }
96 }
98 ?>