Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2013 → Rev 2016

/alcasar.sh
1156,6 → 1156,8
ln -s /etc/init.d/chilli /usr/libexec/chilli
# conf file creation
[ -e /etc/chilli.conf.default ] || cp /etc/chilli.conf /etc/chilli.conf.default
#NTP Option configuration for DHCP
PRIVATE_IP_HEXA=$(printf "%02x\n" $(echo $PRIVATE_IP | cut -d'.' -f1))$(printf "%02x\n" $(echo $PRIVATE_IP | cut -d'.' -f2))$(printf "%02x\n" $(echo $PRIVATE_IP | cut -d'.' -f3))$(printf "%02x\n" $(echo $PRIVATE_IP | cut -d'.' -f4))
cat <<EOF > /etc/chilli.conf
# coova config for ALCASAR
cmdsocket /var/run/chilli.sock
1190,10 → 1192,10
condown $DIR_DEST_BIN/alcasar-condown.sh
include $DIR_DEST_ETC/alcasar-uamallowed
include $DIR_DEST_ETC/alcasar-uamdomain
dhcpopt 2a04$PRIVATE_IP_HEXA
#dhcpgateway none
#dhcprelayagent none
#dhcpgatewayport none
#dhcpopt none
EOF
# create file for DHCP static ip. Reserve the second IP address for INTIF (the first one is for tun0)
echo "$PRIVATE_MAC $PRIVATE_SECOND_IP" > $DIR_DEST_ETC/alcasar-ethers
1870,8 → 1872,6
# Put the default values in conf file
echo "SSH=on" >> $CONF_FILE
echo "SSH_ADMIN_FROM=0.0.0.0/0.0.0.0" >> $CONF_FILE
echo "CHILLI_NTP_ENABLED=off" >> $CONF_FILE
echo "CHILLI_NTP_IP=none" >> $CONF_FILE
echo "LDAP=off" >> $CONF_FILE
echo "LDAP_IP=0.0.0.0/0.0.0.0" >> $CONF_FILE
echo "MULTIWAN=off" >> $CONF_FILE
/conf/sudoers
12,7 → 12,7
User_Alias ADMWEB=apache # web admin account
 
