From 00cffd7ddba6bd7b65fcd4c1ce625515cf5489d0 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Thu, 27 Sep 2012 17:02:11 -0400 Subject: Move package deletion to a separate page Package actions now have a separate box on the package details page. Make a package deletion link in that box. Link leads to a new page (pkgdel.php) that can be used to confirm package deletion. A separate page with confirmation is used to avoid CSRFs. Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/html/index.php | 3 +++ web/html/pkgdel.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 web/html/pkgdel.php (limited to 'web/html') diff --git a/web/html/index.php b/web/html/index.php index 5c56868..0b5dfc8 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -43,6 +43,9 @@ if (isset($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { case "unflag": $_POST['do_UnFlag'] = __('UnFlag'); break; + case "delete": + include('pkgdel.php'); + return; } if (isset($_COOKIE['AURSID'])) { diff --git a/web/html/pkgdel.php b/web/html/pkgdel.php new file mode 100644 index 0000000..7f244eb --- /dev/null +++ b/web/html/pkgdel.php @@ -0,0 +1,44 @@ + +
+

+

+ ', htmlspecialchars($pkgname), ''); ?> + + +

+
+
+ + + +

+

+

" />

+
+
+
+ +