Fix url::canEdit() to not call undefined functions
This commit is contained in:
committed by
WineHQ
parent
20ebe74913
commit
a309317347
@@ -903,6 +903,8 @@ class Application {
|
|||||||
{
|
{
|
||||||
if($_SESSION['current']->hasPriv("admin"))
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
else if($this)
|
||||||
|
return maintainer::isUserSuperMaintainer($_SESSION['current'], $this->iAppId);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -453,17 +453,18 @@ class Url {
|
|||||||
|
|
||||||
function canEdit($iVersionId, $iAppId = NULL)
|
function canEdit($iVersionId, $iAppId = NULL)
|
||||||
{
|
{
|
||||||
$oUser = new User($_SESSION['current']->iUserId);
|
if($_SESSION['current']->hasPriv("admin"))
|
||||||
|
|
||||||
if($oUser->hasPriv("admin") || ($iVersionId &&
|
|
||||||
maintainer::isUserMaintainer($oUser, $iVersionId)) || ($iAppId &&
|
|
||||||
maintainer::isSuperMaintainer($oUser, $iAppId)))
|
|
||||||
{
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else
|
else if($iVersionId)
|
||||||
{
|
{
|
||||||
|
$oVersion = new version($iVersionId);
|
||||||
|
return $oVersion->canEdit();
|
||||||
|
} else if($iAppId)
|
||||||
|
{
|
||||||
|
$oApp = new application($iAppId);
|
||||||
|
return $oApp->canEdit();
|
||||||
|
} else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display links for a given version/application */
|
/* Display links for a given version/application */
|
||||||
|
|||||||
Reference in New Issue
Block a user