',"\n"; 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 = mysql_query($query); $ob = mysql_fetch_object($result); mysql_free_result($result); } else { //error no Id! echo html_frame_start("Error","300"); echo '
QueueId Not Found!
',"\n"; echo html_frame_end(" "); } //process according to which request was submitted and optionally the sub flag if (!$_REQUEST['add'] && !$_REQUEST['reject'] && $_REQUEST['queueId']) { $x = new TableVE("view"); //help echo "| \n\n"; echo "Please enter an accurate and personalized reply anytime a maintainer request is rejected.\n"; echo "Its not polite to reject someones attempt at trying to help out without explaining why.\n"; echo " |
| Other maintainers of this app: | ',"\n"; $foundMaintainers = false; $firstDisplay = true; /* if false we need to fix up table rows appropriately */ $other_users = getMaintainersUserIdsFromAppIdVersionId($ob->appId, $ob->versionId); if($other_users) { $foundMaintainers = true; while(list($index, list($userIdValue)) = each($other_users)) { if($firstDisplay) { echo "".lookupUsername($userIdValue)." |
| ".lookupUsername($userIdValue)." | ".lookupUsername($userIdValue)."* | \n"; $firstDisplay = false; } else { echo "
| ".lookupUsername($userIdValue)."* | No other maintainers | \n"; } // Show which other apps the user maintains echo '
| This user also maintains these apps: | ',"\n"; $firstDisplay = true; $other_apps = getAppsFromUserId($ob->userId); if($other_apps) { while(list($index, list($appIdOther, $versionIdOther, $superMaintainerOther)) = each($other_apps)) { if($firstDisplay) { $firstDisplay = false; if($superMaintainerOther) echo "".appIdToName($appIdOther)."* | ".appIdToName($appIdOther).versionIdToName($versionIdOther)." | \n"; } else { if($superMaintainerOther) echo "".appIdToName($appIdOther)."* | \n"; else echo "".appIdToName($appIdOther).versionIdToName($versionIdOther)." | \n"; } } } else { echo "User maintains no other applications | \n"; } //app name echo '
| App Name | ',"\n"; echo "".appIdToName($ob->appId)." |
| App Version | ',"\n"; echo "".versionIdToName($ob->versionId)." |
| Maintainer request reason | ',"\n"; echo '|
| Email reply | ',"\n"; echo "|
| ' ,"\n"; echo ' | |
| ' ,"\n"; echo ' | |
The application was successfully added into the database
\n"; //delete the item from the queue mysql_query("DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";"); $goodtogo = 1; /* set to 1 so we send the response email */ } else { //error $statusMessage = "Database Error!
".mysql_error()."
$statusMessage
\n"; echo html_frame_end(" "); echo html_back_link(1,'adminMaintainerQueue.php'); } else if (($_REQUEST['reject'] || ($_REQUEST['sub'] == 'reject')) && $_REQUEST['queueId']) { if (lookupEmail($ob->userId)) { $ms = "Application Maintainer Request Report\n"; $ms .= "----------------------------------\n\n"; $ms .= "Your application to be the maintainer of ".appIdToName($ob->appId).versionIdToName($ob->versionId)." was rejected. "; $ms .= $_REQUEST['replyText']; $ms .= ""; $ms .= "-The AppDB admins\n"; mail(stripslashes(lookupEmail($ob->userId)),'[AppDB] Maintainer Request Report',$ms); } //delete main item $query = "DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";"; $result = mysql_query($query); echo html_frame_start("Delete maintainer application",400,"",0); if(!$result) { //error echo "Internal Error: unable to delete selected maintainer application!
\n"; } else { //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! echo html_frame_start("Error","300"); echo 'Internal Routine Not Found!
',"\n"; echo html_frame_end(" "); echo html_back_link(1,'adminMaintainerQueue.php'); } } else /* display the list of all outstanding maintainer requests */ { //get available maintainers $query = "SELECT queueId, appId, versionId,". "userId, maintainReason,". "superMaintainer,". "UNIX_TIMESTAMP(submitTime) as submitTime ". "from appMaintainerQueue;"; $result = mysql_query($query); if(!$result || !mysql_num_rows($result)) { //no apps in queue echo html_frame_start("","90%"); echo 'The Maintainer Queue is empty.
',"\n"; echo 'There is nothing for you to do. Check back later.
',"\n"; echo html_frame_end(" "); } else { //help echo "| \n\n";
echo " This is a list of users that are asking to become application maintainers.\n"; echo "Please read carefully the reasons they give for wanting to be an application maintainer.\n"; echo " |
| Submission Date | \n"; echo "Queue Id | \n"; echo "Username | \n"; echo "Application Name | \n"; echo "Version | \n"; echo "Super maintainer? | \n"; echo "Submitter Email | \n"; echo "\n"; echo " | ||
| ".date("Y-n-t h:i:sa", $ob->submitTime)." | \n"; echo "$ob->queueId | \n"; echo "".lookupUsername($ob->userId)." | \n"; echo "".appIdToName($ob->appId)." | \n"; if($ob->superMaintainer) { echo "N/A | \n"; echo "Yes | \n"; } else { echo "".versionIdToName($ob->versionId)." | \n"; echo "No | \n"; } echo "".lookupEmail($ob->userId)." | \n"; echo "[reject] | \n"; echo "