Module: appdb
Branch: master
Commit: 6eccc11979f8bc5201db7bc081f7c98a2e4405ef
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=6eccc11979f8bc5201db7bc0…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com>
Date: Thu Oct 2 00:30:34 2008 +0200
queued items: fix editing applications' vendors & versions
---
include/application.php | 14 +++++++++++---
include/application_queue.php | 6 ++++--
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/include/application.php b/include/application.php
index da2bab3..dd39597 100644
--- a/include/application.php
+++ b/include/application.php
@@ -580,9 +580,17 @@ class Application {
"using the form below.";
} else
{
- $sVendorHelp .= "The user added a new one; review ".
- "it in the vendor form below or ".
- "replace it with an existing one.";
+ if($this->iSubmitterId != $_SESSION['current']->iUserId)
+ {
+ $sVendorHelp .= "The user added a new one; review ".
+ "it in the vendor form below or ".
+ "replace it with an existing one.";
+ } else
+ {
+ $sVendorHelp .= 'You added a new one; it can be edited '.
+ 'using the form below, or replaced with '.
+ 'one from this list.';
+ }
}
}
// vendor name
diff --git a/include/application_queue.php b/include/application_queue.php
index 14e1767..c2b31e2 100644
--- a/include/application_queue.php
+++ b/include/application_queue.php
@@ -23,11 +23,13 @@ class application_queue
{
/* Normal users do not get a aVersionsIds property, so we have to fetch
the versionId manually. Normal users only have access to rejected
- applications */
+ applications, unless they submitted them */
if($_SESSION['current']->hasPriv("admin"))
{
$iVersionId = $this->oApp->aVersionsIds[0];
- } else if($this->oApp->objectGetState() == 'rejected')
+ } else if($this->oApp->objectGetState() == 'rejected' ||
+ ($this->oApp->objectGetState() == 'queued' &&
+ $this->oApp->objectGetSubmitterId() == $_SESSION['current']->iUserId))
{
$sQuery = "SELECT versionId FROM appVersion WHERE appId = '?' LIMIT 1";
$hResult = query_parameters($sQuery, $this->oApp->iAppId);