Skip to content

Commit

Permalink
Fixed issue #05079
Browse files Browse the repository at this point in the history
Dev Added a condition to MBTS in case inbox is empty

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9963 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Aniessh Sethh committed Apr 4, 2011
1 parent 9b12d20 commit 2932881
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions admin/tokens.php
Expand Up @@ -299,12 +299,14 @@
if($mbox=imap_open('{'.$hostname.$flags.'}INBOX',$username,$pass))
{
imap_errors();
$count=imap_num_msg($mbox);
$lasthinfo=imap_headerinfo($mbox,$count);
$count=imap_num_msg($mbox);
if($count>0)
{
$lasthinfo=imap_headerinfo($mbox,$count);
$datelcu = strtotime($lasthinfo->date);
$datelastbounce= $datelcu;
$lastbounce = $thissurvey['bouncetime'];
while($datelcu > $lastbounce)
while($datelcu > $lastbounce)
{
$header = explode("\r\n",@imap_body($mbox,$count,FT_PEEK)); // Don't put read
foreach ($header as $item)
Expand All @@ -329,23 +331,31 @@
}
}
}

$count--;
$lasthinfo=@imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$checktotal++;
}
$checktotal++;

}
if($bouncetotal>0)
{
echo sprintf($clang->gT("%s messages were scanned out of which %s were marked as bounce by the system."), $checktotal,$bouncetotal);
}
else
{
echo sprintf($clang->gT("%s messages were scanned, none were marked as bounce by the system."),$checktotal);
}
}
else
{
echo sprintf($clang->gT("Your inbox is empty"));
}
@imap_close($mbox);
$entertimestamp = "update ".db_table_name("surveys")." set bouncetime='$datelastbounce' where sid='$surveyid'";
$executetimestamp = $connect->Execute($entertimestamp);
if($bouncetotal>0)
{
echo sprintf($clang->gT("%s messages were scanned out of which %s were marked as bounce by the system."), $checktotal,$bouncetotal);
}
else
{
echo sprintf($clang->gT("%s messages were scanned, none were marked as bounce by the system."),$checktotal);
}

}
else
{
Expand Down

0 comments on commit 2932881

Please sign in to comment.