Fix 'Using $this when not in object context error' by using the same method used in Application::canEdit() and Appliction::objectGetEntries()

This commit is contained in:
Chris Morgan
2007-09-24 22:09:01 -04:00
parent 09466f59a1
commit e07e0f5f11

View File

@@ -1372,7 +1372,7 @@ class version {
if($_SESSION['current']->hasPriv("admin")) if($_SESSION['current']->hasPriv("admin"))
return TRUE; return TRUE;
else if($this->iVersionId) if(isset($this) && is_object($this) && $this->iVersionId)
{ {
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId)) if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
return TRUE; return TRUE;
@@ -1381,9 +1381,10 @@ class version {
return TRUE; return TRUE;
return FALSE; return FALSE;
} } else
else {
return FALSE; return FALSE;
}
} }
public function mustBeQueued() public function mustBeQueued()
@@ -1451,7 +1452,7 @@ class version {
$iRows = maintainer::objectGetEntriesCount($bQueued, $bRejected); $iRows = maintainer::objectGetEntriesCount($bQueued, $bRejected);
} }
if($bQueued && !$this->canEdit()) if($bQueued && !version::canEdit())
{ {
/* Users should see their own rejected entries, but maintainers should /* Users should see their own rejected entries, but maintainers should
not be able to see rejected entries for versions they maintain */ not be able to see rejected entries for versions they maintain */