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 '
',"\n"; $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->versionId); if($other_users) { $foundMaintainers = true; while(list($index, $userIdValue) = each($other_users)) { $oUser = new User($userIdValue); if($firstDisplay) { echo "\n"; $firstDisplay = false; } else { echo "\n"; } } } $other_users = getSuperMaintainersUserIdsFromAppId($ob->appId); if($other_users) { $foundMaintainers = true; while(list($index, $userIdValue) = each($other_users)) { $oUser = new User($userIdValue); 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)) { $oApp = new Application($appIdOther); $oVersion = new Application($versionIdOther); if($firstDisplay) { $firstDisplay = false; if($superMaintainerOther) echo "\n"; else echo "\n"; } else { if($superMaintainerOther) echo "\n"; else echo "\n"; } } } else { echo "\n"; } $oApp = new Application($ob->appId); $oVersion = new Application($ob->versionId); //app name echo '',"\n"; echo "\n"; //version echo '',"\n"; echo "\n"; //maintainReason echo '',"\n"; echo '',"\n"; //email response echo '',"\n"; echo "\n"; /* Add button */ echo '',"\n"; /* Reject button */ echo '',"\n"; echo '
Other maintainers of this app:".$oUser->sRealname."
".$oUser->sRealname."
".$oUser->sRealname."*
".$oUser->sRealname."*
No other maintainers
This user also maintains these apps:".$oApp->sName."*
".$oApp->sName." ".$oVersion->sName."
".$oApp->sName."*
".$oApp->sName." ".$oVersion->sName."
User maintains no other applications
App Name".$oApp->sName."
App Version".$oVersion->sName."
Maintainer request reason
Email reply
' ,"\n"; echo '
' ,"\n"; echo '
',"\n"; echo '',"\n"; echo '',"\n"; echo html_frame_end(" "); echo html_back_link(1,'adminMaintainerQueue.php'); 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 '
',"\n"; //get available maintainers $query = "SELECT queueId, appId, versionId,". "userId, maintainReason,". "superMaintainer,". "submitTime as submitTime ". "from appMaintainerQueue;"; $result = query_appdb($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\n"; $c = 1; while($ob = mysql_fetch_object($result)) { $oUser = new User($ob->userId); $oApp = new Application($ob->appId); $oVersion = new Version($ob->versionId); if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } 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 DateApplication NameVersionSuper maintainer?SubmitterAction
".print_date(mysqldatetime_to_unixtimestamp($ob->submitTime))."  ".$oApp->sName."N/AYes".$oVersion->sName."  NosEmail."\">".$oUser->sRealname."[queueId\">answer]
\n\n"; echo html_frame_end(" "); echo "
"; apidb_footer(); } } ?>