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."'"; }