Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Allow multi
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jul 2, 2021
1 parent ad35ef0 commit c509302
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/iptables/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
if (!$iptables_file) {
die("ERROR: config not found\n");
}
$theword = "-A OUTPUT -m owner --uid-owner $_GET[user] -j REJECT\n";
die(str_contains($iptables_file, $theword) ? '1' : '0');
$users = explode(',', $_GET['user']);
foreach ($users as $user) {
$theword = "-A OUTPUT -m owner --uid-owner $user -j REJECT\n";
echo str_contains($iptables_file, $theword) ? '1' : '0';
}
die();
} else if ($_GET['action'] === 'add_user') {
$iptables_file = file_get_contents($_SERVER['IPTABLES_PATH']);
if (!$iptables_file) {
Expand Down

0 comments on commit c509302

Please sign in to comment.