Code

Added MyAccount stuff.
[gosa.git] / gosa-core / plugins / personal / myaccount / MyAccountTabs.inc
1 <?php
2 /*
3  * This code is part of GOsa (http://www.gosa-project.org)
4  * Copyright (C) 2003-2008 GONICUS GmbH
5  *
6  * ID: $$Id: tabs_user.inc 14136 2009-08-26 08:02:49Z hickert $$
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
23 class MyAccountTabs extends tabs
24 {
25 # var $base;
26 #
27 # /* Template adaption variables
28 #  */
29 # var $uid  ="";
30 # var $givenName = "";
31 # var $sn;
32 #
33 # function usertabs($config, $data, $dn, $cat = "", $hide_refs = FALSE, $hide_acls = FALSE)
34 # {
35 #   tabs::tabs($config, $data, $dn, 'users',$hide_refs, $hide_acls);
36 #   $this->base= $this->by_object['user']->base;
37 #
38 #   $this->uid = &$this->by_object['user']->uid;
39 #   $this->sn = &$this->by_object['user']->sn;
40 #   $this->givenName = &$this->by_object['user']->givenName;
41 #
42 #   /* Add references/acls/snapshots */
43 #   $this->addSpecialTabs();
44 #
45 # }
46 #
47 # function save_object($save_current= FALSE)
48 # {
49 #   tabs::save_object($save_current);
50 #
51 #   /* Update reference, transfer variables */
52 #   $baseobject= $this->by_object['user'];
53 #   foreach ($this->by_object as $name => $obj){
54 #
55 #     /* Adding uid to sub plugins of connectivity */
56 #     if($name == "connectivity"){
57 #       foreach ($obj->plugin_name as $plg_name){
58 #         if(isset($obj->plugin[$plg_name]->uid)){
59 #           $obj->plugin[$plg_name]->uid = $baseobject->uid;
60 #         }
61 #       }
62 #     }
63 #
64 #     /* Don't touch base object */
65 #     if ($name != 'user'){
66 #       $obj->parent= &$this;
67 #       $obj->uid= $baseobject->uid;
68 #       $obj->sn= $baseobject->uid;
69 #       $obj->givenName= $baseobject->uid;
70 #     }
71 #
72 #     /* Copy mail if needed */
73 #     if ($name == "gofaxAccount"){
74 #       if (isset($this->by_object['mailAccount']) && $this->by_object['mailAccount']->is_account){
75 #         $obj->mail= $this->by_object['mailAccount']->mail;
76 #       }
77 #     }
78 #
79 #     $this->by_object[$name]= $obj;
80 #
81 #     /* Update parent in base object */
82 #     $this->by_object['user']->parent= &$this;
83 #   }
84 #
85 #   /* Move facsimile / phone number if nessecary */
86 #   if ($this->last == "user" && isset($this->by_object['gofaxAccount'])){
87 #
88 #     /* Move number to fax plugin */
89 #     $this->by_object['gofaxAccount']->facsimileTelephoneNumber=
90 #       $this->by_object['user']->facsimileTelephoneNumber;
91 #
92 #     /* Move phone number if plugin exists */
93 #     if (isset($this->by_object['phoneAccount']) && 
94 #         !$this->by_object['phoneAccount']->is_account){
95 #       $this->by_object['phoneAccount']->phoneNumbers= array();
96 #       if ($this->by_object['user']->telephoneNumber != ""){
97 #         $this->by_object['phoneAccount']->phoneNumbers[$this->by_object['user']->telephoneNumber]= $this->by_object['user']->telephoneNumber;
98 #       }
99 #     }
100 #   }
102 #   /* Move number from fax plugin */
103 #   if ($this->last == "gofaxAccount"){
105 #     $this->by_object['user']->facsimileTelephoneNumber=
106 #       $this->by_object['gofaxAccount']->facsimileTelephoneNumber;
107 #   }
109 #   /* Move number from fax plugin */
110 #   if ($this->last == "phoneAccount" && $this->by_object['phoneAccount']->is_account){
111 #     reset($this->by_object['phoneAccount']->phoneNumbers);
112 #     $number= key($this->by_object['phoneAccount']->phoneNumbers);
114 #     /* Only the first phoneAccount number, if it is not empty */
115 #     if(!empty($number)){
116 #       $this->by_object['user']->telephoneNumber= $number;
117 #     }
118 #   }
120 #   /* Possibly change acl base */
121 #   $this->set_acl_base();
122 # }
124 # function save($ignore_account= FALSE)
125 # {
126 #   /* Check for new 'dn', in order to propagate the
127 #      'dn' to all plugins */
128 #   $baseobject= $this->by_object['user'];
129 #   $baseobject->update_new_dn();
130 #   if ($this->dn != 'new'){
132 #     $new_dn= $baseobject->new_dn;
134 #     if ($this->dn != $new_dn){
136 #       /* Udpate acls */
137 #       $baseobject->update_acls($this->dn,$new_dn);
138 #       $baseobject->move($this->dn, $new_dn);
139 #       $this->by_object['user']= $baseobject;
141 #       /* Did we change ourselves? Update ui object. */
142 #       change_ui_dn($this->dn, $new_dn);
143 #     }
144 #   }
146 #   $this->dn= $baseobject->new_dn;
148 #   return tabs::save();
149 # }
152 # function set_template_mode()
153 # {
154 #   foreach ($this->by_object as $key => $obj){
155 #     $this->by_object[$key]->is_template= TRUE;
156 #   }
157 # }
158
159 # function saveCopyDialog()
160 # {
161 #   tabs::saveCopyDialog();
162 #   $baseobject= $this->by_object['user'];
163 #   $uid = $baseobject->uid;
164 #   foreach($this->by_object as  $name => $obj){
165 #     $this->by_object[$name]->uid = $uid;
166 #   }
167 # }
171 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
172 ?>