# Cmnd alias specification
Cmnd_Alias NET=/sbin/ip,/sbin/arping,/sbin/arp,/usr/sbin/tcpdump,/usr/local/bin/alcasar-watchdog.sh,/usr/local/bin/alcasar-dhcp.sh,/usr/local/bin/alcasar-chilli_ntp.sh # network commands
Cmnd_Alias NET=/sbin/ip,/sbin/arping,/sbin/arp,/usr/sbin/tcpdump,/usr/local/bin/alcasar-watchdog.sh,/usr/local/bin/alcasar-dhcp.sh # network commands
Cmnd_Alias URPMI=/usr/sbin/urpmi,/usr/sbin/urpmi.update # packages managment
Cmnd_Alias BYPASS=/usr/local/bin/alcasar-bypass.sh # authentication bypass
Cmnd_Alias RADDB=/usr/bin/radwho,/usr/sbin/chilli_query # to manage users in command line
/web/acc/admin/network.php
36,11 → 36,7
$l_dhcp_state = "Mode actuel";
$l_DHCP_on = "actif";
$l_DHCP_off = "inactif";
$l_chilliNTP_on = "actif";
$l_chilliNTP_off = "inactif";
$l_chilliNTP_explain = "Activer l'option NTP dans les requêtes DHCP de coova-chilli ?<br> si oui, vous devez spécifier l'addresse IP du serveur NTP dans le fichier '/usr/local/etc/alcasar.conf' et changer la valeur de CHILLI_NTP_IP par l'ip de votre serveur NTP. Ensuite rendez le NTP 'actif' et appliquez.";
$l_DHCP_off_explain = "! Avant d'arrêter le serveur DHCP, vous devez renseigner les paramètres d'un serveur externe (cf. documentation).";
$l_DHCP_explain = "Activer le DHCP";
$l_static_dhcp_title = "Réservation d'adresses IP statiques";
$l_mac_address = "Adresse MAC";
$l_ip_address = "Adresse IP";
73,10 → 69,6
$l_DHCP_on = "enabled";
$l_DHCP_off = "disabled";
$l_DHCP_off_explain = "! Before disabling the DHCP server, you must write the extern DHCP parameters in the config file (see Documentation)";
$l_DHCP_explain = "Enable DHCP";
$l_chilliNTP_on = "enabled";
$l_chilliNTP_off = "disabled";
$l_chilliNTP_explain = "Would you like to enable NTP option in DHCP request of coova-chilli?<br> You have to specify IP address of NTP server in this file '/usr/local/etc/alcasar.conf' and change the value of CHILLI_NTP_IP by @IP of NTP server. Then select 'enabled' and 'Apply change'.";
$l_static_dhcp_title = "Static IP addresses reservation";
$l_mac_address = "MAC Address";
$l_ip_address = "IP Address";
98,12 → 90,6
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
switch ($choix)
{
case 'chilliNTP_On' :
exec ("sudo /usr/local/bin/alcasar-chilli_ntp.sh -on");
break;
case 'chilliNTP_Off' :
exec ("sudo /usr/local/bin/alcasar-chilli_ntp.sh -off");
break;
case 'DHCP_On' :
exec ("sudo /usr/local/bin/alcasar-dhcp.sh -on");
break;
375,26 → 361,13
$dhcp_state=trim($conf["DHCP"]);
echo "<CENTER><H3>$l_dhcp_state : ${"l_DHCP_".$dhcp_state}</H3></CENTER>";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
echo "<br><b>$l_DHCP_explain : </b><br>";
echo "<select name='choix'>";
echo "<option value=\"DHCP_Off\" ";if (!strcmp($dhcp_state,"off")) echo "selected";echo ">$l_DHCP_off";
echo "<option value=\"DHCP_On\" ";if (!strcmp($dhcp_state,"on")) echo "selected";echo ">$l_DHCP_on";
echo "</select>";
echo "<input type=submit value='$l_apply'>";
echo "<br>$l_DHCP_off_explain";
 
echo "<br>$l_DHCP_off_explain<br>";
 
//DHCP option NTP (as known as 'option 42') with coovachilli
if (!strcmp($dhcp_state,"on"))
{
$chilliNTP_state=trim($conf["CHILLI_NTP_ENABLED"]);
echo "<br><b>$l_chilliNTP_explain : </b><br>";
echo "<select name='chilliNTP_choix'>";
echo "<option value=\"chilliNTP_Off\" ";if (!strcmp($chilliNTP_state,"off")) echo "selected";echo ">$l_chilliNTP_off";
echo "<option value=\"chilliNTP_On\" ";if (!strcmp($chilliNTP_state,"on")) echo "selected";echo ">$l_chilliNTP_on";
echo "</select>";
}
 
echo "<br><br><input type=submit value='$l_apply'>";
echo "</FORM>";
echo "</td></tr>";
if (strncmp($conf["DHCP"],"on",2) == 0) { require ('network2.php');}
/web/acc/manager/lib/sql/change_attrs.php
79,6 → 79,14
continue;
// if value differs from the sql value then update
else{
#if attribute not set, we create it.
if(!isset($old_val) && $sql_attr=='Filter-Id')
{
$res = da_sql_query($link,$config,"UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND attribute = '$sql_attr' AND value = '';");
if (!$res || !da_sql_affected_rows($link,$res,$config))
echo "<b>Change failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
}
if (isset($item_vals["$key"][$j]) && (isset($old_val) && $old_val !='') || $sql_attr=='Filter-Id'){
$old_val = $item_vals["$key"][$j];
$old_val = da_sql_escape_string($link, $old_val);