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']) { // insert the new entry into the maintainers list $query = "INSERT into appMaintainers VALUES(null,". "$ob->appId,". "$ob->versionId,". "$ob->userId,". "$ob->superMaintainer,". "NOW());"; if (query_appdb($query)) { $statusMessage = "The maintainer was successfully added into the database
\n"; //delete the item from the queue query_appdb("DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";"); $oApp = new Application($ob->appId); $oVersion = new Version($ob->versionId); //Send Status Email $sEmail = $oUser->sEmail; if ($sEmail) { $sSubject = "Application Maintainer Request Report"; $sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." has been accepted. "; $sMsg .= $_REQUEST['replyText']; $sMsg .= "We appreciate your help in making the Application Database better for all users.\n\n"; mail_appdb($sEmail, $sSubject ,$sMsg); } //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 Application($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(); } } ?>