Merge appMaintainerQueue table into appMaintainers table. This simplifies the handling of queued vs.

unqueued maintainers and removes a table from the database
This commit is contained in:
Chris Morgan
2006-07-16 16:53:08 +00:00
committed by WineHQ
parent ed2cbe739d
commit 0b9a5b4e94
8 changed files with 104 additions and 74 deletions

View File

@@ -14,7 +14,7 @@ require_once(BASE."include/mail.php");
$aClean = array(); //array of filtered user input $aClean = array(); //array of filtered user input
$aClean['sSub'] = makeSafe( $_REQUEST['sSub'] ); $aClean['sSub'] = makeSafe( $_REQUEST['sSub'] );
$aClean['iQueueId'] = makeSafe( $_REQUEST['iQueueId'] ); $aClean['iMaintainerId'] = makeSafe( $_REQUEST['iMaintainerId'] );
$aClean['sAdd'] = makeSafe( $_REQUEST['sAdd'] ); $aClean['sAdd'] = makeSafe( $_REQUEST['sAdd'] );
$aClean['sReject'] = makeSafe( $_REQUEST['sReject'] ); $aClean['sReject'] = makeSafe( $_REQUEST['sReject'] );
$aClean['sReplyText'] = makeSafe( $_REQUEST['sReplyText'] ); $aClean['sReplyText'] = makeSafe( $_REQUEST['sReplyText'] );
@@ -25,14 +25,14 @@ if(!$_SESSION['current']->hasPriv("admin"))
if ($aClean['sSub']) if ($aClean['sSub'])
{ {
if ($aClean['iQueueId']) if ($aClean['iMaintainerId'])
{ {
//get data //get data
$sQuery = "SELECT queueId, appId, versionId,". $sQuery = "SELECT maintainerId, appId, versionId,".
"userId, maintainReason, superMaintainer,". "userId, maintainReason, superMaintainer,".
"UNIX_TIMESTAMP(submitTime) as submitTime ". "UNIX_TIMESTAMP(submitTime) as submitTime ".
"FROM appMaintainerQueue WHERE queueId = '?'"; "FROM appMaintainers WHERE maintainerId = '?' AND queued = 'true'";
$hResult = query_parameters($sQuery, $aClean['iQueueId']); $hResult = query_parameters($sQuery, $aClean['iMaintainerId']);
$oRow = mysql_fetch_object($hResult); $oRow = mysql_fetch_object($hResult);
$oUser = new User($oRow->userId); $oUser = new User($oRow->userId);
mysql_free_result($hResult); mysql_free_result($hResult);
@@ -44,7 +44,7 @@ if ($aClean['sSub'])
} }
//process according to which request was submitted and optionally the sub flag //process according to which request was submitted and optionally the sub flag
if (!$aClean['sAdd'] && !$aClean['sReject'] && $aClean['iQueueId']) if (!$aClean['sAdd'] && !$aClean['sReject'] && $aClean['iMaintainerId'])
{ {
apidb_header("Admin Maintainer Queue"); apidb_header("Admin Maintainer Queue");
echo '<form name="sQform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n"; echo '<form name="sQform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
@@ -171,7 +171,7 @@ if ($aClean['sSub'])
echo '</table>',"\n"; echo '</table>',"\n";
echo '<input type=hidden name="sSub" value="inside_form" />',"\n"; echo '<input type=hidden name="sSub" value="inside_form" />',"\n";
echo '<input type=hidden name="iQueueId" value="'.$aClean['iQueueId'].'" />',"\n"; echo '<input type=hidden name="iMaintainerId" value="'.$aClean['iMaintainerId'].'" />',"\n";
echo html_frame_end("&nbsp;"); echo html_frame_end("&nbsp;");
echo html_back_link(1,'adminMaintainerQueue.php'); echo html_back_link(1,'adminMaintainerQueue.php');
@@ -180,7 +180,7 @@ if ($aClean['sSub'])
exit; exit;
} }
else if ($aClean['sAdd'] && $aClean['iQueueId']) else if ($aClean['sAdd'] && $aClean['iMaintainerId'])
{ {
/* create a new user object for the maintainer */ /* create a new user object for the maintainer */
$oMaintainerUser = new User($oRow->userId); $oMaintainerUser = new User($oRow->userId);
@@ -188,11 +188,11 @@ if ($aClean['sSub'])
/* add the user as a maintainer and return the statusMessage */ /* add the user as a maintainer and return the statusMessage */
$sStatusMessage = $oMaintainerUser->addAsMaintainer($oRow->appId, $oRow->versionId, $sStatusMessage = $oMaintainerUser->addAsMaintainer($oRow->appId, $oRow->versionId,
$oRow->superMaintainer, $oRow->superMaintainer,
$aClean['iQueueId']); $aClean['iMaintainerId']);
//done //done
addmsg("<p><b>$sStatusMessage</b></p>", 'green'); addmsg("<p><b>$sStatusMessage</b></p>", 'green');
} }
else if (($aClean['sReject'] || ($aClean['sSub'] == 'sReject')) && $aClean['iQueueId']) else if (($aClean['sReject'] || ($aClean['sSub'] == 'sReject')) && $aClean['iMaintainerId'])
{ {
$sEmail = $oUser->sEmail; $sEmail = $oUser->sEmail;
if ($sEmail) if ($sEmail)
@@ -209,8 +209,8 @@ if ($aClean['sSub'])
} }
//delete main item //delete main item
$sQuery = "DELETE from appMaintainerQueue where queueId = '?'"; $sQuery = "DELETE from appMaintainers where maintainerId = '?'";
$hResult = query_parameters($sQuery, $aClean['iQueueId']); $hResult = query_parameters($sQuery, $aClean['iMaintainerId']);
if(!$hResult) addmsg("unable to delete selected maintainer application", "red"); if(!$hResult) addmsg("unable to delete selected maintainer application", "red");
echo html_frame_start("Delete maintainer application",400,"",0); echo html_frame_start("Delete maintainer application",400,"",0);
if($hResult) if($hResult)
@@ -233,11 +233,11 @@ if ($aClean['sSub'])
echo '<form name="sQform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n"; echo '<form name="sQform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
//get available maintainers //get available maintainers
$sQuery = "SELECT queueId, appId, versionId,". $sQuery = "SELECT maintainerId, appId, versionId,".
"userId, maintainReason,". "userId, maintainReason,".
"superMaintainer,". "superMaintainer,".
"submitTime as submitTime ". "submitTime as submitTime ".
"from appMaintainerQueue;"; "FROM appMaintainers WHERE queued='true';";
$hResult = query_parameters($sQuery); $hResult = query_parameters($sQuery);
if(!$hResult || !mysql_num_rows($hResult)) if(!$hResult || !mysql_num_rows($hResult))
@@ -291,7 +291,7 @@ if ($aClean['sSub'])
} }
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n"; echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
echo " <td>[<a href=\"adminMaintainerQueue.php?sSub=view&iQueueId=$oRow->queueId\">answer</a>]</td>\n"; echo " <td>[<a href=\"adminMaintainerQueue.php?sSub=view&iMaintainerId=$oRow->maintainerId\">answer</a>]</td>\n";
echo "</tr>\n\n"; echo "</tr>\n\n";
$iRowCount++; $iRowCount++;
} }

