1 <?php
3 class grouptabs extends tabs
4 {
6 function grouptabs($config, $data, $dn)
7 {
8 tabs::tabs($config, $data, $dn,"groups");
9 $this->addSpecialTabs();
10 }
12 function save_object($save_current= FALSE)
13 {
14 tabs::save_object($save_current);
16 /* Update reference, transfer variables */
17 $baseobject= $this->by_object['group'];
18 foreach ($this->by_object as $name => $obj){
19 /* Don't touch base object */
20 if ($name != 'group'){
21 $obj->parent= &$this;
22 $obj->cn= $baseobject->cn;
23 $this->by_object[$name]= $obj;
24 }
25 }
26 }
28 function delete()
29 {
30 /* Put baseobjects 'cn' to mailobjects 'uid' */
31 $baseobject= $this->by_object['group'];
32 if (isset($this->by_object['mailgroup'])){
33 $this->by_object['mailgroup']->uid= $baseobject->cn;
34 }
35 tabs::delete();
36 }
38 function save($ignore_account= FALSE)
39 {
40 $baseobject= $this->by_object['group'];
42 /* Check for new 'dn', in order to propagate the
43 'dn' to all plugins */
44 $new_dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
46 /* Put baseobjects 'cn' to mailobjects 'uid' */
47 if (isset($this->by_object['mailgroup'])){
48 $this->by_object['mailgroup']->uid= $baseobject->cn;
49 }
52 /* Update reference, transfer variables */
53 foreach ($this->by_object as $name => $obj){
54 /* Transfer attributes for mailgroup account */
55 if ($name == 'mailgroup'){
56 $this->by_object['mailgroup']->members= $baseobject->memberUid;;
57 }
58 }
60 /* Move group? */
61 if ($this->dn != $new_dn){
63 /* Write entry on new 'dn' */
64 if ($this->dn != "new"){
65 $baseobject->update_acls($this->dn,$new_dn);
66 $baseobject->move($this->dn, $new_dn);
67 $this->by_object['group']= $baseobject;
68 }
70 /* Happen to use the new one */
71 $this->dn= $new_dn;
72 }
74 $ret= tabs::save();
76 return $ret;
77 }
79 function saveCopyDialog()
80 {
81 tabs::saveCopyDialog();
83 /* Update reference, transfer variables */
84 $baseobject= $this->by_object['group'];
85 foreach ($this->by_object as $name => $obj){
86 /* Don't touch base object */
87 if ($name != 'group'){
88 $obj->parent= &$this;
89 $obj->cn= $baseobject->cn;
90 $this->by_object[$name]= $obj;
91 }
92 }
93 }
95 }
97 ?>