Add support for application wide maintainers, super maintainers, that are

maintainers for all versions of a particular application.
This commit is contained in:
Chris Morgan
2004-12-10 00:18:01 +00:00
committed by WineHQ
parent 06a0ea4812
commit 3fa8a3bd7a
10 changed files with 393 additions and 148 deletions

View File

@@ -226,6 +226,13 @@ class User {
if(!loggedin() || !$this->userid)
return false;
/* if this user is a super maintainer of this appid then they */
/* are a maintainer of all of the versionId's of it as well */
if($this->is_super_maintainer($appId))
{
return true;
}
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND versionId = '$versionId'";
$result = mysql_query($query, $this->link);
if(!$result)
@@ -233,6 +240,22 @@ class User {
return mysql_num_rows($result);
}
/*
* check if this user is an maintainer of a given appId/versionId
*/
function is_super_maintainer($appId)
{
global $current;
if(!loggedin() || !$this->userid)
return false;
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND superMaintainer = 1";
$result = mysql_query($query, $this->link);
if(!$result)
return 0;
return mysql_num_rows($result);
}
function addpriv($priv)
{
if(!$this->userid || !$priv)
@@ -302,6 +325,16 @@ function isMaintainer($appId, $versionId)
return $current->is_maintainer($appId, $versionId);
}
function isSuperMaintainer($appId)
{
global $current;
if(!loggedin())
return false;
return $current->is_super_maintainer($appId);
}
function debugging()
{
global $current;