add support for application maintainers

This commit is contained in:
Chris Morgan
2004-11-09 22:41:18 +00:00
committed by Jeremy Newman
parent 073acaff01
commit c81eebd949
14 changed files with 793 additions and 38 deletions

47
include/maintainer.php Normal file
View File

@@ -0,0 +1,47 @@
<?
/*
* get the applications and versions that this userId maintains
*/
function getAppsFromUserId($userId)
{
$result = mysql_query("SELECT appId, versionId FROM ".
"appMaintainers WHERE userId = '$userId'");
if(mysql_num_rows($result) == 0)
return;
$retval = array();
$c = 0;
while($row = mysql_fetch_object($result))
{
$retval[$c] = array($row->appId, $row->versionId);
$c++;
}
return $retval;
}
/*
* get the userIds of maintainers for this appId and versionId
*/
function getMaintainersUserIdsFromAppIdVersionId($appId, $versionId)
{
$query = "SELECT userId FROM ".
"appMaintainers WHERE appId = '$appId' " .
"AND versionId = '$versionId';";
$result = mysql_query($query);
if(mysql_num_rows($result) == 0)
return; // no sub categories
$retval = array();
$c = 0;
while($row = mysql_fetch_object($result))
{
$retval[$c] = array($row->userId);
$c++;
}
return $retval;
}
?>