summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf664a5)
raw | patch | inline | side by side (parent: cf664a5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Oct 2006 09:13:18 +0000 (09:13 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 2 Oct 2006 09:13:18 +0000 (09:13 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4843 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_divListFai.inc | patch | blob | history | |
plugins/admin/fai/class_faiManagement.inc | patch | blob | history |
index 58cd27a8ee39639287d2c65264df8510381be70b..9dea993f8e0a207b37a2d8bd35c7b0a19c383ec7 100644 (file)
function GenHeader()
{
+ $ui = get_userinfo();
/* Prepare departments,
which are shown in the listbox on top of the listbox
*/
" <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\" alt=\"\" align=\"middle\" height=\"16\" width=\"1\"> ".
-
- " <input class='center' type='image' src='images/fai_new_profile.png' align='middle'
- title='"._("New profile")."' name='Create_profile' alt='"._("P")."'> ".
-
"<img class='center' src=\"images/list_seperator.png\" alt=\"\" align=\"middle\" height=\"16\" width=\"1\"> ";
- $listhead .= $this->get_snapshot_header($this->selectedBase);
- $listhead .= " <input class='center' type='image' src='images/fai_new_partitionTable.png' align='middle'
- title='"._("New partition table")."' name='Create_partition' alt='"._("PT")."'> ".
- " <input class='center' type='image' src='images/fai_new_script.png' align='middle'
- title='"._("New scripts")."' name='Create_script' alt='"._("S")."'> ".
+ $acl = $ui->get_permissions($this->selectedBase,"fai/faiProfile");
+ if(preg_match("/c/",$acl)){
+ $listhead .=" <input class='center' type='image' src='images/fai_new_profile.png' align='middle'
+ title='"._("New profile")."' name='Create_profile' alt='"._("P")."'> ";
+ }
- " <input class='center' type='image' src='images/fai_new_hook.png' align='middle'
- title='"._("New hooks")."' name='Create_hook' alt='"._("H")."'> ".
+ $listhead .= "<img class='center' src=\"images/list_seperator.png\" alt=\"\" align=\"middle\" height=\"16\" width=\"1\"> ";
+ $listhead .= $this->get_snapshot_header($this->selectedBase);
- " <input class='center' type='image' src='images/fai_new_variable.png' align='middle'
- title='"._("New variables")."' name='Create_variable' alt='"._("V")."'> ".
- " <input class='center' type='image' src='images/fai_new_template.png' align='middle'
- title='"._("New templates")."' name='Create_template' alt='"._("T")."'> ".
+ $arr = array(
+ array("images/fai_new_partitionTable.png" , _("New partition table") ,"Create_partition" , _("PT") , "faiPartitionTable"),
+ array("images/fai_new_script.png" , _("New scripts") ,"Create_script" , _("S") , "faiScript"),
+ array("images/fai_new_hook.png" , _("New hooks") ,"Create_hook" , _("H") , "faiHook"),
+ array("images/fai_new_variable.png" , _("New variables") ,"Create_variable" , _("V") , "faiVariable"),
+ array("images/fai_new_template.png" , _("New templates ") ,"Create_template" , _("I") , "faiTemplate"),
+ array("images/fai_new_packages.png" , _("New package list") ,"Create_package" , _("PK") , "faiPackage"));
- " <input class='center' type='image' src='images/fai_new_packages.png' align='middle'
- title='"._("New package list")."' name='Create_package' alt='"._("PK")."'> ".
+ foreach($arr as $ar){
- " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ".
+ $acl = $ui->get_permissions($this->selectedBase,"fai/".$ar[4]);
+ if(preg_match("/c/",$acl)){
+ $listhead .=" <input class='center' type='image' src='".$ar[0]."' align='middle' title='".$ar[1]."' name='".$ar[2]."' alt='".$ar[3]."'> ";
+ }
+ }
+ $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>".
" <input class='center' type='image' src='images/list_submit.png' align='middle' title='"._("Submit department")."' name='submit_department' alt='". _("Submit")."'> ".
$desc= "";
}
+
if($value['FAIstate'] == "freeze"){
- $action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
+ $action= "<img src='images/closedlock.png' alt='F' class='center'><img src='images/empty.png' width='38' height='2' class='center' alt=''>";
+ $action.= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
name='entry_edit_%KEY%' title='"._("Edit class")."'>";
- $edi = $editlink;
- $acti = $action;
}else{
$action= "<input class='center' type='image' src='images/edit.png' alt='"._("edit")."'
name='entry_edit_%KEY%' title='"._("Edit class")."'>";
- $action.= $this->GetSnapShotActions($value['dn']);;
- $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
- name='entry_delete_%KEY%' title='"._("Delete class")."'>";
- $acti = $action;
- $edi = $editlink;
+
+ if(preg_match("/(c&w)/",$value['acl'])){
+ $action.= $this->GetSnapShotActions($value['dn']);;
+ }
+
+ if(preg_match("/d/",$value['acl'])){
+ $action.= "<input class='center' type='image' src='images/edittrash.png' alt='"._("delete")."'
+ name='entry_delete_%KEY%' title='"._("Delete class")."'>";
+ }
}
+ $edi = $editlink;
+ $acti = $action;
+
$field1 = array("string" => $img , "attach" => "style='text-align:center;width:20px;'");
$field2 = array("string" => preg_replace(array("/%KEY%/","/%NAME%/","/%TITLE%/"),array($key,$value['cn'].$desc,preg_replace('/ /', ' ', @LDAP::fix($value['dn']))),$edi) , "attach" => "style=''");
$field3 = array("string" => $info, "attach" => "style='width:200px;'");
index 1bcc95816fea23ddbbd01a7cca4dc65bc5dfd0c3..098cde7ab05a8abef1ecd08b669d392d13aa4479 100644 (file)
$this->lock_type = get_release_tag(get_release_dn($base));
- /* Get resolved release dependencies */
- $tmp = get_all_objects_for_given_base($base,"(&(|(objectClass=FAIpartitionTable)(objectClass=FAIpackageList)(objectClass=FAIscript)
- (objectClass=FAIvariable)(objectClass=FAIhook)(objectClass=FAIprofile)(objectClass=FAItemplate))(cn=$Regex))");
-
/* Create a new list of FAI object
* Generate List of Partitions,Hooks,Scripts,Templates,Profiles ...
*/
$ObjectTypes = array(
- "FAIpartitionTable" => array("OU"=>"ou=disk," , "CHKBOX"=>"ShowPartitions"),
- "FAIpackageList" => array("OU"=>"ou=packages," , "CHKBOX"=>"ShowPackages"),
- "FAIscript" => array("OU"=>"ou=scripts," , "CHKBOX"=>"ShowScripts"),
- "FAIvariable" => array("OU"=>"ou=variables," , "CHKBOX"=>"ShowVariables"),
- "FAIhook" => array("OU"=>"ou=hooks," , "CHKBOX"=>"ShowHooks"),
- "FAIprofile" => array("OU"=>"ou=profiles," , "CHKBOX"=>"ShowProfiles"),
- "FAItemplate" => array("OU"=>"ou=templates," , "CHKBOX"=>"ShowTemplates"));
+ "FAIpartitionTable" => array("OU"=>"ou=disk," , "CHKBOX"=>"ShowPartitions" ,"ACL" => "faiPartitionTable"),
+ "FAIpackageList" => array("OU"=>"ou=packages," , "CHKBOX"=>"ShowPackages" ,"ACL" => "faiPackage"),
+ "FAIscript" => array("OU"=>"ou=scripts," , "CHKBOX"=>"ShowScripts" ,"ACL" => "faiScript"),
+ "FAIvariable" => array("OU"=>"ou=variables," , "CHKBOX"=>"ShowVariables" ,"ACL" => "faiVariable"),
+ "FAIhook" => array("OU"=>"ou=hooks," , "CHKBOX"=>"ShowHooks" ,"ACL" => "faiHook"),
+ "FAIprofile" => array("OU"=>"ou=profiles," , "CHKBOX"=>"ShowProfiles" ,"ACL" => "faiProfile"),
+ "FAItemplate" => array("OU"=>"ou=templates," , "CHKBOX"=>"ShowTemplates" ,"ACL" => "faiTemplate"));
+
+ $filter = "";
+ foreach($ObjectTypes as $key => $data){
+ if($this->DivListFai->$data['CHKBOX']){
+ $filter.= "(objectClass=".$key.")";
+ }
+ }
+ $filter = "(&(|".$filter.")(cn=$Regex))";
+
+ /* Get resolved release dependencies */
+ $tmp = get_all_objects_for_given_base($base,$filter);
/* Ge listed ldap objects */
$ldap = $this->config->get_ldap_link();
/* Walk through possible types */
foreach($ObjectTypes as $type => $rest){
- /* Skip all unchecked types */
- if(! $this->DivListFai->$rest['CHKBOX']){
- continue;
- }
+ $acl = $this->ui->get_permissions($object['dn'],"fai/".$rest ['ACL']);
- if(in_array($type,$object['objectClass'])){
+ if(in_array($type,$object['objectClass']) && preg_match("/r/",$acl)){
/* Prepare object */
unset($object['objectClass']['count']);
$obj = array();
$obj['cn'] = $object['cn'][0];
$obj['dn'] = $object['dn'];
+ $obj['acl'] = $acl;
$obj['description'] = $object['description'][0];
$obj['objectClass'] = $object['objectClass'];