Make sure $hUsersToWarn and $hUsersToDelete are valid before calling mysql_fetch_object() on them

This commit is contained in:
Chris Morgan
2005-10-09 17:32:59 +00:00
committed by WineHQ
parent d4740cf030
commit 1de5d7923f

View File

@@ -24,6 +24,8 @@ notifyAdminsOfCleanupStart();
/* users inactive for 6 months that haven't been warned already */
$hUsersToWarn = unwarnedAndInactiveSince(6);
notifyAdminsOfProgress("Got through unwarnedAndInactiveSince");
if($hUsersToWarn)
{
while($oRow = mysql_fetch_object($hUsersToWarn))
{
$usersWarned++;
@@ -34,12 +36,15 @@ while($oRow = mysql_fetch_object($hUsersToWarn))
if(($usersWarned % 25) == 0)
emailProgress(0, $usersWarned);
}
}
notifyAdminsOfProgress();
notifyAdminsOfProgress("in the middle between warning and deleting");
/* warned >= 1 month ago */
$hUsersToDelete = warnedSince(1);
notifyAdminsOfProgress("Got through warnedSince");
if($hUsersToDelete)
{
while($oRow = mysql_fetch_object($hUsersToDelete))
{
$oUser = new User($oRow->userid);
@@ -64,6 +69,7 @@ while($oRow = mysql_fetch_object($hUsersToDelete))
if(($usersWithData % 25) == 0)
emailProgress(2, $usersWithData);
}
}
notifyAdminsOfCleanupExecution($usersWarned, $usersDeleted, $usersWithData);