Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1576 → Rev 1578

/alcasar.sh
470,7 → 470,7
private_broadcast_ending=`echo $PRIVATE_BROADCAST | cut -d"." -f4` # last octet of LAN broadcast
PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1` # First network address (ex.: 192.168.182.1)
PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1` # last network address (ex.: 192.168.182.254)
PRIVATE_MAC=`/sbin/ip link show $INTIF | grep ether | cut -d" " -f6` # MAC address of INTIF
PRIVATE_MAC=`/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` # MAC address of INTIF
# Define Internet parameters
DNS1=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|head -n 1` # 1st DNS server
nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
/scripts/alcasar-file-clean.sh
10,7 → 10,6
SED="/bin/sed -i"
DIR_CONF="/usr/local/etc"
ALCASAR_SERVICES="$DIR_CONF/alcasar-services"
ALCASAR_EXCEPTIONS="$DIR_CONF/alcasar-filter-exceptions"
ALCASAR_IP_BLOCKED="$DIR_CONF/alcasar-ip-blocked"
ALCASAR_UAMDOMAIN="$DIR_CONF/alcasar-uamdomain"
ALCASAR_UAMALLOWED="$DIR_CONF/alcasar-uamallowed"
/web/acc/admin/auth_exceptions.php
87,7 → 87,7
fwrite ($pointeur, $line);
fclose ($pointeur);
exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
exec ("sudo service chilli restart");
exec ("sudo /usr/bin/systemctl restart chilli");
}
}
break;
120,7 → 120,7
}
fclose($pointeur);
}
exec ("sudo service chilli restart");
exec ("sudo /usr/bin/systemctl restart chilli");
break;
case 'new_ip' :
if (trim($_POST['add_ip']) != "")
146,7 → 146,7
fwrite ($pointeur, $line);
fclose ($pointeur);
exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
exec ("sudo service chilli restart");
exec ("sudo /usr/bin/systemctl restart chilli");
}
}
break;
179,7 → 179,7
}
fclose($pointeur);
}
exec ("sudo service chilli restart");
exec ("sudo /usr/bin/systemctl restart chilli");
break;
}
}
/web/acc/admin/network.php
4,10 → 4,10
/********************
* TEST CONF FILES *
*********************/
define ("ALCASAR_CHILLI", "/etc/chilli.conf");
//define ("ALCASAR_CHILLI", "/etc/chilli.conf");
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
define ("ETHERS_FILE", "/usr/local/etc/alcasar-ethers");
$conf_files=array(ALCASAR_CHILLI,CONF_FILE,ETHERS_FILE);
$conf_files=array(CONF_FILE,ETHERS_FILE);
foreach ($conf_files as $file){
if (!file_exists($file)){
exit("Requested file ".$file." isn't present");}
104,7 → 104,7
$pointeur=fopen(ETHERS_FILE,"a");
fwrite ($pointeur, $line);
fclose ($pointeur);
exec ("sudo service chilli restart");
exec ("/usr/bin/systemctl reload chilli");
}
}
break;
129,7 → 129,7
if (! $remove_line) {fwrite($pointeur,$line);}
}
fclose($pointeur);
# exec ("sudo service chilli restart");
exec ("sudo /usr/bin/systemctl reload chilli");
}
break;
}
150,21 → 150,22
}
/********************************************************
* Lecture du fichier ALCASAR_CHILLI *
* (not need any more) *
*********************************************************/
$ouvre=fopen(ALCASAR_CHILLI,"r");
if ($ouvre){
while (!feof ($ouvre))
{
$tampon = fgets($ouvre, 4096);
if (strpos($tampon,"=")!==false){
$tmp = explode("=",$tampon);
$chilli[$tmp[0]] = $tmp[1];
}
}
}else{
exit("Erreur d'ouverture du fichier ".ALCASAR_CHILLI);
}
fclose($ouvre);
//$ouvre=fopen(ALCASAR_CHILLI,"r");
//if ($ouvre){
// while (!feof ($ouvre))
// {
// $tampon = fgets($ouvre, 4096);
// if (strpos($tampon,"=")!==false){
// $tmp = explode("=",$tampon);
// $chilli[$tmp[0]] = $tmp[1];
// }
// }
//}else{
// exit("Erreur d'ouverture du fichier ".ALCASAR_CHILLI);
//}
//fclose($ouvre);
 
/***********************************
* Read ALCASAR_CONF_FILE *
195,6 → 196,19
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $l_network_title; ?></title>
<link rel="stylesheet" href="/css/style.css" type="text/css">
<script type="text/javascript">
function MAC_Control(formulaire){
/*MAC control (upper case and '-' separator*/
var regex1 = /^([0-9a-fA-F]{2}(-|:)){5}[0-9a-fA-F]{2}$/; //vérification adresse mac
if (regex1.test(document.forms[formulaire].add_mac.value)){
document.forms[formulaire].add_mac.value=document.forms[formulaire].add_mac.value.toUpperCase().replace(/:/g, '-');
return true;
} else {
alert("Invalid MAC address");//non internationnalisé
return false;
}
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
/web/acc/admin/network2.php
29,16 → 29,15
echo "<input type='submit' value='$l_apply'>";
}
echo "</form></td><td valign='middle' align='center'>";
echo "<FORM action='network.php' method='POST'>";
echo "<FORM name='new_mac' action='network.php' method='POST'>";
echo "<table cellspacing=2 cellpadding=3 border=1>";
echo "<tr><th>$l_mac_address<th>$l_ip_address";
?>
<td></td></tr>
<tr><td>exemple : 12-2f-36-a4-df-43</td><td>exemple : 192.168.182.10</td><td></td></tr>
<tr><td>exemple : 12-2F-36-A4-DF-43</td><td>exemple : 192.168.182.10</td><td></td></tr>
<tr><td><input type='text' name='add_mac' size='17'></td>
<td><input type='text' name='add_ip' size='10'></td>
<input type='hidden' name='choix' value='new_mac'>
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_mac'></td>
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\" OnClick=\"return MAC_Control('new_mac');\">"?></td>
</tr></table>
</form>
</td></tr>
/web/acc/admin/update_ldap.php
130,7 → 130,7
else {
file_put_contents(ALCASAR_CONF_FILE, str_replace('LDAP=on', 'LDAP=off', file_get_contents(ALCASAR_CONF_FILE)));}
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
exec ("sudo service radiusd restart");
exec ("sudo /usr/bin/systemctl restart radiusd");
 
/********************************************************************
* Redirection vers la page de configuration LDAP *
/web/acc/manager/htdocs/user_new.php
1,4 → 1,7
<?php
 
if (!isset ($create)) { $create=0; }
if (!isset ($show)) { $show=0; }
// ticket d'impression (thank's to Geoffroy MUSITELLI)
//gestion de la langue
if (is_file("../lib/langues.php"))