Code

Updated aclRoles
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 13:11:42 +0000 (13:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 13:11:42 +0000 (13:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16752 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/acl/acl_role.tpl
gosa-core/plugins/admin/acl/class_aclRole.inc

index 41e2a57c6c0580626cfc25238be08394a2316768..2bb63fc8254fc6e1be3eefb38df7e4e89e829c21 100644 (file)
@@ -1,6 +1,6 @@
 {if $dialogState eq 'head'}
 
-<h1>{t}Assigned ACL for current entry{/t}</h1>
+<h3>{t}Assigned ACL for current entry{/t}</h3>
 <table summary="{t}Assigned ACL for current entry{/t}">
 <tr>
        <td>
 {/if}
 
 {if $dialogState eq 'create'}
-<h1>{t}ACL type{/t} <select size="1" name="aclType" title="{t}Select an acl type{/t}" onChange="document.mainform.submit()">{html_options options=$aclTypes selected=$aclType}<option disabled>&nbsp;</option></select>&nbsp;{if $javascript eq 'false'}<button type='submit' name='refresh'>{msgPool type=applyButton}</button>{/if}
-</h1>
+<h3>{t}ACL type{/t} <select size="1" name="aclType" title="{t}Select an acl type{/t}" onChange="document.mainform.submit()">{html_options options=$aclTypes selected=$aclType}<option disabled>&nbsp;</option></select>&nbsp;{if $javascript eq 'false'}<button type='submit' name='refresh'>{msgPool type=applyButton}</button>{/if}
+</h3>
 
 <hr>
 
 
-<h1>{t}List of available ACL categories{/t}</h1>
+<h3>{t}List of available ACL categories{/t}</h3>
 {$aclList}
 
 <hr>
@@ -65,7 +65,7 @@
 
 {if $dialogState eq 'edit'}
 
-<h1>{$headline}</h1>
+<h3>{$headline}</h3>
 
 {render acl=$gosaAclEntryACL}
 {$aclSelector}
index a535647de84394797962f4e4d8224d389ca91650..7b5aa8d00c014d20dbd7737c812f1be890be70c5 100644 (file)
@@ -393,6 +393,12 @@ class aclrole extends acl
       $aclList= new divSelectBox("aclList");
       $aclList->SetHeight(450);
 
+      // Create a map of all used sections, this allows us to simply hide the remove button
+      //  if no acl is configured for the given section
+      // e.g. ';all;department/country;users/user;
+      $usedList = ";".implode(array_keys($this->aclContents),';').";";
+
+
       /* Add settings for all categories to the (permanent) list */
       foreach ($this->aclObjects as $section => $dsc){
         $summary= "";
@@ -423,7 +429,7 @@ class aclrole extends acl
         if($this->acl_is_readable("gosaAclEntry")){
           $action.= image('images/lists/edit.png','cat_edit_'.$section,_("Edit category ACL"));
         }
-        if($this->acl_is_writeable("gosaAclEntry")){
+        if($this->acl_is_writeable("gosaAclEntry")  && preg_match("/;".$section."(;|\/)/", $usedList)){
           $action.= image('images/lists/trash.png','cat_del_'.$section,_("Delete category ACL"));
         }