make version::objectGetEntriesCount() more consistent for rejected versions by not allowing

maintainers to see rejected versions for applications they maintain
This commit is contained in:
Alexander Nicolaysen Sørnes
2007-04-05 02:29:22 +00:00
committed by WineHQ
parent 6c55180786
commit ec0cb3dbbb

View File

@@ -1159,19 +1159,25 @@ class Version {
if($bQueued && !version::canEdit()) if($bQueued && !version::canEdit())
{ {
/* Users should see their own rejected entries */ /* Users should see their own rejected entries, but maintainers should
not be able to see rejected entries for versions they maintain */
if($bRejected) if($bRejected)
$sIncludeUserSubmissions = "OR appVersion.submitterId = '". $sQuery = "SELECT COUNT(DISTINCT appVersion.versionId) as count FROM
$_SESSION['current']->iUserId."'"; appVersion, appFamily WHERE
appFamily.appId = appVersion.appId
AND
appFamily.queued = 'false'
AND
appVersion.submitterId = '?'
AND
appVersion.queued = '?'";
else
$sQuery = "SELECT COUNT(DISTINCT appVersion.versionId) as count FROM $sQuery = "SELECT COUNT(DISTINCT appVersion.versionId) as count FROM
appVersion, appMaintainers, appFamily WHERE appVersion, appMaintainers, appFamily WHERE
appFamily.appId = appVersion.appId appFamily.appId = appVersion.appId
AND AND
appFamily.queued = 'false' appFamily.queued = 'false'
AND AND
(
(
( (
( (
appMaintainers.appId = appVersion.appId appMaintainers.appId = appVersion.appId
@@ -1189,11 +1195,9 @@ class Version {
appMaintainers.userId = '?' appMaintainers.userId = '?'
AND AND
appMaintainers.queued = 'false' appMaintainers.queued = 'false'
)
$sIncludeUserSubmissions
)
AND AND
appVersion.queued = '?'"; appVersion.queued = '?'";
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId, $sQueued); $hResult = query_parameters($sQuery, $_SESSION['current']->iUserId, $sQueued);
} else } else
{ {