hasPriv("admin")) { errorpage("Insufficient privileges."); exit; } if ($_REQUEST['sub']) { if ($_REQUEST['queueId']) { //get data $query = "SELECT queueId, appId, versionId,". "userId, maintainReason, superMaintainer,". "UNIX_TIMESTAMP(submitTime) as submitTime ". "FROM appMaintainerQueue WHERE queueId = ".$_REQUEST['queueId'].";"; $result = query_appdb($query); $ob = mysql_fetch_object($result); $oUser = new User($ob->userId); mysql_free_result($result); } else { //error no Id! errorpage("
QueueId Not Found!
"); } //process according to which request was submitted and optionally the sub flag if (!$_REQUEST['add'] && !$_REQUEST['reject'] && $_REQUEST['queueId']) { apidb_header("Admin Maintainer Queue"); echo '"; apidb_footer(); exit; } else if ($_REQUEST['add'] && $_REQUEST['queueId']) { /* create a new user object for the maintainer */ $maintainerUser = new User($ob->userId); /* add the user as a maintainer and return the statusMessage */ $statusMessage = $maintainerUser->addAsMaintainer($ob->appId, $ob->versionId, $ob->superMaintainer, $_REQUEST['queueId']); //done addmsg("$statusMessage
", 'green'); } else if (($_REQUEST['reject'] || ($_REQUEST['sub'] == 'reject')) && $_REQUEST['queueId']) { $sEmail = $oUser->sEmail; if ($sEmail) { $oApp = new Application($ob->appId); $oVersion = new Version($ob->versionId); $sSubject = "Application Maintainer Request Report"; $sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." was rejected. "; $sMsg .= $_REQUEST['replyText']; $sMsg .= ""; $sMsg .= "-The AppDB admins\n"; mail_appdb($sEmail, $sSubject ,$sMsg); } //delete main item $query = "DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";"; $result = query_appdb($query,"unable to delete selected maintainer application"); echo html_frame_start("Delete maintainer application",400,"",0); if($result) { //success echo "Maintainer application was successfully deleted from the Queue.
\n"; } echo html_frame_end(" "); echo html_back_link(1,'adminMaintainerQueue.php'); } else { //error no sub! addmsg('Internal Routine Not Found!
', 'red'); } } /* display the list of all outstanding maintainer requests */ { apidb_header("Admin Maintainer Queue"); echo '"; apidb_footer(); } } ?>