/web/acc/manager/htdocs/activity.php |
---|
22,19 → 22,20 |
exit("Can't read the file ".$file);} |
} |
#retrieve IP_address of ALCASAR |
$alcasar_conf_file="/usr/local/etc/alcasar.conf"; |
$ouvre=fopen("$alcasar_conf_file","r"); |
if ($ouvre){ |
while (!feof ($ouvre)) |
{ |
$tampon = fgets($ouvre, 4096); |
if (strpos($tampon,"=")!==false){ |
$tmp = explode("=",$tampon); |
$conf[$tmp[0]] = $tmp[1]; |
} |
$alcasar_conf_file = '/usr/local/etc/alcasar.conf'; |
$file_conf = fopen($alcasar_conf_file, 'r'); |
if (!$file_conf) { |
exit('Error opening the file '.$alcasar_conf_file); |
} |
while (!feof($file_conf)) { |
$buffer = fgets($file_conf, 4096); |
if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) { |
$tmp = explode('=', $buffer); |
$conf[trim($tmp[0])] = trim($tmp[1]); |
} |
} |
fclose($ouvre); |
fclose($file_conf); |
$tmp = explode("/",$conf["PRIVATE_IP"]); |
$intif = $conf["INTIF"]; |
$private_ip=$tmp[0]; |
78,16 → 79,16 |
if (isset($_POST['action'])){ |
switch ($_POST['action']){ |
case "$l_disconnect" : |
exec ("sudo /usr/sbin/chilli_query logout $_POST[mac_addr]"); |
unset ($_POST['mac_addr']); |
exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($_POST['mac_addr'])); |
unset($_POST['mac_addr']); |
break; |
case "$l_dissociate" : |
exec ("sudo /usr/sbin/chilli_query dhcp-release $_POST[mac_addr]"); |
unset ($_POST['mac_addr']); |
exec("sudo /usr/sbin/chilli_query dhcp-release ".escapeshellarg($_POST['mac_addr'])); |
unset($_POST['mac_addr']); |
break; |
case "$l_connect" : |
exec ("sudo /usr/sbin/chilli_query authorize mac $_POST[mac_addr]"); |
unset ($_POST['mac_addr']); |
exec("sudo /usr/sbin/chilli_query authorize mac ".escapeshellarg($_POST['mac_addr'])); |
unset($_POST['mac_addr']); |
break; |
} |
} |
103,7 → 104,7 |
<th>$l_action</th> |
</tr>"; |
$output = array(); $detail = array(); $nb_ligne = 0; |
exec ("sudo /sbin/ip link show $intif", $output); // retrieve ALCASAR MAC address |
exec("sudo /sbin/ip link show ".escapeshellarg($intif), $output); // retrieve ALCASAR MAC address |
$detail = explode (" " , $output[1]); |
$intif_mac_addr=strtoupper(str_replace(":","-",$detail[5])); |
unset ($output);unset ($detail); |
/web/acc/manager/htdocs/autoregistration.php |
---|
479,7 → 479,7 |
{ |
if(preg_match('#^\+#',$num)) |
{ |
exec("sudo $script --replace_numero_alcasar $num"); |
exec("sudo $script --replace_numero_alcasar ".escapeshellarg($num)); |
header('Location: autoregistration.php'); |
} |
else |
501,7 → 501,7 |
{ |
if(is_numeric($pin)) |
{ |
exec("sudo $script --replace_pin $pin"); |
exec("sudo $script --replace_pin ".escapeshellarg($pin)); |
header('Location: autoregistration.php'); |
} |
else |
524,7 → 524,7 |
{ |
if(is_numeric($nb_ban_temp)) |
{ |
exec("sudo $script --replace_try_ban $nb_ban_temp"); |
exec("sudo $script --replace_try_ban ".escapeshellarg($nb_ban_temp)); |
header('Location: autoregistration.php'); |
} |
else |
547,7 → 547,7 |
{ |
if(is_numeric($time_account)) |
{ |
exec("sudo $script --replace_time_account $time_account"); |
exec("sudo $script --replace_time_account ".escapeshellarg($time_account)); |
header('Location: autoregistration.php'); |
} |
else |
569,7 → 569,7 |
{ |
if(is_numeric($time_perm)) |
{ |
exec("sudo $script --replace_time_perm $time_perm"); |
exec("sudo $script --replace_time_perm ".escapeshellarg($time_perm)); |
header('Location: autoregistration.php'); |
} |
else |
587,8 → 587,8 |
if(isset($_GET['num_select'])){ |
$numero=$_GET['num_select']; |
$add_mac=exec("sudo /usr/sbin/chilli_query list | grep $numero | cut -d ' ' -f1"); |
exec("sudo /usr/sbin/chilli_query logout $add_mac"); |
$add_mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg($numero)." | cut -d ' ' -f1"); |
exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac)); |
exec("sudo $script --unlock_num $numero"); |
header('Location: autoregistration.php'); |
597,7 → 597,7 |
# Edition etat pays |
if(isset($_GET['country_select'])){ |
$country=utf8_decode($_GET['country_select']); |
exec("sudo $script --change_country $country"); |
exec("sudo $script --change_country ".escapeshellarg($country)); |
exec("sudo $script --change_country_filter advance"); |
header('Location: autoregistration.php'); |
} |
613,7 → 613,7 |
exec("sudo $script --change_country_dis_all"); |
$array_ue = array("Allemagne","Autriche","Belgique","Bulgarie","Chypre","Croatie","Danemark","Espagne","Estonie","Finlande","France","Grece","Hongrie","Irlande","Italie","Lettonie","Lituanie","Luxembourg","Malte","Pays-Bas"," Pologne","Portugal","Republique Tcheque","Roumanie","Angleterre","Slovaquie","Slovenie","Suede"); |
foreach ($array_ue as $pays){ |
exec("sudo $script --change_country $pays"); |
exec("sudo $script --change_country ".escapeshellarg($pays)); |
} |
exec("sudo $script --change_country_filter ue"); |
/web/acc/manager/htdocs/clear_opensessions.php |
---|
68,7 → 68,7 |
if ($clear_sessions == 1) |
{ |
# close active sessions |
exec ("sudo /usr/local/bin/alcasar-logout.sh $login"); |
exec("sudo /usr/local/bin/alcasar-logout.sh ".escapeshellarg($login)); |
# delete open accounting sessions |
$now = time(); |
$today_now = date("Y-m-d H:i:s",$now); |
103,11 → 103,11 |
# Count of chilli open sessions (for coova-chilli) |
$open_chilli_sessions = 0; |
exec ("sudo /usr/sbin/chilli_query list|cut -d\" \" -f5,6|grep $login|grep ^1|wc -l" , $open_chilli_sessions); |
exec("sudo /usr/sbin/chilli_query list | cut -d\" \" -f5,6 | grep ".escapeshellarg($login)." | grep ^1 | wc -l" , $open_chilli_sessions); |
?> |
<form method=post> |
<input type=hidden name=login value=<?php print $login ?>> |
<input type=hidden name=login value="<?= $login ?>"> |
<input type=hidden name=clear_sessions value="0"> |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<tr> |
/web/acc/manager/htdocs/user_edit.php |
---|
134,8 → 134,8 |
include("../lib/defaults.php"); |
} |
# Disconnecting user for re-authentication |
$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $login \" | awk '{print $1}'"); |
exec("sudo /usr/sbin/chilli_query logout $mac"); |
$mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg(" $login ")." | awk '{print $1}'"); |
exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($mac)); |
} |
else{ |
if (is_file("../lib/$config[general_lib_type]/group_info.php")) |
143,8 → 143,8 |
# Disconnecting all users from the selected group for re-authentication |
if (isset($group_members)){ |
foreach ($group_members as $g_member => $member){ |
$mac=exec("sudo /usr/sbin/chilli_query list | grep \" $member \" | awk '{print $1}'"); |
exec("sudo /usr/sbin/chilli_query logout $mac"); |
$mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg(" $member ")." | awk '{print $1}'"); |
exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($mac)); |
} |
} |
} |