Module: appdb
Branch: master
Commit: e07e0f5f11e445c69ca2374d970f87e6d935e58a
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=e07e0f5f11e445c69ca2374d…
Author: Chris Morgan <cmorgan(a)alum.wpi.edu>
Date: Mon Sep 24 22:09:01 2007 -0400
Fix 'Using $this when not in object context error' by using the same method used in Application::canEdit() and Appliction::objectGetEntries()
---
include/version.php | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/version.php b/include/version.php
index 513ba1a..18a4e2b 100644
--- a/include/version.php
+++ b/include/version.php
@@ -1372,7 +1372,7 @@ class version {
if($_SESSION['current']->hasPriv("admin"))
return TRUE;
- else if($this->iVersionId)
+ if(isset($this) && is_object($this) && $this->iVersionId)
{
if(maintainer::isUserMaintainer($_SESSION['current'], $this->iVersionId))
return TRUE;
@@ -1381,9 +1381,10 @@ class version {
return TRUE;
return FALSE;
- }
- else
+ } else
+ {
return FALSE;
+ }
}
public function mustBeQueued()
@@ -1451,7 +1452,7 @@ class version {
$iRows = maintainer::objectGetEntriesCount($bQueued, $bRejected);
}
- if($bQueued && !$this->canEdit())
+ if($bQueued && !version::canEdit())
{
/* Users should see their own rejected entries, but maintainers should
not be able to see rejected entries for versions they maintain */