We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7dbf07 commit 608b9d7Copy full SHA for 608b9d7
1 file changed
web/api/index.php
@@ -6,6 +6,12 @@
6
// Authentication
7
$auth_code = 1;
8
if (empty($_POST['hash'])) {
9
+ // Check user permission to use API
10
+ if ($_POST['user'] != 'admin') {
11
+ echo 'Error: only admin is allowed to use API';
12
+ exit;
13
+ }
14
+
15
$v_user = escapeshellarg($_POST['user']);
16
$v_password = escapeshellarg($_POST['password']);
17
exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'", $output, $auth_code);
@@ -20,13 +26,6 @@
20
26
echo 'Error: authentication failed';
21
27
exit;
22
28
}
23
-
24
- // Check user permission to use API
25
- if ($_POST['user'] != 'admin') {
- echo 'Error: only admin is allowed to use API';
- exit;
- }
29
30
31
// Prepare arguments
32
if (isset($_POST['cmd'])) $cmd = escapeshellarg($_POST['cmd']);
0 commit comments