- fix isMaintainer and isSuperMaintainer

- make the correct button appear in appview (be a maintainer/stop to be a maintainer)
- make the list of maintained applications reappear on the left menu
This commit is contained in:
Jonathan Ernst
2005-02-07 23:55:42 +00:00
committed by WineHQ
parent 99ec3e804d
commit 96df720bb6
2 changed files with 5 additions and 16 deletions

View File

@@ -19,7 +19,7 @@ function global_sidebar_login() {
/* if this user maintains any applications list them */
/* in their sidebar */
$apps_user_maintains = getAppsFromUserId($_SESSION['current']->iUserid);
$apps_user_maintains = getAppsFromUserId($_SESSION['current']->iUserId);
if($apps_user_maintains)
{
$g->addmisc("");
@@ -41,5 +41,4 @@ function global_sidebar_login() {
$g->done();
}
?>

View File

@@ -194,24 +194,14 @@ class User {
/**
* Check if this user is a maintainer of a given appId/versionId.
*/
function isMaintainer($iAppId=null, $iVersionId=null)
function isMaintainer($iVersionId=null)
{
if(!$this->isLoggedIn()) 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->isSuperMaintainer($iAppId))
if($iVersionId)
{
return true;
}
if($iAppId && $iVersionId)
{
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '".$this->iUserId."' AND appId = '".$iAppId."' AND versionId = '$iVersionId'";
} elseif($iAppId) // isMaintainer ? and we only provided appId => isSupermaintainer.
{
return $this->isSuperMaintainer($iAppId);
} else
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '".$this->iUserId."' AND versionId = '$iVersionId'";
} else // are we maintaining any version ?
{
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '".$this->iUserId."'";
}