From 96df720bb65cacc36e2b587da41a7a50beeec3fd Mon Sep 17 00:00:00 2001 From: Jonathan Ernst Date: Mon, 7 Feb 2005 23:55:42 +0000 Subject: [PATCH] - 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 --- include/sidebar_login.php | 3 +-- include/user.php | 18 ++++-------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/include/sidebar_login.php b/include/sidebar_login.php index 664457b..7d1b195 100644 --- a/include/sidebar_login.php +++ b/include/sidebar_login.php @@ -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(); } - ?> diff --git a/include/user.php b/include/user.php index c537989..ecc3228 100644 --- a/include/user.php +++ b/include/user.php @@ -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."'"; }