summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f72e98)
raw | patch | inline | side by side (parent: 9f72e98)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Nov 2005 05:55:04 +0000 (05:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Nov 2005 05:55:04 +0000 (05:55 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1841 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/addons/mailqueue/class_mailqueue.inc b/plugins/addons/mailqueue/class_mailqueue.inc
index f14094f318154fa4879b8ad245358c6ccf4c9539..a59fee6c09312b6e07af8227a6d1cdc845b638d1 100644 (file)
var $QueryCommand = "";
var $RemoveCommand= "";
- var $Server = "none";
+ var $Server = "all";
var $Time = 0;
var $Search = "*";
var $Page = 0;
$this->QueryCommand = search_config($this->config->data['MENU'], "mailqueue", "MAILQUEUE_QUERY_COMMAND");
$this->RemoveCommand= search_config($this->config->data['MENU'], "mailqueue", "MAILQUEUE_REMOVE_COMMAND");
- $this->Server = "none";
+ $this->Server = "all";
}
function execute()
/* Call parent execute */
plugin::execute();
$smarty= get_smarty();
+
+ $q_cmd = preg_replace("/%server/",$this->Server,$this->QueryCommand);
- if($str = @shell_exec ($this->QueryCommand)){
+ if($str = @shell_exec ($q_cmd)){
$mailQueueParser = new parseMailQueue($str);
+
+ if(isset($_GET['del'])){
+ if($mailQueueParser->IDExists($_GET['del'])){
+ $r_cmd = preg_replace("/%server/", $this->Server,$this->RemoveCommand);
+ $r_cmd = preg_replace("/%id/", $_GET['del'] ,$r_cmd);
+ print $r_cmd;
+ }
+ }
+
$mailQueueParser->OrderBy($this->OrderBy,$this->SortType);
$mailQueueParser->OnlyDaysAgo($this->Time);
$mailQueueParser->CreateDate();
$smarty->assign("plug","?plug=".$_GET['plug']);
$smarty->assign("p_server",$this->Server);
$smarty->assign("p_servers",$this->getServer());
+ $smarty->assign("p_serverKeys",array_flip($this->getServer()));
$smarty->assign("p_time", $this->Time);
$smarty->assign("p_times",$this->getTimes());
$smarty->assign("p_timeKeys",array_flip($this->getTimes()));
function getServer()
{
- $ret= array("none",_("none"));
+ $ret= array("all"=>_("All"));
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ldap->search("(objectClass=goMailServer)",array("cn"));
function getTimes()
{
- $ret = array("all"=>_("all"));
- for($i = 0 ; $i < 10 ; $i ++ ){
+ $ret = array();
+ $ret['nolimit']=_("no limit");
+ foreach(array(1,2,4,8,12,24,36,48) as $i){
if($i == 1){
- $ret[$i] = $i." "._("day ago");
+ $ret[$i] = $i." "._("hour");
}else{
- $ret[$i] = $i." "._("days ago");
+ $ret[$i] = $i." "._("hours");
}
}
return($ret);
diff --git a/plugins/addons/mailqueue/class_parseMailQueue.inc b/plugins/addons/mailqueue/class_parseMailQueue.inc
index 49c78752a0696d64c4d8894c024c06b933789bdf..573fccf4a8bc8bb0e8bb3d98dc0837bea9785de1 100644 (file)
function OnlyDaysAgo($str)
{
$cur = time();
- if(is_numeric($str)){
- $cur = $cur - ($str*(60*60*24));
+ if((is_numeric($str))&&($str != 0)){
+ $cur = $cur - ($str*(60*60));
foreach($this->a_parsedData as $key => $data){
if($data['Arrival'] < $cur){
unset($this->a_parsedData[$key]);
index c6f62aee675f000f6fdf831065bd144f60ed3250..29fb6401d314bd6412feea0d60b0422cf0c11e89 100644 (file)
<input name="search_for" size="25" maxlength="60" value="{$search_for}" title="{t}Please enter a search string here.{/t}" onchange="mainform.submit()">
in
<select size="1" name="p_server" title="{t}Select a server{/t}" onchange="mainform.submit()">
- {html_options values=$p_servers output=$p_servers selected=$p_server}
+ {html_options values=$p_serverKeys output=$p_servers selected=$p_server}
</select>
- {t}Select time periode{/t}
+ {t}within the last{/t}
<select size="1" name="p_time" onchange="mainform.submit()">
{html_options values=$p_timeKeys output=$p_times selected=$p_time}
</select>