Skip to content

Commit cea1eb1

Browse files
author
Kristan Kenney
committed
Fix bug when saving user roles
1 parent 3ded651 commit cea1eb1

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
@@ -175,12 +175,14 @@
175175
unset($output);
176176
}
177177
// Change Role (admin only)
178-
if (($v_role != $_POST['$v_role']) && ($_SESSION['userContext'] === 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
179-
$v_role = escapeshellarg($_POST['v_role']);
180-
exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
181-
check_return_code($return_var,$output);
182-
unset($output);
183-
$v_role = $_POST['v_role'];
178+
if (($v_role != $_POST['v_role']) && ($_SESSION['userContext'] === 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
179+
if (!empty($_POST['v_role'])) {
180+
$v_role = escapeshellarg($_POST['v_role']);
181+
exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
182+
check_return_code($return_var,$output);
183+
unset($output);
184+
$v_role = $_POST['v_role'];
185+
}
184186
}
185187
// Change language
186188
if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) {

0 commit comments

Comments
 (0)