Move deletion of maintainer logic into the user class. If the cleanup script wants to delete a user and can't, if they are a maintainer we should remove their maintainer status even if we don't delete their account. Send email at the start of the cleanup script to aid in debug

This commit is contained in:
Chris Morgan
2005-09-30 01:37:57 +00:00
committed by WineHQ
parent b067e62789
commit a66ae25f38
3 changed files with 56 additions and 12 deletions

View File

@@ -24,22 +24,20 @@ $superMaintainer = strip_tags($_POST['superMaintainer']);
if($confirmed)
{
$oApp = new Application($appId);
$oApp = new Application($appId);
if($superMaintainer)
{
apidb_header("You have resigned as supermaintainer of ".$oApp->sName);
$query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->iUserId.
" AND appId = ".$oApp->iAppId." AND superMaintainer = ".$superMaintainer.";";
$result = $_SESSION['current']->deleteMaintainer($oApp->iAppId, null);
} else
{
$oVersion = new Version($versionId);
apidb_header("You have resigned as maintainer of ".$oApp->sName." ".$oVersion->sName);
$query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->iUserId.
" AND appId = ".$oApp->iAppId." AND versionId = ".$oVersion->iVersionId." AND superMaintainer = ".$superMaintainer.";";
$result = $_SESSION['current']->deleteMaintainer($oApp->iAppId, $oVersion->iVersionId);
}
/* echo html_frame_start("Removing",400,"",0);
*/
if($result = query_appdb($query))
if($result)
{
if($superMaintainer)
echo "You were removed as a supermaintainer of ".$oApp->sName;