From c25cdd2b371783571b24b59ada9301ef7367dfdd Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 7 Sep 2010 11:54:43 +0000 Subject: [PATCH] Added filter ACLs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19547 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_filterEditor.inc | 1 + .../groupware/class_filterManager.inc | 13 ++++++++++-- .../personal/groupware/filterEditor.tpl | 21 +++++++++++++++---- .../personal/groupware/filterManager.tpl | 9 +++++--- .../groupware/personal/groupware/generic.tpl | 2 +- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc index e561b8d1a..82590dac9 100644 --- a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc +++ b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc @@ -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__)))); } diff --git a/gosa-plugins/groupware/personal/groupware/class_filterManager.inc b/gosa-plugins/groupware/personal/groupware/class_filterManager.inc index 74102af1c..484e2f3e1 100644 --- a/gosa-plugins/groupware/personal/groupware/class_filterManager.inc +++ b/gosa-plugins/groupware/personal/groupware/class_filterManager.inc @@ -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__)))); diff --git a/gosa-plugins/groupware/personal/groupware/filterEditor.tpl b/gosa-plugins/groupware/personal/groupware/filterEditor.tpl index 0f1b1c457..fba3fe424 100644 --- a/gosa-plugins/groupware/personal/groupware/filterEditor.tpl +++ b/gosa-plugins/groupware/personal/groupware/filterEditor.tpl @@ -3,19 +3,32 @@ - + - +
: + {render acl=$acl} + + {/render} +
+ {render acl=$acl} + + {/render} +

-{$filterStr} +{render acl=$acl} + {$filterStr} +{/render}
+
- + {render acl=$acl} + + {/render}
diff --git a/gosa-plugins/groupware/personal/groupware/filterManager.tpl b/gosa-plugins/groupware/personal/groupware/filterManager.tpl index d45154592..5eb6b1187 100644 --- a/gosa-plugins/groupware/personal/groupware/filterManager.tpl +++ b/gosa-plugins/groupware/personal/groupware/filterManager.tpl @@ -2,11 +2,14 @@ {$list} - - +{render acl=$acl} + +{/render}
- + {render acl=$acl} + + {/render}
diff --git a/gosa-plugins/groupware/personal/groupware/generic.tpl b/gosa-plugins/groupware/personal/groupware/generic.tpl index 42770a92c..e0f5fd537 100644 --- a/gosa-plugins/groupware/personal/groupware/generic.tpl +++ b/gosa-plugins/groupware/personal/groupware/generic.tpl @@ -47,7 +47,7 @@ - {render acl=$mailFilterACL} + {render acl=$mailFilterACL mode=read_active} {/render} -- 2.30.2