From 0f263407a5bda8921c4fbb2b9ab15fa911439775 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 12 Oct 2020 10:32:25 -0500 Subject: [PATCH] make redirect conditional on previous view --- web/includes/actions/logout.php | 2 +- web/includes/actions/user.php | 4 ---- web/index.php | 3 +++ web/skins/classic/views/user.php | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/includes/actions/logout.php b/web/includes/actions/logout.php index a80511aa7..116ae278c 100644 --- a/web/includes/actions/logout.php +++ b/web/includes/actions/logout.php @@ -23,7 +23,7 @@ if ( $action == 'logout' ) { userLogout(); $view = 'login'; } elseif ( $action == 'config' ) { - $redirect = '?view=user&uid='.$user['Id']; + $redirect = '?view=user&prev=console&uid='.$user['Id']; } ?> diff --git a/web/includes/actions/user.php b/web/includes/actions/user.php index 496b6b214..372108355 100644 --- a/web/includes/actions/user.php +++ b/web/includes/actions/user.php @@ -66,9 +66,7 @@ if ( $action == 'Save' ) { } else { dbQuery('INSERT INTO Users SET '.implode(', ', $changes)); } - $refreshParent = true; } # end if changes - $redirect = '?view=options&tab=users'; } else if ( ZM_USER_SELF_EDIT and ( $_REQUEST['uid'] == $user['Id'] ) ) { $uid = $user['Id']; @@ -99,9 +97,7 @@ if ( $action == 'Save' ) { zm_session_start(); generateAuthHash(ZM_AUTH_HASH_IPS, true); session_write_close(); - $refreshParent = true; } - $redirect = '?view=options&tab=users'; } } // end if $action == user ?> diff --git a/web/index.php b/web/index.php index 3d6f24fc7..46140a1a3 100644 --- a/web/index.php +++ b/web/index.php @@ -183,6 +183,9 @@ $user = null; if ( isset($_REQUEST['view']) ) $view = detaintPath($_REQUEST['view']); +if ( isset($_REQUEST['redirect']) ) + $redirect = '?view='.detaintPath($_REQUEST['redirect']); + # Add CSP Headers $cspNonce = bin2hex(zm_random_bytes(16)); diff --git a/web/skins/classic/views/user.php b/web/skins/classic/views/user.php index 06dde73a1..8d795809a 100644 --- a/web/skins/classic/views/user.php +++ b/web/skins/classic/views/user.php @@ -69,6 +69,7 @@ xhtmlHeaders(__FILE__, translate('User').' - '.$newUser->Username());
+