)
*/
function checkAppMaintainerInput( $maintainReason )
{
$errors = "";
if ( empty( $maintainReason ) )
{
$errors .= "
Please enter why you would like to be an application maintainer.\n";
}
if ( empty($errors) )
{
return "";
}
else
{
return $errors;
}
}
if(!$_SESSION['current']->isLoggedIn())
util_show_error_page_and_exit("You need to be logged in to apply to be a maintainer.");
/* if we have a versionId to check against see if */
/* the user is already a maintainer */
if(!$aClean['iSuperMaintainer'] && $_SESSION['current']->isMaintainer($aClean['iVersionId']))
{
echo "You are already a maintainer of this app!";
exit;
}
/* if this user is a super maintainer they maintain all of the versionIds of this appId */
if($_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
{
echo "You are already a supermaintainer of the whole application family!";
exit;
}
if( $aClean['sMaintainReason'] )
{
// check the input for empty/invalid fields
$errors = checkAppMaintainerInput($aClean['sMaintainReason']);
if(!empty($errors))
util_show_error_page_and_exit("We found the following errors:","
Please go back and correct them.");
// header
if($aClean['iSuperMaintainer'])
apidb_header("Submit SuperMaintainer Request");
else
apidb_header("Submit Maintainer Request");
// add to queue
$oMaintainer = new Maintainer();
$oMaintainer->iAppId = $aClean['iAppId'];
$oMaintainer->iVersionId = $aClean['iVersionId'];
$oMaintainer->iUserId = $_SESSION['current']->iUserId;
$oMaintainer->sMaintainReason = $aClean['sMaintainReason'];
$oMaintainer->bSuperMaintainer = $aClean['iSuperMaintainer'];
$hResult = $oMaintainer->create();
if ($hResult)
{
echo "Your maintainer request has been submitted for review. You should hear back\n";
echo "soon about the status of your submission
\n";
} else
{
addmsg("Error submitting maintainer request. Please contact the appdb admins at appdb@winehq.org", "red");
}
} else
{
// header
if($aClean['iVersionId'])
{
$oVersion = new Version($aClean['iVersionId']);
$oApp = new Application($oVersion->iAppId);
apidb_header("Request to become an application maintainer of ".$oApp->sName." ".$oVersion->sName);
}
else
{
$oApp = new Application($aClean['iAppId']);
apidb_header("Request to become an application super maintainer of ".$oApp->sName);
}
// show add to queue form
echo '";
}
apidb_footer();
?>