1 <?php
3 class grouptabs extends tabs
4 {
6 function grouptabs($config, $data, $dn)
7 {
8 tabs::tabs($config, $data, $dn);
9 }
11 function save_object($save_current= FALSE)
12 {
13 tabs::save_object($save_current);
15 /* Update reference, transfer variables */
16 $baseobject= $this->by_object['group'];
17 foreach ($this->by_object as $name => $obj){
18 /* Don't touch base object */
19 if ($name != 'group'){
20 $obj->parent= &$this;
21 $obj->cn= $baseobject->cn;
22 $this->by_object[$name]= $obj;
23 }
24 }
25 }
27 function save()
28 {
29 $baseobject= $this->by_object['group'];
31 /* Check for new 'dn', in order to propagate the
32 'dn' to all plugins */
33 $new_dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
35 /* Put baseobjects 'cn' to mailobjects 'uid' */
36 if (isset($this->by_object['mailgroup'])){
37 $this->by_object['mailgroup']->uid= $baseobject->cn;
38 }
41 /* Update reference, transfer variables */
42 foreach ($this->by_object as $name => $obj){
43 /* Transfer attributes for mailgroup account */
44 if ($name == 'mailgroup'){
45 $obj->members= $baseobject->memberUid;
46 $this->by_object['mailgroup']= $obj;
47 }
48 }
50 /* Move group? */
51 if ($this->dn != $new_dn){
53 /* Write entry on new 'dn' */
54 if ($this->dn != "new"){
55 $baseobject->move($this->dn, $new_dn);
56 $this->by_object['group']= $baseobject;
57 }
59 /* Happen to use the new one */
60 $this->dn= $new_dn;
61 }
63 return tabs::save();
64 }
66 }
68 ?>