Commit 5c64ae1a authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Drop suffixes from confirm parameters



Remove the _delete and _disown suffixes from HTTP POST confirmation
parameters.

Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 9b19f759
......@@ -70,7 +70,7 @@ if (isset($_COOKIE["AURSID"])) {
/* Details for account being deleted. */
if (can_edit_account($row)) {
$UID = $row['ID'];
if (in_request('confirm_Delete') && check_token()) {
if (in_request('confirm') && check_token()) {
user_delete($UID);
header('Location: /');
} else {
......
......@@ -54,7 +54,7 @@ if (check_token()) {
} elseif (current_action("do_Adopt")) {
list($ret, $output) = pkgbase_adopt($ids, true, NULL);
} elseif (current_action("do_Disown")) {
if (isset($_POST['confirm_Disown'])) {
if (isset($_POST['confirm'])) {
$via = isset($_POST['via']) ? $_POST['via'] : NULL;
list($ret, $output) = pkgbase_adopt($ids, false, $via);
} else {
......@@ -66,7 +66,7 @@ if (check_token()) {
} elseif (current_action("do_UnVote")) {
list($ret, $output) = pkgbase_vote($ids, false);
} elseif (current_action("do_Delete")) {
if (isset($_POST['confirm_Delete'])) {
if (isset($_POST['confirm'])) {
$via = isset($_POST['via']) ? $_POST['via'] : NULL;
if (!isset($_POST['merge_Into']) || empty($_POST['merge_Into'])) {
list($ret, $output) = pkgbase_delete($ids, NULL, $via);
......
......@@ -34,7 +34,7 @@ if (has_credential(CRED_PKGBASE_DELETE)): ?>
<?php if (isset($_GET['via'])): ?>
<input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" />
<?php endif; ?>
<p><input type="checkbox" name="confirm_Delete" value="1" />
<p><input type="checkbox" name="confirm" value="1" />
<?= __("Confirm package deletion") ?></p>
<p><input type="submit" class="button" name="do_Delete" value="<?= __("Delete") ?>" /></p>
</fieldset>
......
......@@ -41,7 +41,7 @@ if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?>
<?php if (isset($_GET['via'])): ?>
<input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" />
<?php endif; ?>
<p><input type="checkbox" name="confirm_Disown" value="1" />
<p><input type="checkbox" name="confirm" value="1" />
<?= __("Confirm to disown the package") ?></p>
<p><input type="submit" class="button" name="do_Disown" value="<?= __("Disown") ?>" /></p>
</fieldset>
......
......@@ -55,7 +55,7 @@ if (has_credential(CRED_PKGBASE_DELETE)): ?>
</script>
<p><label for="merge_Into" ><?= __("Merge into:") ?></label>
<input type="text" id="merge_Into" name="merge_Into" value="<?= isset($_GET['into']) ? $_GET['into'] : '' ?>" /></p>
<p><input type="checkbox" name="confirm_Delete" value="1" />
<p><input type="checkbox" name="confirm" value="1" />
<?= __("Confirm package merge") ?></p>
<p><input type="submit" class="button" name="do_Delete" value="<?= __("Merge") ?>" /></p>
</fieldset>
......
......@@ -503,7 +503,7 @@ function pkg_display_details($id=0, $row, $SID="") {
* do_UnFlag - Remove out-of-date flag
* do_Adopt - Adopt
* do_Disown - Disown
* do_Delete - Delete (requires confirm_Delete to be set)
* do_Delete - Delete
* do_Notify - Enable notification
* do_UnNotify - Disable notification
*/
......
......@@ -12,7 +12,7 @@
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
</fieldset>
<fieldset>
<p><input type="checkbox" name="confirm_Delete" value="1" />
<p><input type="checkbox" name="confirm" value="1" />
<?= __("Confirm deletion") ?></p>
<p>
......
......@@ -122,7 +122,7 @@ if (!$result): ?>
<?php if (has_credential(CRED_PKGBASE_DELETE)): ?>
<label for="merge_Into"><?= __("Merge into") ?></label>
<input type="text" id="merge_Into" name="merge_Into" />
<input type="checkbox" name="confirm_Delete" value="1" /> <?= __("Confirm") ?>
<input type="checkbox" name="confirm" value="1" /> <?= __("Confirm") ?>
<?php endif; ?>
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
<input type="submit" class="button" style="width: 80px" value="<?= __("Go") ?>" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment