summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db5ba4d)
raw | patch | inline | side by side (parent: db5ba4d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Oct 2008 07:32:13 +0000 (07:32 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 21 Oct 2008 07:32:13 +0000 (07:32 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12745 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc | patch | blob | history | |
gosa-plugins/mail/addons/mailqueue/contents.tpl | patch | blob | history |
diff --git a/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc
index 15b8f10451c5d2dd8c6ebe0a6a2168ea9f71f69a..3a83d5040fdc449c0dd20688bc73460ecf139c6d 100644 (file)
}
$smarty= get_smarty();
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $desc){
+ $smarty->assign($name."ACL",$this->getacl($name));
+ $smarty->assign($name."_W",$this->acl_is_writeable($name));
+ }
$error =false;
/******************
"all_requeue" => "requeue");
foreach($_POST as $name => $value){
foreach($types as $type => $target){
- if(preg_match("/^".$type."/",$name)){
+ if(preg_match("/^".$type."/",$name) && $this->acl_is_writeable($target."All")){
$entry = $this->list_get_selected_items();
$action = $target;
break;
}
if(!empty($action)) break;
}
-
$types = array("del","hold","unhold","header","requeue");
foreach($_POST as $name => $value){
foreach($types as $type){
- if(preg_match("/^".$type."__/",$name)){
+ if(preg_match("/^".$type."__/",$name) && $this->acl_is_writeable($type)){
$action = $type;
$server = preg_replace("/^".$type."__[^_]*__([^_]*)_.*/","\\1",$name);
$entry[$server][] = preg_replace("/^".$type."__([^_]*)__.*/","\\1",$name);
Query mailqueues
******************/
- $within_minutes = -1;
- if($this->Time != "nolimit"){
- $within_minutes = 60*60*$this->Time;
- }
+ $entries = array();
+ if($this->acl_is_readable("query")){
+ $within_minutes = -1;
+ if($this->Time != "nolimit"){
+ $within_minutes = 60*60*$this->Time;
+ }
- if($this->Server == "all"){
- $entries = array();
- foreach($this->ServerList as $mac => $name){
- if(!tests::is_mac($mac)) continue;
- $entries = array_merge($entries,$this->si_queue->query_mailqueue($mac,$this->Search,$within_minutes));
+ if($this->Server == "all"){
+ $entries = array();
+ foreach($this->ServerList as $mac => $name){
+ if(!tests::is_mac($mac)) continue;
+ $entries = array_merge($entries,$this->si_queue->query_mailqueue($mac,$this->Search,$within_minutes));
+ if($this->si_queue->is_error()){
+ msg_dialog::display(_("Error"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);
+ }
+ }
+ }else{
+ $entries = $this->si_queue->query_mailqueue($this->Server,$this->Search,$within_minutes);
if($this->si_queue->is_error()){
msg_dialog::display(_("Error"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);
}
}
- }else{
- $entries = $this->si_queue->query_mailqueue($this->Server,$this->Search,$within_minutes);
- if($this->si_queue->is_error()){
- msg_dialog::display(_("Error"),msgPool::siError($this->si_queue->get_error()),ERROR_DIALOG);
- }
}
/* Sort entries
create html output
******************/
+ $smarty->assign("query_allowed",$this->acl_is_readable("query"));
$smarty->assign("all_ok" , count($entries));
$smarty->assign("entries" , $entries);
$smarty->assign("plug" , "?plug=".$_GET['plug']);
}else{
$smarty->assign("SortType","<img src='images/lists/sort-down.png' alt='"._("down")."' border='0'>");
}
+
return ($smarty->fetch (get_template_path('contents.tpl', TRUE)));
}
"plCategory" => array("mailqueue" => array("objectClass" => "none", "description" => _("Mail queue addon"))),
"plProvidedAcls" => array(
- "unhold_all" => _("Unhold all messages"),
- "hold_all" => _("Hold all messages"),
- "del_all" => _("Delete all messages"),
- "requeue_all" => _("Requeue all messages"),
+ "unholdAll" => _("Unhold all messages"),
+ "holdAll" => _("Hold all messages"),
+ "delAll" => _("Delete all messages"),
+ "requeueAll" => _("Requeue all messages"),
"unhold" => _("Unhold message"),
"hold" => _("Hold message"),
"del" => _("Delete message"),
diff --git a/gosa-plugins/mail/addons/mailqueue/contents.tpl b/gosa-plugins/mail/addons/mailqueue/contents.tpl
index 81b485f028a575c7fb07bb6aade5b2eab9be040d..73d88529f3c12149daba7d10a4628b6064fcd06d 100644 (file)
</div>
<br>
+{if !$query_allowed}
+ <b>{msgPool type=permView}</b>
+{else}
{if $all_ok != true}
<b>{t}Search returned no results{/t}...</b>
<p class="plugbottom"> </p>
{/if}
+{/if}
+
<script language="JavaScript" type="text/javascript">
<!-- // First input field on page