',"\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 "
\n\n"; //view application details echo html_frame_start("New Maintainer Form",600,"",0); echo "\n"; // Show the other maintainers of this application, if there are any echo '',"\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 "\n"; $firstDisplay = false; } else { echo "\n"; } } } $other_users = getSuperMaintainersUserIdsFromAppId($ob->appId); if($other_users) { $foundMaintainers = true; while(list($index, list($userIdValue)) = each($other_users)) { if($firstDisplay) { echo "\n"; $firstDisplay = false; } else { echo "\n"; } } } if(!$foundMaintainers) { echo "\n"; } // Show which other apps the user maintains echo '',"\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 "\n"; else echo "\n"; } else { if($superMaintainerOther) echo "\n"; else echo "\n"; } } } else { echo "\n"; } //app name echo '',"\n"; echo "\n"; //version echo '',"\n"; echo "\n"; //maintainReason echo '',"\n"; echo '',"\n"; //email response echo '',"\n"; echo "\n"; //echo ',"\n"; //echo '',"\n"; /* Add button */ echo '',"\n"; /* Reject button */ echo '',"\n"; echo '
Other maintainers of this app:".lookupUsername($userIdValue)."
".lookupUsername($userIdValue)."
".lookupUsername($userIdValue)."*
".lookupUsername($userIdValue)."*
No other maintainers
This user also maintains these apps:".appIdToName($appIdOther)."*
".appIdToName($appIdOther).versionIdToName($versionIdOther)."
".appIdToName($appIdOther)."*
".appIdToName($appIdOther).versionIdToName($versionIdOther)."
User maintains no other applications
App Name".appIdToName($ob->appId)."
App Version".versionIdToName($ob->versionId)."
Maintainer request reason
Email reply
Email
' ,"\n"; echo '
' ,"\n"; echo '
',"\n"; echo '',"\n"; echo '',"\n"; echo html_frame_end(" "); echo html_back_link(1,'adminMaintainerQueue.php'); } else if ($_REQUEST['add'] && $_REQUEST['queueId']) { //add this user, app and version to the database $statusMessage = ""; $goodtogo = 0; // insert the new entry into the maintainers list $query = "INSERT into appMaintainers VALUES(null,". "$ob->appId,". "$ob->versionId,". "$ob->userId,". "$ob->superMaintainer,". "NOW());"; if (mysql_query($query)) { $statusMessage = "

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()."

\n"; } //Send Status Email if (lookupEmail($ob->userId) && $goodtogo) { $ms = "Application Maintainer Request Report\n"; $ms .= "----------------------------------\n\n"; $ms .= "Your application to be the maintainer of ".appIdToName($ob->appId).versionIdToName($ob->versionId)." has been accepted. "; $ms .= "We appreciate your help in making the Application Database better for all users.\n\n"; $ms .= "Thanks!\n"; $ms .= "-The AppDB admins\n"; mail(stripslashes(lookupEmail($ob->userId)),'[AppDB] Maintainer Request Report',$ms); } //done echo html_frame_start("Submit Maintainer","600"); echo "

$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 "

\n\n"; //show applist echo html_frame_start("","90%","",0); echo "\n\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n\n"; $c = 1; while($ob = mysql_fetch_object($result)) { if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if($ob->superMaintainer) { echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } echo " \n"; echo " \n"; echo "\n\n"; $c++; } echo "
Submission DateQueue IdUsernameApplication NameVersionSuper maintainer?Submitter Email 
".date("Y-n-t h:i:sa", $ob->submitTime)."  $ob->queueId".lookupUsername($ob->userId)."".appIdToName($ob->appId)."N/AYes".versionIdToName($ob->versionId)."  No".lookupEmail($ob->userId)."  [reject]
\n\n"; echo html_frame_end(" "); } } echo ""; apidb_footer(); ?>