diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc
index 9ca7308e34863955aed51446c334754ebfe97cc1..488e882f66c4aebc76d4957a47c35573cebcac3c 100644 (file)
display the snapshot paste icon. BUT check the correct acls in the management plugin */
$all_module_acls = "";
foreach($this->module as $module){
display the snapshot paste icon. BUT check the correct acls in the management plugin */
$all_module_acls = "";
foreach($this->module as $module){
- $all_module_acls .= $ui->has_complete_category_acls($this->selectedBase,$module)." | ".$module."<br>";
+ $all_module_acls .= $ui->has_complete_category_acls($this->selectedBase,$module);
}
}
- $listhead = "<div style='background:#F0F0F9;padding:5px;'>".
- " <input class='center' type='image' src='images/list_root.png' align='middle'
- title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'> ".
- " <input class='center' type='image' align='middle' src='images/list_back.png'
- title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'> ".
- " <input class='center' type='image' align='middle' src='images/list_home.png'
- title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'> ".
- " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='". _("Submit")."'> ".
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ /* Must we add an additional seperator */
+ $add_sep = false;
+
+ /* Add default header */
+ $listhead = MultiSelectWindow::get_default_header();
+ /* Add snapshot icons */
if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
$listhead .= $this->get_snapshot_header($this->selectedBase);
+ $add_sep = true;
}
}
-
+ /* Handle create icons */
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_terminal.png'
name='newsystem_terminal' alt='"._("New Terminal template")."' title='"._("New Terminal")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_terminal.png'
name='newsystem_terminal' alt='"._("New Terminal template")."' title='"._("New Terminal")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_workstation.png'
name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"server/servgeneric"))){
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_workstation.png'
name='newsystem_workstation' alt='"._("New Workstation template")."' title='"._("New Workstation")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"server/servgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_server.png'
name='newsystem_server' alt='"._("New Server")."' title='"._("New Server")."'> ";
}
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_server.png'
name='newsystem_server' alt='"._("New Server")."' title='"._("New Server")."'> ";
}
- if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgenric"))){
+ if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_printer.png'
name='newsystem_printer' alt='"._("New Printer")."' title='"._("New Printer")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_printer.png'
name='newsystem_printer' alt='"._("New Printer")."' title='"._("New Printer")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_phone.png'
name='newsystem_phone' alt='"._("New Phone")."' title='"._("New Phone")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_phone.png'
name='newsystem_phone' alt='"._("New Phone")."' title='"._("New Phone")."'> ";
}
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
+ $add_sep = true;
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_component.png'
name='newsystem_component' alt='"._("New Component")."' title='"._("New Component")."'> ";
}
$listhead .= "<input class='center' type='image' align='middle' src='images/select_new_component.png'
name='newsystem_component' alt='"._("New Component")."' title='"._("New Component")."'> ";
}
- $listhead .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> "._("Base")." ".
- " <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+ /* Should we add a seperator ? */
+ if($add_sep){
+ $listhead .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
+ }
+
+ /* Add base selection */
+ $listhead .= _("Base")." <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ".
"</div>";
" <input class='center' type='image' src='images/list_submit.png' align='middle'
title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ".
"</div>";
$img9 = "<img class='center' src='images/fax_small.png' alt='F' title='"._("Fax Server") ."'>";
$img10 = "<img class='center' src='images/save.png' alt='L' title='"._("Ldap Server") ."'>";
$img9 = "<img class='center' src='images/fax_small.png' alt='F' title='"._("Fax Server") ."'>";
$img10 = "<img class='center' src='images/save.png' alt='L' title='"._("Ldap Server") ."'>";
- $empty =" ";
+ $empty ="<img src='images/empty.png' style='width:16px ; height: 16px;' class='center'>";
/* Dynamic action col, depending on snapshot icons */
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 50;
+ $action_col_size = 70;
if($this->parent->snapshotEnabled()){
$action_col_size += 38;
}
if($this->parent->snapshotEnabled()){
$action_col_size += 38;
}
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=edit_entry'>%s</a>";
/* ACL mapping */
$editlink = "<a href='?plug=".$_GET['plug']."&id=%s&act=edit_entry'>%s</a>";
/* ACL mapping */
- $acl_type = array("server" => "ser");
$ui = get_userinfo();
$ui = get_userinfo();
+ $tabs = array(
+ "terminal" => array("CLASS"=>"TERMTABS", "TABCLASS" =>"termtabs", "ACL"=> "terminal/termgeneric"),
+ "workstation" => array("CLASS"=>"WORKTABS", "TABCLASS" =>"worktabs", "ACL"=> "workstation/workgeneric"),
+ "server" => array("CLASS"=>"SERVTABS", "TABCLASS" =>"servtabs", "ACL"=> "server/servgeneric"),
+ "printer" => array("CLASS"=>"PRINTTABS", "TABCLASS" =>"printtabs", "ACL"=> "printer/printgeneric"),
+ "phone" => array("CLASS"=>"PHONETABS", "TABCLASS" =>"phonetabs", "ACL"=> "phone/phoneGeneric"),
+ "winstation" => array("CLASS"=>"WINTABS", "TABCLASS" =>"wintabs", "ACL"=> "winworkstation/wingeneric"),
+ "component" => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs", "ACL"=> "component/componentGeneric"));
+
// Test Every Entry and generate divlist Array
foreach($terminals as $key => $val){
// Test Every Entry and generate divlist Array
foreach($terminals as $key => $val){
+ /* Get system type, it is used to fetch the acls for the current object.
+ "winstation" acls are stored as 2winworkstation", so we have to map this here */
$type = $this->parent->get_system_type($val['objectClass']);
$type = $this->parent->get_system_type($val['objectClass']);
- $acl_all = $ui->has_complete_category_acls($val['dn'],$type) ;
+ if($type == "winstation") {
+ $acl_type = "winworkstation";
+ }else{
+ $acl_type = $type;
+ }
+
+ /* Get complete category acls */
+ $acl_all = $ui->has_complete_category_acls($val['dn'],$acl_type) ;
+
+ /* Get specific generic acls */
+ $acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL']);
$action= "<input class='center' type='image' src='images/edit.png'
$action= "<input class='center' type='image' src='images/edit.png'
- alt='"._("edit")."' name='user_edit_%KEY%' title='"._("Edit system")."'>";
+ alt='"._("edit")."' name='system_edit_%KEY%' title='"._("Edit system")."'>";
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$action.= $this->GetSnapShotActions($val['dn']);
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$action.= $this->GetSnapShotActions($val['dn']);
+ }else{
+ $action.= $empty." ".$empty." ";
+ }
+
+ if(preg_match("/d/",$acl)){
+ $action.= "<input class='center' type='image' src='images/edittrash.png'
+ alt='"._("delete")."' name='system_del_%KEY%' title='"._("Delete system")."'>";
+ }else{
+ $action.= $empty;
}
}
- $action.= "<input class='center' type='image' src='images/edittrash.png'
- alt='"._("delete")."' name='user_del_%KEY%' title='"._("Delete system")."'>";
/* Generate picture list, which is currently disabled */
if(in_array("goCupsServer" ,$val['objectClass'])) $cups = $img1; else $cups =$empty;
/* Generate picture list, which is currently disabled */
if(in_array("goCupsServer" ,$val['objectClass'])) $cups = $img1; else $cups =$empty;
$pwd_acl = $ui->get_permissions($val['dn'],"terminal/termgeneric","gotoRootPasswd");
}
if(preg_match("/w/",$pwd_acl)){
$pwd_acl = $ui->get_permissions($val['dn'],"terminal/termgeneric","gotoRootPasswd");
}
if(preg_match("/w/",$pwd_acl)){
- $action2 = "<input class='center' type='image' src='images/certs.png' alt='"._("Password")."' name='user_setpwd_%KEY%' title='"._("Set root password")."'>";
+ $action2 = "<input class='center' type='image' src='images/certs.png' alt='"._("Password")."' name='system_setpwd_%KEY%' title='"._("Set root password")."'>";
}else{
}else{
- $action2 = "";
+ $action2 = $empty;
}
if(in_array("gotoWorkstation",$val['objectClass'])){
$action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'
}
if(in_array("gotoWorkstation",$val['objectClass'])){
$action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'
- name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>".$action2;
+ name='gen_cd_%KEY%' title='"._("Create FAI CD")."'> ".$action2;
+ }else{
+ $action2= $empty.$action2;
}
if(isset($val['message'])){
}
if(isset($val['message'])){