File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 66// Main include
77include ($ _SERVER ['DOCUMENT_ROOT ' ]."/inc/main.php " );
88
9- // Check token
10- if ((!isset ($ _GET ['token ' ])) || ($ _SESSION ['token ' ] != $ _GET ['token ' ])) {
11- header ('location: /login/ ' );
12- exit ();
13- }
14-
159// Check user
1610if ($ _SESSION ['user ' ] != 'admin ' ) {
1711 header ("Location: /list/user " );
2115// Check POST request
2216if (!empty ($ _POST ['ok ' ])) {
2317
18+ // Check token
19+ if ((!isset ($ _POST ['token ' ])) || ($ _SESSION ['token ' ] != $ _POST ['token ' ])) {
20+ header ('location: /login/ ' );
21+ exit ();
22+ }
23+
2424 // Check empty fields
2525 if (empty ($ _POST ['v_chain ' ])) $ errors [] = __ ('banlist ' );
2626 if (empty ($ _POST ['v_ip ' ])) $ errors [] = __ ('ip address ' );
3939 $ v_chain = escapeshellarg ($ _POST ['v_chain ' ]);
4040 $ v_ip = escapeshellarg ($ _POST ['v_ip ' ]);
4141
42- // Add firewall ban
42+ // Add firewall rule
4343 if (empty ($ _SESSION ['error_msg ' ])) {
4444 exec (HESTIA_CMD ."v-add-firewall-ban " .$ v_ip ." " .$ v_chain , $ output , $ return_var );
4545 check_return_code ($ return_var ,$ output );
4949 // Flush field values on success
5050 if (empty ($ _SESSION ['error_msg ' ])) {
5151 $ _SESSION ['ok_msg ' ] = __ ('BANLIST_CREATED_OK ' );
52+ unset($ v_chain );
5253 unset($ v_ip );
5354 }
5455}
You can’t perform that action at this time.
0 commit comments