X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_systemManagement.inc;h=7f7265767d0893e8d8217843fcebc8057dbb38d7;hb=3644520502707cc1a35a915bfa358105e86c4818;hp=12aba77da5f92cc65ec0ad1e031f01049c15a3f0;hpb=c299277a959d4d4c30729c00b8f0cf7bae77158d;p=gosa.git diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 12aba77da..7f7265767 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -65,6 +65,9 @@ class systems extends plugin function execute() { + /* Call parent execute */ + plugin::execute(); + /* Save data */ $terminalfilter= get_global("terminalfilter"); foreach( array("depselect", "user", "regex") as $type){ @@ -199,6 +202,7 @@ class systems extends plugin $this->systab->set_acl ($this->acl); $this->systab->by_object['termgeneric']->cn= "default"; $this->systab->by_object['termservice']->cn= "default"; + $this->systab->by_object['termgeneric']->base = $_SESSION['terminalfilter']['depselect']; break; case 'workstation': @@ -206,35 +210,43 @@ class systems extends plugin $this->config->data['TABS']['WORKTABS'], $this->dn); $this->systab->set_acl ($this->acl); $this->systab->by_object['workgeneric']->cn= "wdefault"; - $this->systab->by_object['termservice']->cn= "default"; + $this->systab->by_object['workservice']->cn= "default"; + $this->systab->by_object['workgeneric']->base = $_SESSION['terminalfilter']['depselect']; break; case 'server': $this->systab= new servtabs($this->config, $this->config->data['TABS']['SERVTABS'], $this->dn); $this->systab->set_acl ($this->acl); + $this->systab->by_object['servgeneric']->base = $_SESSION['terminalfilter']['depselect']; break; case 'printer': $this->systab= new printtabs($this->config, $this->config->data['TABS']['PRINTTABS'], $this->dn); $this->systab->set_acl ($this->acl); + $this->systab->by_object['printgeneric']->base = $_SESSION['terminalfilter']['depselect']; break; case 'phone': $this->systab= new phonetabs($this->config, $this->config->data['TABS']['PHONETABS'], $this->dn); $this->systab->set_acl ($this->acl); + $this->systab->by_object['phonegeneric']->base = $_SESSION['terminalfilter']['depselect']; break; case 'component': $this->systab= new componenttabs($this->config, $this->config->data['TABS']['COMPONENTTABS'], $this->dn); $this->systab->set_acl ($this->acl); + $this->systab->by_object['componentgeneric']->base = $_SESSION['terminalfilter']['depselect']; break; } + + $this->systab->base = $_SESSION['terminalfilter']['depselect']; } + /* User wants to edit data? */ if ($s_action == "edit"){ @@ -450,7 +462,8 @@ class systems extends plugin $this->systab= new $tabtype($this->config, $this->config->data['TABS']['TERMTABS'], $this->dn); $this->systab->set_acl(array($this->acl)); - $this->systab->by_object['termgeneric']->remove_from_parent (); + $this->systab->delete(); + #$this->systab->by_object['termgeneric']->remove_from_parent (); } unset ($this->systab); gosa_log ("System object'".$this->dn."' has been removed"); @@ -524,9 +537,9 @@ class systems extends plugin /* Don't show buttons if tab dialog requests this */ if (!$this->systab->by_object[$this->systab->current]->dialog){ $display.= "

\n"; - $display.= "\n"; + $display.= "\n"; $display.= " \n"; - $display.= "\n"; + $display.= "\n"; $display.= "

"; } return ($display); @@ -541,7 +554,7 @@ class systems extends plugin $options= ""; foreach ($this->config->idepartments as $key => $value){ if ($terminalfilter['depselect'] == $key){ - $options.= ""; + $options.= ""; } else { $options.= ""; } @@ -550,36 +563,32 @@ class systems extends plugin /* NEW LIST MANAGMENT */ $listhead = "
". - "  ". - "  ". - "  ". - "  ". - " ". - " ". - " ". - " ". - " ". - " ". - "  ". - _("Current base")." ". - "  ". + "  ". + "  ". + "  ". + "  ". + " ". + " ". + " ". + " ". + " ". + " ". + "  ". + _("Current base")." ". + "  ". "
"; - - - $action= ""; - $action.= ""; - + $action= ""; + $action.= ""; $divlist = new divlist("systemstab"); $divlist->SetHeader(array( - array("string" => " "), - array("string" => _("System")." / "._("Department")), - array("string" => _("Actions"), "attach" => "style='border:none'" ))); - + array("string" => " ", "attach" => "style='text-align:center;width:20px;'"), + array("string" => _("System")." / "._("Department"), "attach" => "style=''"), + array("string" => _("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'" ))); $divlist->SetSummary(_("This table displays all systems, in the selected tree.")); - $divlist->SetEntriesPerPage(20); + $divlist->SetEntriesPerPage(0); // Defining Links $linkopen = "%s"; @@ -598,9 +607,9 @@ class systems extends plugin } } - $field1 = array("string" => "department"); - $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val)); - $field3 = array("string" => " ", "attach" => "style='border:none'"); + $field1 = array("string" => "department", "attach" => "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style=''"); + $field3 = array("string" => " ", "attach" => "style='width:60px;border-right:0px;text-align:right;'"); $divlist->AddEntry(array($field1,$field2,$field3)); } @@ -611,16 +620,16 @@ class systems extends plugin $editlink = "%s"; // Pictures for Extensions - $img1 = "C"; - $img2 = "L"; - $img3 = "L"; - $img4 = "M"; - $img5 = "I"; - $img6 = "F"; - $img7 = "K"; - $img8 = "A"; - $img9 = "F"; - $img10 = "L"; + $img1 = "C"; + $img2 = "L"; + $img3 = "L"; + $img4 = "M"; + $img5 = "I"; + $img6 = "F"; + $img7 = "K"; + $img8 = "A"; + $img9 = "F"; + $img10 = "L"; // Test Every Entry and generate divlist Array foreach($this->terminals as $key => $val){ @@ -638,6 +647,9 @@ class systems extends plugin $pics = $cups.$logdb.$syslog.$imap.$samba.$nfs.$krb.$fon.$fax.$ldap; $pics = ""; + + $val['cn'][0]= preg_replace('/\$$/', '', $val['cn'][0]); + // Generate Array to Add if((isset($val['is_new']))&&(!empty($val['is_new']))){ $display= "".$val["cn"][0]." ".$val['is_new']; @@ -646,7 +658,7 @@ class systems extends plugin } if((in_array("gotoTerminal",$val['objectClass']))||(in_array("gotoWorkstation",$val['objectClass']))){ - $action2 = ""; + $action2 = ""; }else{ $action2 = ""; } @@ -657,9 +669,9 @@ class systems extends plugin $img=$this->convert_list($val); - $field1 = array("string" => sprintf($img['img'],$val['dn']),"attach"=>"style='width:20px;align:middle;'"); - $field2 = array("string" => sprintf($editlink,$key,$display),"attach"=>"title='".$val['dn']."'"); - $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action),"attach" => "style='border:none; text-align:right;width:48px'"); + $field1 = array("string" => sprintf($img['img'],$val['dn']), "attach" => "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($editlink,$key,$display), "attach" => "style='' title='".$val['dn']."'"); + $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action), "attach" => "style='width:60px;border-right:0px;text-align:right;'"); $divlist->AddEntry( array($field1,$field2,$field3)); } @@ -707,7 +719,7 @@ class systems extends plugin } foreach ($conv as $key => $value){ if($input['type']==$key){ - $tmp['img'] ="".$key.""; + $tmp['img'] ="".$key.""; $tmp['class']=$key; return $tmp; } @@ -863,7 +875,15 @@ class systems extends plugin * We also need to search for the departments * So we are able to navigate like in konquerer */ - $base2 = preg_replace("/ou=people,/i","",$base); + + $peopleOU = get_people_ou(); + + if(empty($peopleOU)){ + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleOU."/i","",$base); + } + $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); @@ -875,10 +895,10 @@ class systems extends plugin } ksort($tmp); foreach($tmp as $value){ - if($value["description"][0]!=".."){ + if(isset($value["description"][0])){ $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]"; }else{ - $this->departments[$value['dn']]=$value["description"][0]; + $this->departments[$value['dn']]=convert_department_dn2($value['dn']);//$value["description"][0]; } } @@ -969,11 +989,11 @@ class systems extends plugin } else { $domain= ""; } - $terminal=$value; - $terminal['type'] ="W"; - $terminal['domain'] = $name.$domain; + $terminal=$value; + $terminal['type'] ="W"; + $terminal['domain'] = $name.$domain; } - $this->terminals[]=$terminal; + $this->terminals[]=$terminal; } }