Code

Updated Workstation acls
[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     /* Save dn */
9     $this->dn= $dn;
10     $this->config= $config;
12     foreach ($data as $tab){
13       if($tab['CLASS'] == "printgeneric"){
14         $this->by_name[$tab['CLASS']]= $tab['NAME'];
15         $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn,$this);
16         $this->by_object[$tab['CLASS']]->parent= &$this;
17         $this->by_object[$tab['CLASS']]->set_acl_category($category);
18       }else{
19         $this->by_name[$tab['CLASS']]= $tab['NAME'];
20         $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
21         $this->by_object[$tab['CLASS']]->parent= &$this;
22         $this->by_object[$tab['CLASS']]->set_acl_category($category);
23       }
24       /* Initialize current */
25       if ($this->current == ""){
26         $this->current= $tab['CLASS'];
27       }
28     }
30     /* Add references/acls/snapshots */
31     $this->addSpecialTabs();
32   }
34   function save_object($save_current= FALSE)
35   {
36     tabs::save_object($save_current);
37   }
40   function save()
41   {
42     /* Check for new 'dn', in order to propagate the
43        'dn' to all plugins */
44     $baseobject= $this->by_object['workgeneric'];
45     $this->dn= "cn=".$baseobject->cn.",ou=workstations,ou=systems,".$baseobject->base;
46     $baseobject->dn= $this->dn;
48     foreach ($this->by_object as $key => $obj){
49       $this->by_object[$key]->dn= $this->dn;
50       $this->by_object[$key]->cn= $baseobject->cn;
51     }
53     tabs::save(TRUE);
55     if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
56       $this->by_object['printgeneric']->remove_from_parent();
57     }
59     /* Fix tagging if needed */
60     $baseobject->handle_object_tagging();
61   }
63 }
65 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
66 ?>