View File

@@ -40,7 +40,7 @@ if ($aClean['sSub'])
{ {
// get available maintainers // get available maintainers
$sQuery = "SELECT * FROM appMaintainers, user_list where appMaintainers.userId = user_list.userid"; $sQuery = "SELECT * FROM appMaintainers, user_list where appMaintainers.userId = user_list.userid";
$sQuery.= " ORDER BY realname;"; $sQuery.= " AND queued='false' ORDER BY realname;";
$hResult = query_parameters($sQuery); $hResult = query_parameters($sQuery);
if(!$hResult || !mysql_num_rows($hResult)) if(!$hResult || !mysql_num_rows($hResult))

View File

@@ -6,12 +6,12 @@
/* /*
* get the userIds of super maintainers for this appId * get the userIds of super maintainers for this appId
*/ */
function getSuperMaintainersUserIdsFromAppId($appId) function getSuperMaintainersUserIdsFromAppId($iAppId)
{ {
$sQuery = "SELECT userId FROM ". $sQuery = "SELECT userId FROM ".
"appMaintainers WHERE appId = '?' " . "appMaintainers WHERE appId = '?' " .
"AND superMaintainer = '1';"; "AND superMaintainer = '1' AND queued='?';";
$hResult = query_parameters($sQuery, $appId); $hResult = query_parameters($sQuery, $iAppId, "false");
$retval = array(); $retval = array();
$c = 0; $c = 0;
while($oRow = mysql_fetch_object($hResult)) while($oRow = mysql_fetch_object($hResult))

View File

@@ -261,12 +261,12 @@ class User {
/* otherwise check if we maintain this specific version */ /* otherwise check if we maintain this specific version */
if($iVersionId) if($iVersionId)
{ {
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND versionId = '?'"; $sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND versionId = '?' AND queued = '?'";
$hResult = query_parameters($sQuery, $this->iUserId, $iVersionId); $hResult = query_parameters($sQuery, $this->iUserId, $iVersionId, "false");
} else // are we maintaining any version ? } else // are we maintaining any version ?
{ {
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '?'"; $sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND queued = '?'";
$hResult = query_parameters($sQuery, $this->iUserId); $hResult = query_parameters($sQuery, $this->iUserId, "false");
} }
if(!$hResult) if(!$hResult)
return false; return false;
@@ -284,12 +284,12 @@ class User {
if($iAppId) if($iAppId)
{ {
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND appId = '?' AND superMaintainer = '1'"; $sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND appId = '?' AND superMaintainer = '1' AND queued = '?'";
$hResult = query_parameters($sQuery, $this->iUserId, $iAppId); $hResult = query_parameters($sQuery, $this->iUserId, $iAppId, "false");
} else /* are we super maintainer of any applications? */ } else /* are we super maintainer of any applications? */
{ {
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND superMaintainer = '1'"; $sQuery = "SELECT * FROM appMaintainers WHERE userid = '?' AND superMaintainer = '1' AND queued = '?'";
$hResult = query_parameters($sQuery, $this->iUserId); $hResult = query_parameters($sQuery, $this->iUserId, "false");
} }
if(!$hResult) if(!$hResult)
return false; return false;
@@ -304,7 +304,8 @@ class User {
/* retrieve the list of application and order them by application name */ /* retrieve the list of application and order them by application name */
$hResult = query_parameters("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ". $hResult = query_parameters("SELECT appMaintainers.appId, versionId, superMaintainer, appName FROM ".
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ". "appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
"AND userId = '?' ORDER BY appName", $this->iUserId); "AND userId = '?' AND appMaintainers.queued = '?' ORDER BY appName",
$this->iUserId, "false");
if(!$hResult || mysql_num_rows($hResult) == 0) if(!$hResult || mysql_num_rows($hResult) == 0)
return NULL; return NULL;
@@ -323,8 +324,9 @@ class User {
{ {
if(!$this->isLoggedIn()) return 0; if(!$this->isLoggedIn()) return 0;
$sQuery = "SELECT count(*) as cnt from appMaintainers WHERE userid = '?' AND superMaintainer = '?'"; $sQuery = "SELECT count(*) as cnt from appMaintainers WHERE userid = '?' AND superMaintainer = '?'".
$hResult = query_parameters($sQuery, $this->iUserId, $bSuperMaintainer); " AND queued ='?'";
$hResult = query_parameters($sQuery, $this->iUserId, $bSuperMaintainer ? "1" : "0", "false");
if(!$hResult) if(!$hResult)
return 0; return 0;
$oRow = mysql_fetch_object($hResult); $oRow = mysql_fetch_object($hResult);
@@ -335,8 +337,10 @@ class User {
/** /**
* Add the user as a maintainer * Add the user as a maintainer
*/ */
function addAsMaintainer($iAppId, $iVersionId, $bSuperMaintainer, $iQueueId) //FIXME: we really don't need any parameter except $iMaintainerId here
{ // we'll clean this up when we clean up maintainers
function addAsMaintainer($iAppId, $iVersionId, $bSuperMaintainer, $iMaintainerId)
{
$aClean = array(); $aClean = array();
$aClean['sReplyText'] = makeSafe($_REQUEST['sReplyText']); $aClean['sReplyText'] = makeSafe($_REQUEST['sReplyText']);
@@ -347,18 +351,14 @@ class User {
if(!$this->isSuperMaintainer($iAppId) && if(!$this->isSuperMaintainer($iAppId) &&
((!$bSuperMaintainer && !$this->isMaintainer($iVersionId)) | $bSuperMaintainer)) ((!$bSuperMaintainer && !$this->isMaintainer($iVersionId)) | $bSuperMaintainer))
{ {
// insert the new entry into the maintainers list /* unqueue the maintainer entry */
$hResult = query_parameters("INSERT INTO appMaintainers (maintainerId, appId,". $hResult = query_parameters("UPDATE appMaintainers SET queued='false' WHERE userId = '?' AND maintainerId = '?'",
"versionId, userId, superMaintainer, submitTime) ". $this->iUserId, $iMaintainerId);
"VALUES (?, '?', '?', '?', '?', ?)",
"null", $iAppId, $iVersionId, $this->iUserId,
$bSuperMaintainer, "NOW()");
if($hResult) if($hResult)
{ {
$statusMessage = "<p>The maintainer was successfully added into the database</p>\n"; $statusMessage = "<p>The maintainer was successfully added into the database</p>\n";
//delete the item from the queue
query_parameters("DELETE from appMaintainerQueue where queueId = '?'", $iQueueId);
$oApp = new Application($iAppId); $oApp = new Application($iAppId);
$oVersion = new Version($iVersionId); $oVersion = new Version($iVersionId);
//Send Status Email //Send Status Email
@@ -376,7 +376,8 @@ class User {
} else } else
{ {
//delete the item from the queue //delete the item from the queue
query_parameters("DELETE from appMaintainerQueue where queueId = '?'", $iQueueId); query_parameters("DELETE from appMaintainers WHERE userId = '?' AND maintainerId = '?'",
$this->iUserId, $iMaintainerId);
if($this->isSuperMaintainer($iAppId) && !$bSuperMaintainer) if($this->isSuperMaintainer($iAppId) && !$bSuperMaintainer)
$statusMessage = "<p>User is already a super maintainer of this application</p>\n"; $statusMessage = "<p>User is already a super maintainer of this application</p>\n";
@@ -437,7 +438,7 @@ class User {
{ {
/* find all queued versions of applications that the user is a super maintainer of */ /* find all queued versions of applications that the user is a super maintainer of */
$hResult = query_parameters("SELECT count(*) as queued_versions FROM appVersion, appMaintainers $hResult = query_parameters("SELECT count(*) as queued_versions FROM appVersion, appMaintainers
WHERE queued='true' AND appMaintainers.superMaintainer ='1' WHERE Appversion.queued='true' AND appMaintainers.superMaintainer ='1'
AND appVersion.appId = appMaintainers.appId AND appVersion.appId = appMaintainers.appId
AND appMaintainers.userId ='?'", $this->iUserId); AND appMaintainers.userId ='?'", $this->iUserId);
} }
@@ -606,7 +607,7 @@ class User {
if($queryAppFamily) if($queryAppFamily)
{ {
$sQuery = "SELECT appFamily.appId FROM appFamily, appMaintainers $sQuery = "SELECT appFamily.appId FROM appFamily, appMaintainers
WHERE queued = 'true' WHERE appFamily.queued = 'true'
AND appFamily.appId = appMaintainers.appId AND appFamily.appId = appMaintainers.appId
AND appMaintainers.superMaintainer = '1' AND appMaintainers.superMaintainer = '1'
AND appMaintainers.userId = '".mysql_real_escape_string($this->iUserId)."';"; AND appMaintainers.userId = '".mysql_real_escape_string($this->iUserId)."';";
@@ -848,7 +849,7 @@ class User {
$hResult = query_parameters("SELECT appMaintainers.userId $hResult = query_parameters("SELECT appMaintainers.userId
FROM appMaintainers, appVersion FROM appMaintainers, appVersion
WHERE appVersion.appId = appMaintainers.appId WHERE appVersion.appId = appMaintainers.appId
AND appVersion.versionId = '?'", AND appVersion.versionId = '?' AND appMaintainers.queued = 'false'",
$iVersionId); $iVersionId);
} }
/* /*
@@ -858,7 +859,7 @@ class User {
{ {
$hResult = query_parameters("SELECT userId $hResult = query_parameters("SELECT userId
FROM appMaintainers FROM appMaintainers
WHERE appId = '?'", WHERE appId = '?' AND queued = 'false'",
$iAppId); $iAppId);
} }

View File

@@ -187,7 +187,7 @@ function make_maintainer_rating_list($varname, $cvalue)
/* get the number of queued maintainers */ /* get the number of queued maintainers */
function getQueuedMaintainerCount() function getQueuedMaintainerCount()
{ {
$sQuery = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue"; $sQuery = "SELECT count(*) as queued_maintainers FROM appMaintainers where queued='true'";
$hResult = query_parameters($sQuery); $hResult = query_parameters($sQuery);
$oRow = mysql_fetch_object($hResult); $oRow = mysql_fetch_object($hResult);
return $oRow->queued_maintainers; return $oRow->queued_maintainers;
@@ -196,7 +196,7 @@ function getQueuedMaintainerCount()
/* get the total number of maintainers and applications in the appMaintainers table */ /* get the total number of maintainers and applications in the appMaintainers table */
function getMaintainerCount() function getMaintainerCount()
{ {
$sQuery = "SELECT count(*) as maintainers FROM appMaintainers"; $sQuery = "SELECT count(*) as maintainers FROM appMaintainers where queued='false'";
$hResult = query_parameters($sQuery); $hResult = query_parameters($sQuery);
$oRow = mysql_fetch_object($hResult); $oRow = mysql_fetch_object($hResult);
return $oRow->maintainers; return $oRow->maintainers;
@@ -230,7 +230,7 @@ function getNumberOfVersions()
/* Get the number of maintainers in the database */ /* Get the number of maintainers in the database */
function getNumberOfMaintainers() function getNumberOfMaintainers()
{ {
$hResult = query_parameters("SELECT DISTINCT userId FROM appMaintainers;"); $hResult = query_parameters("SELECT DISTINCT userId FROM appMaintainers WHERE queued='false';");
return mysql_num_rows($hResult); return mysql_num_rows($hResult);
} }

View File

@@ -85,17 +85,20 @@ if( $aClean['sMaintainReason'] )
apidb_header("Submit Maintainer Request"); apidb_header("Submit Maintainer Request");
// add to queue // add to queue
$hResult = query_parameters("INSERT INTO appMaintainerQueue (queueId, appId, versionId, ". $hResult = query_parameters("INSERT INTO appMaintainers (appId, versionId, ".
"userId, maintainReason, superMaintainer, submitTime) ". "userId, maintainReason, superMaintainer, submitTime, queued) ".
"VALUES (?, '?', '?', '?', '?', '?', ?)", "VALUES ('?', '?', '?', '?', '?', ?, '?')",
"null", $aClean['iAppId'], $aClean['iVersionId'], $aClean['iAppId'], $aClean['iVersionId'],
$_SESSION['current']->iUserId, $aClean['sMaintainReason'], $_SESSION['current']->iUserId, $aClean['sMaintainReason'],
$aClean['iSuperMaintainer'], "NOW()"); $aClean['iSuperMaintainer'], "NOW()", 'true');
if ($hResult) if ($hResult)
{ {
echo "<p>Your maintainer request has been submitted for review. You should hear back\n"; echo "<p>Your maintainer request has been submitted for review. You should hear back\n";
echo "soon about the status of your submission</p>\n"; echo "soon about the status of your submission</p>\n";
} else
{
addmsg("Error submitting maintainer request. Please contact the appdb admins at appdb@winehq.org", "red");
} }
} else } else
{ {

View File

@@ -7,28 +7,18 @@ drop table if exists appMaintainers;
* List of the application maintainers. These users have the rights * List of the application maintainers. These users have the rights
* to delete comments, edit the application description and otherwise * to delete comments, edit the application description and otherwise
* care for an application. * care for an application.
*
* We also store the reason they asked to be a maintainer since we use this table
* for both queued and unqueued maintainers
*/ */
create table appMaintainers ( create table appMaintainers (
maintainerId int not null auto_increment, maintainerId int not null auto_increment,
appId int, appId int,
versionId int, versionId int,
userId int, userId int,
superMaintainer bool,
submitTime datetime,
key(maintainerId)
);
/*
* Queue where users names will go if they request to become an application
* maintainer. This includes the reason they want to become a maintainer.
*/
create table appMaintainerQueue (
queueId int not null auto_increment,
appId int,
versionId int,
userId int,
maintainReason text, maintainReason text,
superMaintainer bool, superMaintainer bool,
submitTime datetime, submitTime datetime,
key(queueId) queued enum('true','false','rejected') NOT NULL default 'false';
key(maintainerId)
); );

View File

@@ -297,8 +297,20 @@ function test_user_getMaintainerCount()
*/ */
$iAppId = 655000; $iAppId = 655000;
$iVersionId = 655200; $iVersionId = 655200;
$iQueueId = 655300;
$statusMessage = $oUser->addAsMaintainer($iAppId, $iVersionId, TRUE, $iQueueId); //FIXME: when we clean up maintainers we'll want to clean this code up as well
/* queue up the maintainership */
// add to queue
$hResult = query_parameters("INSERT INTO appMaintainers (appId, versionId, ".
"userId, maintainReason, superMaintainer, submitTime, queued) ".
"VALUES ('?', '?', '?', '?', '?', ?, '?')",
$iAppId, $iVersionId,
$_SESSION['current']->iUserId, "Some crazy reason",
TRUE ? "1" : "0", "NOW()", 'true');
$iMaintainerId = mysql_insert_id();
$statusMessage = $oUser->addAsMaintainer($iAppId, $iVersionId, TRUE, $iMaintainerId);
/* see that the user is a super maintainer of the one application we added them to be */ /* see that the user is a super maintainer of the one application we added them to be */
$iExpected = 1; /* we expect 1 super maintainer for this user */ $iExpected = 1; /* we expect 1 super maintainer for this user */
@@ -327,7 +339,19 @@ function test_user_getMaintainerCount()
/** /**
* make the user a maintainer * make the user a maintainer
*/ */
$statusMessage = $oUser->addAsMaintainer($iAppId, $iVersionId, FALSE, $iQueueId); //FIXME: when we clean up maintainers we'll want to clean this code up as well
/* queue up the maintainership */
// add to queue
$hResult = query_parameters("INSERT INTO appMaintainers (appId, versionId, ".
"userId, maintainReason, superMaintainer, submitTime, queued) ".
"VALUES ('?', '?', '?', '?', '?', ?, '?')",
$iAppId, $iVersionId,
$_SESSION['current']->iUserId, "Some crazy reason",
FALSE ? "1" : "0", "NOW()", 'true');
$iMaintainerId = mysql_insert_id();
$statusMessage = $oUser->addAsMaintainer($iAppId, $iVersionId, FALSE, $iMaintainerId);
/* see that the user is a super maintainer of no applications */ /* see that the user is a super maintainer of no applications */
$iExpected = 0; /* we expect 1 super maintainer for this user */ $iExpected = 0; /* we expect 1 super maintainer for this user */
@@ -388,9 +412,21 @@ function test_user_getAppsMaintained()
*/ */
$iAppId = $oApp->iAppId; /* use the iAppId of the application we just created */ $iAppId = $oApp->iAppId; /* use the iAppId of the application we just created */
$iVersionId = 655200; $iVersionId = 655200;
$iQueueId = 655300;
$bSuperMaintainer = TRUE; $bSuperMaintainer = TRUE;
$statusMessage = $oUser->addAsMaintainer($iAppId, $iVersionId, $bSuperMaintainer, $iQueueId);
//FIXME: when we clean up maintainers we'll want to clean this code up as well
/* queue up the maintainership */
// add to queue
$hResult = query_parameters("INSERT INTO appMaintainers (appId, versionId, ".
"userId, maintainReason, superMaintainer, submitTime, queued) ".
"VALUES ('?', '?', '?', '?', '?', ?, '?')",
$iAppId, $iVersionId,
$_SESSION['current']->iUserId, "Some crazy reason",
$bSuperMaintainer ? "1" : "0", "NOW()", 'true');
$iMaintainerId = mysql_insert_id();
$statusMessage = $oUser->addAsMaintainer($iAppId, $iVersionId, $bSuperMaintainer, $iMaintainerId);
/* get an array of the apps maintained */ /* get an array of the apps maintained */
$aAppsMaintained = $oUser->getAppsMaintained(); $aAppsMaintained = $oUser->getAppsMaintained();