Make sure $hUsersToWarn and $hUsersToDelete are valid before calling mysql_fetch_object() on them
This commit is contained in:
@@ -24,6 +24,8 @@ notifyAdminsOfCleanupStart();
|
|||||||
/* users inactive for 6 months that haven't been warned already */
|
/* users inactive for 6 months that haven't been warned already */
|
||||||
$hUsersToWarn = unwarnedAndInactiveSince(6);
|
$hUsersToWarn = unwarnedAndInactiveSince(6);
|
||||||
notifyAdminsOfProgress("Got through unwarnedAndInactiveSince");
|
notifyAdminsOfProgress("Got through unwarnedAndInactiveSince");
|
||||||
|
if($hUsersToWarn)
|
||||||
|
{
|
||||||
while($oRow = mysql_fetch_object($hUsersToWarn))
|
while($oRow = mysql_fetch_object($hUsersToWarn))
|
||||||
{
|
{
|
||||||
$usersWarned++;
|
$usersWarned++;
|
||||||
@@ -34,12 +36,15 @@ while($oRow = mysql_fetch_object($hUsersToWarn))
|
|||||||
if(($usersWarned % 25) == 0)
|
if(($usersWarned % 25) == 0)
|
||||||
emailProgress(0, $usersWarned);
|
emailProgress(0, $usersWarned);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
notifyAdminsOfProgress();
|
notifyAdminsOfProgress("in the middle between warning and deleting");
|
||||||
|
|
||||||
/* warned >= 1 month ago */
|
/* warned >= 1 month ago */
|
||||||
$hUsersToDelete = warnedSince(1);
|
$hUsersToDelete = warnedSince(1);
|
||||||
notifyAdminsOfProgress("Got through warnedSince");
|
notifyAdminsOfProgress("Got through warnedSince");
|
||||||
|
if($hUsersToDelete)
|
||||||
|
{
|
||||||
while($oRow = mysql_fetch_object($hUsersToDelete))
|
while($oRow = mysql_fetch_object($hUsersToDelete))
|
||||||
{
|
{
|
||||||
$oUser = new User($oRow->userid);
|
$oUser = new User($oRow->userid);
|
||||||
@@ -64,6 +69,7 @@ while($oRow = mysql_fetch_object($hUsersToDelete))
|
|||||||
if(($usersWithData % 25) == 0)
|
if(($usersWithData % 25) == 0)
|
||||||
emailProgress(2, $usersWithData);
|
emailProgress(2, $usersWithData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
notifyAdminsOfCleanupExecution($usersWarned, $usersDeleted, $usersWithData);
|
notifyAdminsOfCleanupExecution($usersWarned, $usersDeleted, $usersWithData);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user