No subject
=3D?utf-8?q?Alexander_Nicolaysen_S=3DC3=3DB8rnes?=3D
alex at thehandofag=
Thu Nov 15 09:34:07 CST 2007
ony.com>
Date: Fri, 21 Dec 2007 21:48:15 +0100
Subject: [PATCH] Allow users to modify/delete their queued apps
---
include/application.php | 12 ++++++++++++
include/downloadurl.php | 4 +++-
include/maintainer.php | 2 +-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/application.php b/include/application.php
index 47bbdd5..fcbde66 100644
--- a/include/application.php
+++ b/include/application.php
@@ -887,6 +887,9 @@ class Application {
$oTableRow->SetClass("color4");
$oTable->SetHeader($oTableRow);
=20
+ if($bQueued)
+ $oTableRow->addTextCell("Action");
+
for($i =3D 1; $oRow =3D query_fetch_object($hResult); $i++)
{
=20
@@ -900,6 +903,15 @@ class Application {
$oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimesta=
mp($oRow->submitTime)));
$oTableRow->SetClass(($i % 2) ? "color0" : "color1");
=20
+ if($bQueued)
+ {
+ $oM =3D new objectManager('application');
+ $oM->setReturnTo(array_key_exists('REQUEST_URI', $_SERVER) =
? $_SERVER['REQUEST_URI'] : "");
+ $shDeleteLink =3D '<a href=3D"'.$oM->makeUrl("delete", $oAp=
p->iAppId, "Delete entry").'">delete</a>';
+ $shEditLink =3D '<a href=3D"'.$oM->makeUrl("edit", $oApp->i=
AppId, "Edit entry").'">edit</a>';
+ $oTableRow->addTextCell("[ $shEditLink ] [ $shDelete=
Link ]");
+ }
+
$oTable->AddRow($oTableRow);
}
=20
diff --git a/include/downloadurl.php b/include/downloadurl.php
index e188ddc..408bcbe 100644
--- a/include/downloadurl.php
+++ b/include/downloadurl.php
@@ -258,7 +258,9 @@ class downloadurl
return TRUE;
} else
{
- return FALSE;
+ $oVersion =3D new version($this->iVersionId);
+
+ return $oVersion->canEdit();
}
}
=20
diff --git a/include/maintainer.php b/include/maintainer.php
index 64e1037..0633c00 100644
--- a/include/maintainer.php
+++ b/include/maintainer.php
@@ -685,7 +685,7 @@ class maintainer
=20
function canEdit()
{
- if($_SESSION['current']->hasPriv("admin"))
+ if($_SESSION['current']->hasPriv("admin") || $this->iUserId =3D=3D =
$_SESSION['current']->iUserId)
return TRUE;
=20
return FALSE;
--=20
1.5.1.6
--=_60ldtx3tonks--
More information about the wine-patches
mailing list