From 530712434a6af5c60dd9856f64e08bb1878ed94d Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 29 Aug 2006 07:48:52 +0000 Subject: [PATCH] ACL - Hide options git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4532 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/application.tpl | 29 +++++--- .../admin/groups/class_groupApplication.inc | 70 +++++++++++++------ 2 files changed, 70 insertions(+), 29 deletions(-) diff --git a/plugins/admin/groups/application.tpl b/plugins/admin/groups/application.tpl index 31f015199..ce7099d7c 100644 --- a/plugins/admin/groups/application.tpl +++ b/plugins/admin/groups/application.tpl @@ -9,23 +9,34 @@ {$Release} {/if}

 

-{/if} +{ +/if} +{render acl=$gosaMemberApplicationACL} + +{/render} +
- - {$UsedApps} - - + + + + {$UsedApps} +{render acl=$gosaMemberApplicationACL} + +{/render} +{render acl=$gosaMemberApplicationACL} + +{/render}   - -
+ + + +
{$List} - -
diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index 133717d6c..c01d01df2 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -372,10 +372,8 @@ class appgroup extends plugin plugin::execute(); if((isset($_GET['act']))&&($_GET['act']=="depopen")){ - $dep = base64_decode($_GET['depid']); - if(isset($this->config->idepartments[$dep])){ - $this->curbase =$dep; - } + $dep = base64_decode($_GET['depid']); + $this->curbase =$dep; } if((isset($_GET['act']))&&($_GET['act']=="open")){ @@ -619,7 +617,7 @@ class appgroup extends plugin $departments = array(); $res = get_list("(objectClass=gosaDepartment)", "department", $this->curbase,array("description","cn","ou"),GL_SIZELIMIT); foreach($res as $value){ - $fdn= @LDAP::fix($value['dn']); + $fdn= @LDAP::fix(str_replace($this->curbase,"",$value['dn'])); if($value["description"][0]!=".."){ $departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]"; }else{ @@ -627,8 +625,13 @@ class appgroup extends plugin } } + if($this->acl_is_writeable("gosaMemberApplication")){ + $linkadd = "%s"; + }else{ + $linkadd = "%s"; + } + $linkopen = "%s"; - $linkadd = "%s"; $base_back = preg_replace("/^[^,]+,/","",$this->curbase); if((strlen($base_back)>= strlen($this->config->current['BASE']))&&($this->curbase!=$this->config->current['BASE'])){ @@ -677,13 +680,20 @@ class appgroup extends plugin $div2 = new DivSelectBox("appgroup"); $div2->SetHeight(300); - $linkopen = "\"\" %s"; - $catremove = " "; - $app = "\"\" %s"; - - $catupdown = " - \"\"  - \"\""; + if(!$this->acl_is_writeable("gosaMemberApplication")){ + $linkopen = "\"\" %s"; + $catremove = "  "; + $catupdown = ""; + }else{ + $linkopen = "\"\" %s"; + $catremove = " "; + $catupdown = "". + "\"\"". + " ". + "". + "\"\"". + ""; + } if(empty($this->curCatDir)){ $cnt =0; @@ -710,12 +720,25 @@ class appgroup extends plugin $separator ="
"; - $sep = ""; - - $upudown =" {t}sort{/t}". - "  {t}sort{/t}". - " "; - $edit= " "; + if($this->acl_is_writeable("gosaMemberApplication")){ + $sep = ""; + $upudown = "". + " {t}sort{/t}". + " ". + "". + " {t}sort{/t}". + " ". + ""; + }else{ + $sep = ""; + $upudown = ""; + } + + if($this->acl_is_writeable("gosaApplicationParameter")){ + $edit= " "; + }else{ + $edit= ""; + } $Differences = $this->diffAppsInReleases(); @@ -775,7 +798,13 @@ class appgroup extends plugin $smarty->assign("ReleaseSelectAble", true); } } - $smarty->assign("ReleaseSelectAble", true); + $smarty->assign("ReleaseSelectAble", true); + + /* Set acls to template */ + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $acl => $translation){ + $smarty->assign($acl."ACL",$this->getacl($acl)); + } /* Show main page */ if ($this->dialog){ @@ -784,6 +813,7 @@ class appgroup extends plugin } else { $display.= $smarty->fetch (get_template_path('application.tpl', TRUE)); } + return ($display); } -- 2.30.2