/web/acc/manager/htdocs/accounting.php |
---|
104,7 → 104,7 |
</td><td align=left> |
<select name=operator_of_$this->name> |
EOM; |
foreach($operators as $operator){ |
foreach ($operators as $operator){ |
if($this->operator == $operator) |
$selected=" selected "; |
else |
160,7 → 160,7 |
<b>$l_attributes</b><br> |
<select name="accounting_show_attrs[]" size=5 multiple> |
EOM; |
foreach($items as $key => $val) |
foreach ($items as $key => $val) |
echo <<<EOM |
<option $selected[$key] value="$key">$val</option> |
EOM; |
172,7 → 172,7 |
<select name="order_by"> |
EOM; |
foreach($items as $key => $val) |
foreach ($items as $key => $val) |
if ($val == 'username') |
echo <<<EOM |
<option selected value="$key">$val</option> |
199,7 → 199,7 |
<option>--Attribute--</option> |
EOM; |
foreach($items as $key => $val) |
foreach ($items as $key => $val) |
print("<option value=\"$key\">$val</option>"); |
echo <<<EOM |
296,7 → 296,7 |
<tr bgcolor="#d0ddb0"> |
EOM; |
foreach($accounting_show_attrs as $val){ |
foreach ($accounting_show_attrs as $val){ |
$desc = $sql_attrs[$val]['desc']; |
if($val == 'acctoutputoctets') |
$desc = "Upload"; |
311,7 → 311,7 |
while( $row = da_sql_fetch_array($search,$config) ){ |
//$num++; |
echo "<tr align=center>\n"; |
foreach($accounting_show_attrs as $val){ |
foreach ($accounting_show_attrs as $val){ |
$info = $row[$val]; |
if($val == "acctoutputoctets" || $val == "acctinputoctets") |
$info = bytes2str($info); |
/web/acc/manager/htdocs/activity.php |
---|
183,7 → 183,7 |
$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5])); |
unset ($output);unset ($detail); |
exec ('sudo /usr/sbin/chilli_query list|sort -k5 -r', $output); |
foreach($output as $ligne){ |
foreach ($output as $ligne){ |
$detail = explode (" ", $ligne); |
$nb_ligne ++; |
echo "<tr valign=\"middle\">"; |
/web/acc/manager/htdocs/find.php |
---|
144,7 → 144,7 |
<td> |
<select name="radius_attr" editable> |
EOM; |
foreach($show_attrs as $key => $desc) |
foreach ($show_attrs as $key => $desc) |
switch ($key) |
{ |
case 'Simultaneous-Use' : |
/web/acc/manager/htdocs/group_new.php |
---|
189,7 → 189,7 |
</tr> |
EOM; |
foreach($show_attrs as $key => $desc){ |
foreach ($show_attrs as $key => $desc){ |
if ($key === 'Idle-Timeout') continue; |
$name = $attrmap["$key"]; |
if ($name == 'none') |
/web/acc/manager/htdocs/security.php |
---|
9,7 → 9,6 |
if ($language === 'fr') { |
$l_title = 'Sécurité'; |
$l_spoofing = "Adresse(s) MAC usurpée(s) (Watchdog)"; |
$l_virus = "Virus bloqué(s) (CLAMAV)"; |
$l_fail2ban = "Adresse(s) IP bloquée(s) (Fail2Ban)"; |
$l_ban_date = "Date de bloquage"; |
$l_unban_date = "Date de débloquage"; |
20,7 → 19,6 |
} else if ($language === 'es') { |
$l_title = 'Seguridad'; |
$l_spoofing = "Direcciones MAC usurpadas (Watchdog)"; |
$l_virus = "Virus bloqueado (CLAMAV)"; |
$l_fail2ban = "Dirección(es) IP bloqueada(s) (Fail2Ban)"; |
$l_ban_date = "Fecha de bloqueo"; |
$l_unban_date = "Fecha de desembolso"; |
31,7 → 29,6 |
} else { |
$l_title = 'Security'; |
$l_spoofing = "MAC address spoofed (Watchdog)"; |
$l_virus = "Virus blocked (CLAMAV)"; |
$l_fail2ban = "IP address blocked (Fail2Ban)"; |
$l_ban_date = "Lock date"; |
$l_unban_date = "Unlock date"; |
58,8 → 55,7 |
<div class="panel-row"> |
<div class="btn-group btn-group-justified" role="group" aria-label="Justified button group"> |
<a href="security.php?tab=1" class="btn btn-default<?= (($tab === 1) ? ' active' : '') ?>" role="button"><?= $l_spoofing ?></a> |
<a href="security.php?tab=2" class="btn btn-default<?= (($tab === 2) ? ' active' : '') ?>" role="button"><?= $l_virus ?></a> |
<a href="security.php?tab=3" class="btn btn-default<?= (($tab === 3) ? ' active' : '') ?>" role="button"><?= $l_fail2ban ?></a> |
<a href="security.php?tab=2" class="btn btn-default<?= (($tab === 3) ? ' active' : '') ?>" role="button"><?= $l_fail2ban ?></a> |
</div> |
<?php |
if ($tab === 1) { |
116,30 → 112,6 |
</div> |
<?php |
} else if ($tab === 2) { |
$filePath = '/var/log/clamav/clamd.log'; |
$pattern = "/\bfound\b/i"; |
$lines = preg_grep ($pattern, file($filePath)); |
if ($lines === false) { |
exit("Cannot open '$filePath'."); |
} |
$lines = array_reverse($lines); |
?> |
<h3><?= $l_virus ?></h3> |
<div class="container"> |
<table class="table table-striped table-hover"> |
<tbody> |
<?php if (!empty($lines)): ?> |
<?php foreach ($lines as $line): ?> |
<tr><td><?= $line ?></td></tr> |
<?php endforeach; ?> |
<?php else: ?> |
<tr><td style="text-align: center;"><?= $l_empty ?></td></tr> |
<?php endif; ?> |
</tbody> |
</table> |
</div> |
<?php |
} else if ($tab === 3) { |
$bans = []; |
$regex = '/^(?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2}[ \t]+[0-9]{2}:[0-9]{2}:[0-9]{2}),[0-9]{3}[ \t]+fail2ban\.actions[ \t]+\[[0-9]+\]:[ \t]+NOTICE[ \t]+\[(?P<rule>[a-zA-Z0-9_-]+)\][ \t]+(?P<type>Ban|Unban)[ \t]+(?P<ip>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/'; |
$file = fopen('/var/log/fail2ban.log', 'r'); |
/web/acc/manager/htdocs/user_by_sms.php |
---|
26,7 → 26,7 |
$vendor=exec("udevadm info -n $openned_ports[0] | grep 'MODEL=' | cut -d'=' -f2"); |
$model=exec("udevadm info -n $openned_ports[0] | grep 'MODEL_FROM_DATABASE=' | cut -d'=' -f2"); |
$gammu_smsd_port=exec("cat /etc/gammu_smsd_conf| grep '^port\s\?=' | cut -d ' ' -f3"); // Gammu_smsd listen port |
foreach($openned_ports as $row) { |
foreach ($openned_ports as $row) { |
if ( "$row" == "$gammu_smsd_port" ) { // is gammu listen on an openned port ? |
$listen_on_right_port="true"; |
} |
/web/acc/manager/htdocs/user_edit.php |
---|
412,7 → 412,7 |
EOM; |
} |
foreach($show_attrs as $key => $desc){ |
foreach ($show_attrs as $key => $desc){ |
if ($key === 'Idle-Timeout') continue; |
$name = $attrmap["$key"]; |
$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : ''; |
452,7 → 452,7 |
} |
$i = 0; |
foreach($vals as $val) { |
foreach ($vals as $val) { |
$name1 = $name . $i; |
$val = preg_replace('/\"/','"',$val); |
$oper_name = $name1 . '_op'; |
/web/acc/manager/htdocs/user_finger.php |
---|
45,7 → 45,7 |
$servers_num = 0; |
if ($config[general_ld_library_path] != '') |
putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]"); |
foreach($nas_list as $nas){ |
foreach ($nas_list as $nas){ |
$j = 0; |
$num = 0; |
/web/acc/manager/html/stats.html.php |
---|
20,7 → 20,7 |
<td valign=middle><input type="text" name="login" size="12" value="<?=$login?>" ></td> |
<td valign=middle> |
<select name="server" size=1> |
<?php foreach($servers as $key => $val): ?> |
<?php foreach ($servers as $key => $val): ?> |
<option value="<?=$val?>"><?=$key?> |
<?php endforeach; ?> |
</select> |