Refactor some code into a function to clean up the cleanup script

This commit is contained in:
Chris Morgan
2007-05-26 04:02:24 +00:00
committed by WineHQ
parent f27a2d8f7d
commit 4b61351551

View File

@@ -9,12 +9,33 @@ require("path.php");
require(BASE."include/incl.php");
require_once(BASE."include/mail.php");
inactiveUserCheck();
/* check to see if there are orphaned versions in the database */
orphanVersionCheck();
/* check and purge any orphaned messages stuck in sessionMessages table */
orphanSessionMessagesCheck();
/* check and purge any expired sessions from the session_list table */
orphanSessionListCheck();
/* report error log entries to admins and flush the error log after doing so */
reportErrorLogEntries();
/* remove screenshots that are missing their screenshot and thumbnail files */
removeScreenshotsWithMissingFiles();
/*
* Warn users that have been inactive for some number of months
* If it has been some period of time since the user was warned
* the user is deleted if they don't have any pending appdb data
*/
function inactiveUserCheck()
{
$usersWarned = 0;
$usersUnwarnedWithData = 0; /* users we would normally warn but who have data */
$usersDeleted = 0;
@@ -68,21 +89,7 @@ if($hUsersToDelete)
}
notifyAdminsOfCleanupExecution($usersWarned, $usersUnwarnedWithData, $usersDeleted, $usersWithData);
/* check to see if there are orphaned versions in the database */
orphanVersionCheck();
/* check and purge any orphaned messages stuck in sessionMessages table */
orphanSessionMessagesCheck();
/* check and purge any expired sessions from the session_list table */
orphanSessionListCheck();
/* report error log entries to admins and flush the error log after doing so */
reportErrorLogEntries();
/* remove screenshots that are missing their screenshot and thumbnail files */
removeScreenshotsWithMissingFiles();
}
/* Users that are unwarned and inactive since $iMonths */
function unwarnedAndInactiveSince($iMonths)