File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 66 // Authentication
77 $ auth_code = 1 ;
88 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+
915 $ v_user = escapeshellarg ($ _POST ['user ' ]);
1016 $ v_password = escapeshellarg ($ _POST ['password ' ]);
1117 exec (VESTA_CMD ."v-check-user-password " .$ v_user ." " .$ v_password ." ' " .$ _SERVER ["REMOTE_ADDR " ]."' " , $ output , $ auth_code );
2026 echo 'Error: authentication failed ' ;
2127 exit ;
2228 }
23-
24- // Check user permission to use API
25- if ($ _POST ['user ' ] != 'admin ' ) {
26- echo 'Error: only admin is allowed to use API ' ;
27- exit ;
28- }
29-
3029
3130 // Prepare arguments
3231 if (isset ($ _POST ['cmd ' ])) $ cmd = escapeshellarg ($ _POST ['cmd ' ]);
You can’t perform that action at this time.
0 commit comments