From 5b196fd8564bed97d3652a63a63f1f134927988b Mon Sep 17 00:00:00 2001 From: fisharebest Date: Tue, 9 Jul 2013 07:07:23 +0000 Subject: New admin option to masquerade as another user --- admin_masquerade.php | 53 +++++++++++++++++++++++++++++++++++++++ themes/_administration/header.php | 1 + 2 files changed, 54 insertions(+) create mode 100644 admin_masquerade.php diff --git a/admin_masquerade.php b/admin_masquerade.php new file mode 100644 index 0000000000..eafccc21d5 --- /dev/null +++ b/admin_masquerade.php @@ -0,0 +1,53 @@ +requireAdminLogin() + ->setPageTitle(/* I18N: verb - pretend to be someone else */ WT_I18N::translate('Masquerade')); + +$all_users = get_all_users('ASC', 'username'); + +$user_id = filter_input(INPUT_POST, 'user_id', FILTER_VALIDATE_INT); + +if (array_key_exists($user_id, $all_users)) { + $WT_SESSION->wt_user = $user_id; + Zend_Session::regenerateId(); + Zend_Session::writeClose(); + header('Location: '.WT_SERVER_NAME.WT_SCRIPT_PATH.'index.php'); + exit; +} + +$controller->pageHeader(); +?> + +

+ +
+ + +
diff --git a/themes/_administration/header.php b/themes/_administration/header.php index aac01d7b89..6fbfe25a92 100644 --- a/themes/_administration/header.php +++ b/themes/_administration/header.php @@ -127,6 +127,7 @@ if (WT_USER_IS_ADMIN) { '