Преглед изворни кода

Merge branch 'feature/user-roles' into feature/per-user-themes

Kristan Kenney пре 5 година
родитељ
комит
76315b285c
1 измењених фајлова са 8 додато и 6 уклоњено
  1. 8 6
      web/edit/user/index.php

+ 8 - 6
web/edit/user/index.php

@@ -181,12 +181,14 @@ if (!empty($_POST['save'])) {
         unset($output);
     }
     // Change Role (admin only)
-    if (($v_role != $_POST['$v_role']) && ($_SESSION['userContext'] === 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
-        $v_role = escapeshellarg($_POST['v_role']);
-        exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
-        check_return_code($return_var,$output);
-        unset($output);
-        $v_role = $_POST['v_role'];
+    if (($v_role != $_POST['v_role']) && ($_SESSION['userContext'] === 'admin') && $v_username != "admin" && (empty($_SESSION['error_msg']))) {
+        if (!empty($_POST['v_role'])) {
+            $v_role = escapeshellarg($_POST['v_role']);
+            exec (HESTIA_CMD."v-change-user-role ".escapeshellarg($v_username)." ".$v_role, $output, $return_var);
+            check_return_code($return_var,$output);
+            unset($output);
+            $v_role = $_POST['v_role'];
+        }
     }
     // Change language
     if (($v_language != $_POST['v_language']) && (empty($_SESSION['error_msg']))) {