mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Confirmation when deleting packages
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
f08fbbe80e
commit
b5bc6ab742
4 changed files with 13 additions and 3 deletions
|
@ -46,8 +46,13 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
|
||||||
} elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) {
|
} elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) {
|
||||||
$output = pkg_vote($atype, $ids, False);
|
$output = pkg_vote($atype, $ids, False);
|
||||||
} elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) {
|
} elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) {
|
||||||
|
if (isset($_POST['confirm_Delete'])) {
|
||||||
$output = pkg_delete($atype, $ids);
|
$output = pkg_delete($atype, $ids);
|
||||||
unset($_GET['ID']);
|
unset($_GET['ID']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$output = __("The selected packages have not been deleted, check the confirmation checkbox.");
|
||||||
|
}
|
||||||
} elseif ($_POST['action'] == "do_Notify" || isset($_POST['do_Notify'])) {
|
} elseif ($_POST['action'] == "do_Notify" || isset($_POST['do_Notify'])) {
|
||||||
$output = pkg_notify($atype, $ids);
|
$output = pkg_notify($atype, $ids);
|
||||||
} elseif ($_POST['action'] == "do_UnNotify" || isset($_POST['do_UnNotify'])) {
|
} elseif ($_POST['action'] == "do_UnNotify" || isset($_POST['do_UnNotify'])) {
|
||||||
|
|
|
@ -402,7 +402,7 @@ function package_details($id=0, $SID="") {
|
||||||
* do_UnFlag - Remove out-of-date flag
|
* do_UnFlag - Remove out-of-date flag
|
||||||
* do_Adopt - Adopt
|
* do_Adopt - Adopt
|
||||||
* do_Disown - Disown
|
* do_Disown - Disown
|
||||||
* do_Delete - Delete
|
* do_Delete - Delete (requires confirm_Delete to be set)
|
||||||
* do_Notify - Enable notification
|
* do_Notify - Enable notification
|
||||||
* do_UnNotify - Disable notification
|
* do_UnNotify - Disable notification
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -47,6 +47,8 @@ if ($row["MaintainerUID"] == 0) {
|
||||||
if ($atype == "Trusted User" || $atype == "Developer") {
|
if ($atype == "Trusted User" || $atype == "Developer") {
|
||||||
echo "<input type='submit' class='button' name='do_Delete'";
|
echo "<input type='submit' class='button' name='do_Delete'";
|
||||||
echo " value='".__("Delete Packages")."'>\n";
|
echo " value='".__("Delete Packages")."'>\n";
|
||||||
|
echo "<input type='checkbox' name='confirm_Delete' value='1' /> ";
|
||||||
|
echo __("Confirm")."\n";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,9 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
|
||||||
<option value='do_Notify'><?php print __("Notify") ?></option>
|
<option value='do_Notify'><?php print __("Notify") ?></option>
|
||||||
<option value='do_UnNotify'><?php print __("UnNotify") ?></option>
|
<option value='do_UnNotify'><?php print __("UnNotify") ?></option>
|
||||||
</select>
|
</select>
|
||||||
|
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
|
||||||
|
<input type='checkbox' name='confirm_Delete' value='1' /> <?php print __("Confirm") ?>
|
||||||
|
<?php endif; ?>
|
||||||
<input type='submit' class='button' style='width: 80px' value='<?php print __("Go") ?>' />
|
<input type='submit' class='button' style='width: 80px' value='<?php print __("Go") ?>' />
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue