summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7190848)
raw | patch | inline | side by side (parent: 7190848)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Nov 2005 07:25:48 +0000 (07:25 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 7 Nov 2005 07:25:48 +0000 (07:25 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1844 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/addons/mailqueue/class_parseMailQueue.inc | patch | blob | history |
diff --git a/plugins/addons/mailqueue/class_parseMailQueue.inc b/plugins/addons/mailqueue/class_parseMailQueue.inc
index 573fccf4a8bc8bb0e8bb3d98dc0837bea9785de1..eabba97a7d64893a8f0eb612d0bd8f4d3b43d85d 100644 (file)
$this->_parse();
}
+
+ /* Remove all entries which are older than the last x hours
+ */
function OnlyDaysAgo($str)
{
+ /* Get current time */
$cur = time();
+
+ /* Only perform this filter, if the given parameter is valid */
if((is_numeric($str))&&($str != 0)){
+
+ /* hours are given as parameter */
$cur = $cur - ($str*(60*60));
+
+ /* Remove old entries */
foreach($this->a_parsedData as $key => $data){
if($data['Arrival'] < $cur){
unset($this->a_parsedData[$key]);
}
}
+
+ /* Only keep entries that contains the $filter
+ * in any of the given $fields
+ */
function Search($filter,$fields)
{
+ /* Go through all entries */
foreach($this->a_parsedData as $key => $data){
+
+ /* not found yet */
$found = false;
foreach($fields as $attr){
$found= true;
}
}
+
+ /* if nothing found, delete this entry */
if($found == false){
unset($this->a_parsedData[$key]);
}
}
}
+ /* Convert date from timestamp to human readable */
function CreateDate()
{
foreach($this->a_parsedData as $key => $data){
}
}
+ /* Order by specified field */
function OrderBy($str = "Arrival",$type = "up" )
{
$tmp = array();
+
+ /* If the given field is not valid */
if(!in_array($str,array("MailID","Size","Sender","Recipient","Arrival","Error"))){
return(false);
}
+ /* Size need special handling, cause it contains numbers
+ */
if($str == "Size"){
foreach($this->a_parsedData as $data){
$struse = "";
return($this->a_parsedData);
}
+ /* Checks if the given MailID exists */
function IDExists($id)
{
return(((isset($this->a_parsedData[$id]))&&(is_array($this->a_parsedData[$id]))));
$s_Error = $s_buffer[1];
$s_Recipient = $s_buffer[2];
+ /* Append data */
$this->a_parsedData[$s_mailID]['MailID'] = $s_mailID;
$this->a_parsedData[$s_mailID]['Size'] = $s_Size;
$this->a_parsedData[$s_mailID]['Arrival'] = $s_Arrival;
return($this->a_parsedData);
}
+ /* Parse Error part of the entry */
function _parseError($str)
{
$str = trim(preg_replace("/[()]/","",$str));