X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_divListSystem.inc;h=34dfaac5cd5c3a36f6f08feca84bf646618fceb7;hb=ecabf2056dc1350d73115d5fa226676be30017d6;hp=7544aceaef882cc5ee5d91f64f64a1b6890a8109;hpb=5e02fcb3213ba79f05405d9bc471ee6b31fab439;p=gosa.git diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 7544aceae..34dfaac5c 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -102,7 +102,6 @@ class divListSystem extends MultiSelectWindow $ui= get_userinfo(); $department = array(); foreach($this->module as $module){ - $d = $ui->get_module_departments($module); foreach($d as $department){ $departments[$department] = $department; @@ -123,6 +122,17 @@ class divListSystem extends MultiSelectWindow } } + /* If there is at least one c (Create) and one w (Write) acl in this combination + 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); + } + + /* Must we add an additional seperator */ + $add_sep = false; + + /* Add the basic icons for navigation */ $listhead = "
". "  ". @@ -132,21 +142,57 @@ class divListSystem extends MultiSelectWindow title='"._("Go to users department")."' alt='"._("Home")."' name='dep_home'> ". "  ". "  "; - $listhead .= $this->get_snapshot_header($this->selectedBase); - $listhead .= " ". - " ". - " ". - " ". - " ". - " ". - "  "._("Base")." ". - " ". + + /* Add snapshot icons */ + 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"))){ + $add_sep = true; + $listhead .= " "; + } + + if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){ + $add_sep = true; + $listhead .= " "; + } + + if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"server/servgeneric"))){ + $add_sep = true; + $listhead .= " "; + } + + if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){ + $add_sep = true; + $listhead .= " "; + } + + if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){ + $add_sep = true; + $listhead .= " "; + } + + if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){ + $add_sep = true; + $listhead .= " "; + } + + /* Should we add a seperator ? */ + if($add_sep){ + $listhead .= " "; + } + + /* Add base selection */ + $listhead .= _("Base")."  ". "  ". "
"; @@ -173,10 +219,10 @@ class divListSystem extends MultiSelectWindow $img9 = "F"; $img10 = "L"; - $empty =" "; + $empty =""; /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 50; + $action_col_size = 70; if($this->parent->snapshotEnabled()){ $action_col_size += 38; } @@ -184,12 +230,50 @@ class divListSystem extends MultiSelectWindow // User and Template Images $editlink = "%s"; + /* ACL mapping */ + $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){ - $action= ""; - $action.= $this->GetSnapShotActions($val['dn']); - $action.= ""; + /* 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']); + 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= ""; + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $action.= $this->GetSnapShotActions($val['dn']); + }else{ + $action.= $empty." ".$empty." "; + } + + if(preg_match("/d/",$acl)){ + $action.= ""; + }else{ + $action.= $empty; + } /* Generate picture list, which is currently disabled */ if(in_array("goCupsServer" ,$val['objectClass'])) $cups = $img1; else $cups =$empty; @@ -219,15 +303,27 @@ class divListSystem extends MultiSelectWindow $display= $val["cn"][0].$dsc; } - if((in_array("gotoTerminal",$val['objectClass']))||(in_array("gotoWorkstation",$val['objectClass']))){ + + /* Check if this is a terminal/workstation && if we are allowed to change the gotoRootPasswd */ + $pwd_acl =""; + if(in_array("gotoWorkstation",$val['objectClass'])){ + $pwd_acl = $ui->get_permissions($val['dn'],"workstation/workgeneric","gotoRootPasswd"); + } + if(in_array("gotoTerminal",$val['objectClass'])){ + $pwd_acl = $ui->get_permissions($val['dn'],"terminal/termgeneric","gotoRootPasswd"); + } + if(preg_match("/w/",$pwd_acl)){ $action2 = ""; }else{ - $action2 = ""; + $action2 = $empty; } + if(in_array("gotoWorkstation",$val['objectClass'])){ $action2= "".$action2; + name='gen_cd_%KEY%' title='"._("Create FAI CD")."'> ".$action2; + }else{ + $action2= $empty.$action2; } if(isset($val['message'])){