- 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:
@@ -19,7 +19,7 @@ function global_sidebar_login() {
|
|||||||
|
|
||||||
/* if this user maintains any applications list them */
|
/* if this user maintains any applications list them */
|
||||||
/* in their sidebar */
|
/* in their sidebar */
|
||||||
$apps_user_maintains = getAppsFromUserId($_SESSION['current']->iUserid);
|
$apps_user_maintains = getAppsFromUserId($_SESSION['current']->iUserId);
|
||||||
if($apps_user_maintains)
|
if($apps_user_maintains)
|
||||||
{
|
{
|
||||||
$g->addmisc("");
|
$g->addmisc("");
|
||||||
@@ -41,5 +41,4 @@ function global_sidebar_login() {
|
|||||||
$g->done();
|
$g->done();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -194,24 +194,14 @@ class User {
|
|||||||
/**
|
/**
|
||||||
* Check if this user is a maintainer of a given appId/versionId.
|
* 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->isLoggedIn()) return false;
|
||||||
|
|
||||||
/* if this user is a super maintainer of this appid then they */
|
if($iVersionId)
|
||||||
/* are a maintainer of all of the versionId's of it as well */
|
|
||||||
if($this->isSuperMaintainer($iAppId))
|
|
||||||
{
|
{
|
||||||
return true;
|
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '".$this->iUserId."' AND versionId = '$iVersionId'";
|
||||||
}
|
} else // are we maintaining any version ?
|
||||||
|
|
||||||
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."'";
|
$sQuery = "SELECT * FROM appMaintainers WHERE userid = '".$this->iUserId."'";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user