Code

Updated serverService : Set acl base/category for services
[gosa.git] / plugins / admin / systems / tabs_workstation.inc
1 <?php
3 class worktabs extends tabs
4 {
6   function worktabs($config, $data, $dn,$category)
7   {
8     
9     /* Save dn */
10     $this->dn= $dn;
11     $this->config= $config;
13     $baseobject= NULL;
15     foreach ($data as $tab){
16       $this->by_name[$tab['CLASS']]= $tab['NAME'];
18       if ($baseobject == NULL){
19         $baseobject= new $tab['CLASS']($this->config, $this->dn,NULL,$this);
20         $this->by_object[$tab['CLASS']]= $baseobject;
21       } else {
22         $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject,$this);
23       }
25       $this->by_object[$tab['CLASS']]->parent= &$this;
26       $this->by_object[$tab['CLASS']]->set_acl_category($category);
28       /* Initialize current */
29       if ($this->current == ""){
30         $this->current= $tab['CLASS'];
31       }
32     }
34     /* Add references/acls/snapshots */
35     $this->addSpecialTabs();
36   }
38   function save_object($save_current= FALSE)
39   {
40     tabs::save_object($save_current);
41   }
44   function save()
45   {
46     /* Check for new 'dn', in order to propagate the
47        'dn' to all plugins */
48     $baseobject= $this->by_object['workgeneric'];
49     $this->dn= "cn=".$baseobject->cn.",ou=workstations,ou=systems,".$baseobject->base;
50     $baseobject->dn= $this->dn;
52     foreach ($this->by_object as $key => $obj){
53       $this->by_object[$key]->dn= $this->dn;
54       $this->by_object[$key]->cn= $baseobject->cn;
55     }
57     tabs::save(TRUE);
59     if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
60       $this->by_object['printgeneric']->remove_from_parent();
61     }
63     /* Fix tagging if needed */
64     $baseobject->handle_object_tagging();
65   }
67 }
69 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
70 ?>