1 <?php
3 class servtabs extends tabs
4 {
6 function servtabs($config, $data, $dn,$category)
7 {
8 /* Save dn */
9 $this->dn= $dn;
10 $this->config= $config;
12 $baseobject= NULL;
14 foreach ($data as $tab){
15 $this->by_name[$tab['CLASS']]= $tab['NAME'];
17 if ($baseobject === NULL){
18 $baseobject= new $tab['CLASS']($this->config, $this->dn,NULL,$this);
19 $this->by_object[$tab['CLASS']]= $baseobject;
20 } else {
21 $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject,$this);
22 }
24 $this->by_object[$tab['CLASS']]->parent= &$this;
25 $this->by_object[$tab['CLASS']]->set_acl_category($category);
27 /* Initialize current */
28 if ($this->current == ""){
29 $this->current= $tab['CLASS'];
30 }
31 }
33 /* Add references/acls/snapshots */
34 $this->addSpecialTabs();
35 }
37 function save_object($save_current= FALSE)
38 {
39 tabs::save_object($save_current);
40 }
43 function save($ignore_account= FALSE)
44 {
45 /* Check for new 'dn', in order to propagate the
46 'dn' to all plugins */
47 $baseobject= $this->by_object['servgeneric'];
48 $this->dn= "cn=$baseobject->cn,".get_ou('serverou').$baseobject->base;
49 $baseobject->dn= $this->dn;
51 foreach ($this->by_object as $key => $obj){
52 $this->by_object[$key]->dn= $this->dn;
53 $this->by_object[$key]->cn= $baseobject->cn;
54 }
56 tabs::save(FALSE);
58 /* Reload server settings after saving */
59 $config = session::get('config');
60 $config->load_servers();
61 session::set('config',$config);
62 }
64 }
66 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
67 ?>