Refactor some code into a function to clean up the cleanup script
This commit is contained in:
@@ -9,12 +9,33 @@ require("path.php");
|
|||||||
require(BASE."include/incl.php");
|
require(BASE."include/incl.php");
|
||||||
require_once(BASE."include/mail.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
|
* Warn users that have been inactive for some number of months
|
||||||
* If it has been some period of time since the user was warned
|
* 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
|
* the user is deleted if they don't have any pending appdb data
|
||||||
*/
|
*/
|
||||||
|
function inactiveUserCheck()
|
||||||
|
{
|
||||||
$usersWarned = 0;
|
$usersWarned = 0;
|
||||||
$usersUnwarnedWithData = 0; /* users we would normally warn but who have data */
|
$usersUnwarnedWithData = 0; /* users we would normally warn but who have data */
|
||||||
$usersDeleted = 0;
|
$usersDeleted = 0;
|
||||||
@@ -68,21 +89,7 @@ if($hUsersToDelete)
|
|||||||
}
|
}
|
||||||
|
|
||||||
notifyAdminsOfCleanupExecution($usersWarned, $usersUnwarnedWithData, $usersDeleted, $usersWithData);
|
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 */
|
/* Users that are unwarned and inactive since $iMonths */
|
||||||
function unwarnedAndInactiveSince($iMonths)
|
function unwarnedAndInactiveSince($iMonths)
|
||||||
|
|||||||
Reference in New Issue
Block a user