From bdc6bb58d608e4c06c06e9b82cb36e007de3dcae Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 11 Oct 2023 13:33:31 -0400 Subject: [PATCH] Add a redirect after user delete so that we don't have form resubmission --- web/includes/actions/options.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/includes/actions/options.php b/web/includes/actions/options.php index 6e8c0d238..dbca7cda4 100644 --- a/web/includes/actions/options.php +++ b/web/includes/actions/options.php @@ -43,12 +43,15 @@ if ( $action == 'delete' ) { } # end if isset($_REQUEST['object'] ) } else if ( isset($_REQUEST['markUids']) ) { // deletes users - foreach( $_REQUEST['markUids'] as $markUid ) + foreach ($_REQUEST['markUids'] as $markUid) dbQuery('DELETE FROM Users WHERE Id = ?', array($markUid)); - if ( $markUid == $user->Id() ) + if ($markUid == $user->Id()) { userLogout(); + $redirect = '?view=login'; + } else { + $redirect = '?view=options&tab=users'; + } } - } else if ( $action == 'options' && isset($_REQUEST['tab']) ) { $result = dbQuery('SELECT Name,Value,Type,`System` FROM Config WHERE Category=? ORDER BY Id ASC', array($_REQUEST['tab']));