Skip to content

Commit 76315b2

Browse files
author
Kristan Kenney
committed
Merge branch 'feature/user-roles' into feature/per-user-themes
2 parents 1a2805f + cea1eb1 commit 76315b2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

web/edit/user/index.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,14 @@
181181
unset($output);
182182
}
183183
// Change Role (admin only)
184-
if (($v_role != $_POST['$v_role']) && ($_SESSION['userContext'] === 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
185-
$v_role = escapeshellarg($_POST['v_role']);
186-
exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
187-
check_return_code($return_var,$output);
188-
unset($output);
189-
$v_role = $_POST['v_role'];
184+
if (($v_role != $_POST['v_role']) && ($_SESSION['userContext'] === 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
185+
if (!empty($_POST['v_role'])) {
186+
$v_role = escapeshellarg($_POST['v_role']);
187+
exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
188+
check_return_code($return_var,$output);
189+
unset($output);
190+
$v_role = $_POST['v_role'];
191+
}
190192
}
191193
// Change language
192194
if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) {

0 commit comments

Comments
 (0)