d970ec9ce0b5295909645287e950a8ede665978b
1 <?php
3 class grouptabs extends tabs
4 {
6 function grouptabs($config, $data, $dn)
7 {
8 tabs::tabs($config, $data, $dn);
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 }
15 }
17 function save_object($save_current= FALSE)
18 {
19 tabs::save_object($save_current);
21 /* Update reference, transfer variables */
22 $baseobject= $this->by_object['group'];
23 foreach ($this->by_object as $name => $obj){
24 /* Don't touch base object */
25 if ($name != 'group'){
26 $obj->parent= &$this;
27 $obj->cn= $baseobject->cn;
28 $this->by_object[$name]= $obj;
29 }
30 }
31 }
33 function save()
34 {
35 $baseobject= $this->by_object['group'];
37 /* Check for new 'dn', in order to propagate the
38 'dn' to all plugins */
39 $new_dn= 'cn='.$baseobject->cn.','.get_groups_ou().$baseobject->base;
41 /* Put baseobjects 'cn' to mailobjects 'uid' */
42 if (isset($this->by_object['mailgroup'])){
43 $this->by_object['mailgroup']->uid= $baseobject->cn;
44 }
47 /* Update reference, transfer variables */
48 foreach ($this->by_object as $name => $obj){
49 /* Transfer attributes for mailgroup account */
50 if ($name == 'mailgroup'){
51 $this->by_object['mailgroup']->members= $baseobject->memberUid;;
52 }
53 }
55 /* Move group? */
56 if ($this->dn != $new_dn){
58 /* Write entry on new 'dn' */
59 if ($this->dn != "new"){
60 $baseobject->move($this->dn, $new_dn);
61 $this->by_object['group']= $baseobject;
62 }
64 /* Happen to use the new one */
65 $this->dn= $new_dn;
66 }
68 return tabs::save();
69 }
71 function saveCopyDialog()
72 {
73 tabs::saveCopyDialog();
75 /* Update reference, transfer variables */
76 $baseobject= $this->by_object['group'];
77 foreach ($this->by_object as $name => $obj){
78 /* Don't touch base object */
79 if ($name != 'group'){
80 $obj->parent= &$this;
81 $obj->cn= $baseobject->cn;
82 $this->by_object[$name]= $obj;
83 }
84 }
85 }
87 }
89 ?>