Code

Added filter ACLs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Sep 2010 11:54:43 +0000 (11:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Sep 2010 11:54:43 +0000 (11:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19547 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_filterEditor.inc
gosa-plugins/groupware/personal/groupware/class_filterManager.inc
gosa-plugins/groupware/personal/groupware/filterEditor.tpl
gosa-plugins/groupware/personal/groupware/filterManager.tpl
gosa-plugins/groupware/personal/groupware/generic.tpl

index e561b8d1a0038aaf7fe8f517acb781eb44ebefdd..82590dac969ff8d90077ce284339fddf899956ab 100644 (file)
@@ -53,6 +53,7 @@ class filterEditor extends plugin
         $smarty->assign('NAME',set_post($this->filter['NAME']));    
         $smarty->assign('DESC',set_post($this->filter['DESC']));    
         $smarty->assign('filterStr', $this->renderFilter());    
+        $smarty->assign('acl', $this->parent->getacl('mailFilter'));    
 
         return($smarty->fetch(get_template_path('filterEditor.tpl',TRUE,dirname(__FILE__))));
     }
index 74102af1c051cc8dee80e5faac97029dcab95f46..484e2f3e1fff5bb9bf336907415a0678422e9b07 100644 (file)
@@ -12,13 +12,18 @@ class filterManager extends plugin{
         $this->parent = &$parent;
 
         $this->filter = $rules;
+
+        // If we've read permissions then allow to edit the entries
+        $acl = $this->parent->getacl('mailFilter');
+        $acl = preg_replace("/r/","rw", $acl);
+    
         $this->filterListing= new sortableListing();
         $this->filterListing->setDeleteable(true);
         $this->filterListing->setEditable(true);
         $this->filterListing->setColspecs(array('*'));
         $this->filterListing->setWidth("100%");
         $this->filterListing->setHeight("150px;");
-        $this->filterListing->setAcl($this->parent->getacl('mailFilter'));
+        $this->filterListing->setAcl($acl);
         $this->filterListing->setColspecs(array('30px','200px','*'));
         $this->filterListing->setHeader(array('-',_("Name"),_("Description")));
         $this->filterListing->setDefaultSortColumn(1);
@@ -26,6 +31,10 @@ class filterManager extends plugin{
 
     function execute()
     {
+        // If we've read permissions then allow to edit the entries
+        $acl = $this->parent->getacl('mailFilter');
+        $acl = preg_replace("/r/","rw", $acl);
+        $this->filterListing->setAcl($acl);
         // Display filter editor while a filter rule is edited
         if($this->filterEditor instanceOf filterEditor){
             $this->filterEditor->save_object();
@@ -51,7 +60,7 @@ class filterManager extends plugin{
         $this->filterListing->update();
 
 
-
+        $smarty->assign('acl', $this->parent->getacl('mailFilter'));
         $smarty->assign('list', $this->filterListing->render());
 
         return($smarty->fetch(get_template_path('filterManager.tpl',TRUE,dirname(__FILE__))));
index 0f1b1c45723f4daa90fd08fe4eebc1a8be575e26..fba3fe424c1bfd0fe82c052c1ba563650e3e916f 100644 (file)
@@ -3,19 +3,32 @@
 <table summary="{t}Generic settings{/t}">
     <tr>
         <td><LABEL for='NAME'>{t}Name{/t}</LABEL>:</td>
-        <td><input style='width:300px;' type='text' id='NAME' name="NAME" value="{$NAME}"></td>
+        <td>
+            {render acl=$acl}
+                <input style='width:300px;' type='text' id='NAME' name="NAME" value="{$NAME}">
+            {/render}
+        </td>
     </tr>
     <tr>
         <td><LABEL for='DESC'>{t}Description{/t}:</LABEL></td>
-        <td><input style='width:300px;' type='text' id='DESC' name="DESC" value="{$DESC}"></td>
+        <td>
+            {render acl=$acl}
+                <input style='width:300px;' type='text' id='DESC' name="DESC" value="{$DESC}">
+            {/render}
+        </td>
     </tr>
 </table>
 
 <hr>
-{$filterStr}
+{render acl=$acl}
+    {$filterStr}
+{/render}
 <hr>
+
 <div class="plugin-actions">
-    <button name='filterEditor_ok'>{msgPool type='okButton'}</button>
+    {render acl=$acl}
+        <button name='filterEditor_ok'>{msgPool type='okButton'}</button>
+    {/render}
     <button name='filterEditor_cancel'>{msgPool type='cancelButton'}</button>
 </div>
 <input type='hidden' value='1' name='filterEditorPosted'>
index d45154592420357201d30661d48569d68caf787d..5eb6b11873d94cd094b110923491e41b904125e1 100644 (file)
@@ -2,11 +2,14 @@
 
 {$list}
 
-<button name='addFilter'>{msgPool type='addButton'}</button>
-
+{render acl=$acl}
+    <button name='addFilter'>{msgPool type='addButton'}</button>
+{/render}
 
 <hr>
 <div class="plugin-actions">
-    <button name='filterManager_ok'>{msgPool type='okButton'}</button>
+    {render acl=$acl}
+        <button name='filterManager_ok'>{msgPool type='okButton'}</button>
+    {/render}
     <button name='filterManager_cancel'>{msgPool type='cancelButton'}</button>
 </div>
index 42770a92cb1c63a538125be36c9c9e78589ceac4..e0f5fd537600bec881d6343cea4a380c1f98c631 100644 (file)
@@ -47,7 +47,7 @@
                 <tr>
                     <td><label for="mailFilter">{t}Mail filter{/t}</label></td>
                     <td>
-                        {render acl=$mailFilterACL}
+                        {render acl=$mailFilterACL mode=read_active}
                             <button name='configureFilter'>{t}Configure filter{/t}</button>
                         {/render}
                     </td>