Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2860 → Rev 2861

/CHANGELOG
8,8 → 8,8
- Spanish translation (Thanks to Germán BOWERS)
CHANGES
- Improve the voucher (tickets) display with serif font
- Local DNS resolution simplification
BUGS
- Change of security certificate doesn't apply automatically
- Network IP addresses can now be set as exception
-------------------- 3.5.0 --------------------
NEWS
/VERSION
1,0 → 0,0
3.5
3.5.1
/alcasar.sh
560,18 → 560,6
DNS2=`cat /etc/sysconfig/network-scripts/ifcfg-$EXTIF | grep '^DNS2=' | cut -d"=" -f2` # 2nd DNS server
DNS1=${DNS1:=208.67.220.220}
DNS2=${DNS2:=208.67.222.222}
# if [ "$DNS1" == "" ]
# then
# if [ $Lang == "fr" ]
# then
# echo "L'adresse IP des serveurs DNS ne sont pas corrects"
# echo "Vérifiez la configuration de la carte réseau externe ($EXTIF)"
# else
# echo "The IP address of DNS servers are not set correctly"
# echo "Check the extern network card configuration ($EXTIF)"
# fi
# exit 0
# fi
PUBLIC_NETMASK=`/bin/ipcalc -m $PUBLIC_IP_MASK | cut -d"=" -f2`
PUBLIC_PREFIX=`/bin/ipcalc -p $PUBLIC_IP $PUBLIC_NETMASK|cut -d"=" -f2`
PUBLIC_NETWORK=`/bin/ipcalc -n $PUBLIC_IP/$PUBLIC_PREFIX|cut -d"=" -f2`
1549,7 → 1537,6
## name: "<your_domain>."
## forward-addr: <@IP_domain_server>
##
## INFO : local hostnames are resolved in /etc/hosts file
EOF
 
# Configuration file of ALCASAR main domains for $INTIF
1644,10 → 1631,10
define-tag: "whitelist"
local-zone: "." transparent
local-zone-tag: "." "whitelist"
include: /etc/unbound/conf.d/common/local-forward/*
include: /etc/unbound/conf.d/common/local-dns/*
include: /etc/unbound/conf.d/whitelist/*
include: /usr/local/share/unbound-wl-enabled/*
include: /etc/unbound/conf.d/whitelist/*
include: /etc/unbound/conf.d/common/local-dns/*
include: /etc/unbound/conf.d/common/local-forward/*
forward-zone:
name: "."
forward-addr: 127.0.0.1@55
1674,8 → 1661,9
hide-version: yes
hide-identity: yes
do-ip6: no
include: /etc/unbound/conf.d/common/local-forward/*
include: /etc/unbound/conf.d/common/local-dns/*
include: /etc/unbound/conf.d/blackhole/*
include: /etc/unbound/conf.d/common/local-forward/*
EOF
 
if [ ! -e /lib/systemd/system/unbound.service.default ]
/scripts/alcasar-conf.sh
344,7 → 344,7
echo $line >> /etc/hosts
fi
done < /tmp/hosts
rm -f /tmp/hosts
rm -f /tmp/hosts
# MOTD
$SED "s@'https://\(.\+\)/acc'@'https://$HOSTNAME.$DOMAIN/acc'@" /etc/mageia-release
# Lighttpd
/scripts/alcasar-dns-local.sh
22,7 → 22,6
INTIF=`grep ^INTIF $ALCASAR_CONF_FILE|cut -d"=" -f2`
INT_DNS_ACTIVE=`grep INT_DNS_ACTIVE $ALCASAR_CONF_FILE|cut -d"=" -f2`
LOCAL_DNS_FILE="/etc/unbound/conf.d/common/local-dns/$INTIF.conf"
LOCAL_DNS_BLACKHOLE_FILE="/etc/unbound/conf.d/blackhole/iface.$INTIF.conf"
 
usage="Usage: alcasar-dns-local.sh {--on | -on} | {--off | -off} | {--add | -add} ip domain | {--del | -del} ip domain | {--reload | -reload}"
nb_args=$#
40,26 → 39,12
done
}
 
function hosts_to_unbound(){ # configure the unbound conf file with local host names resolution (forward + blackhole)
function hosts_to_unbound(){ # configure the unbound conf file with local host names resolution
cat << EOF > $LOCAL_DNS_FILE
server:
local-zone: "$INT_DNS_DOMAIN" static
local-data: "$INT_DNS_HOST.$INT_DNS_DOMAIN A $INT_DNS_IP"
local-data-ptr: "$INT_DNS_IP $INT_DNS_HOST.$INT_DNS_DOMAIN"
EOF
cat << EOF > $LOCAL_DNS_BLACKHOLE_FILE
server:
server:
interface: ${INT_DNS_IP}@56
access-control-view: $INT_DNS_IP_MASK $INTIF
view:
name: "$INTIF"
local-zone: "." redirect
local-data: ". A $INT_DNS_IP"
local-zone: "$INT_DNS_DOMAIN" static
local-data: "$INT_DNS_HOST.$INT_DNS_DOMAIN A $INT_DNS_IP"
local-data-ptr: "$INT_DNS_IP $INT_DNS_HOST.$INT_DNS_DOMAIN"
EOF
while read -r line
do
ip_address=$(echo $line | awk '{ print $1 }')
68,8 → 53,6
then
echo -e "\tlocal-data: \"$domain.$INT_DNS_DOMAIN A $ip_address\"" >> $LOCAL_DNS_FILE
echo -e "\tlocal-data-ptr: \"$ip_address $domain.$INT_DNS_DOMAIN\"" >> $LOCAL_DNS_FILE
echo -e "\tlocal-data: \"$domain.$INT_DNS_DOMAIN A $ip_address\"" >> $LOCAL_DNS_BLACKHOLE_FILE
echo -e "\tlocal-data-ptr: \"$ip_address $domain.$INT_DNS_DOMAIN\"" >> $LOCAL_DNS_BLACKHOLE_FILE
fi
done < $LOCAL_HOSTNAME_FILE
}
/web/acc/manager/htdocs/stats.php
18,36 → 18,63
if($Language == 'fr'){
$l_Pagename = "Usage quotidien";
$l_title = "Analyse journalière";
$l_sessions = "Sessions";
$l_usage = "temps d'utilisation total";
$l_uploads = "Données sortantes";
$l_downloads = "Données entrantes";
$l_downloads = "Données entrantes";
$l_from = "Du";
$l_to = "au";
$l_user = "utilisateur";
$l_onserver = "sur le serveur";
$l_fields_to_display = "Champs à afficher";
$l_number_of_sessions = "Nombre de sessions";
$l_total_usage_time = "Temps d'usage total";
$l_date = "date";
$l_daily_summary = "Récapitulatif journalier";
$l_refresh = "Rafraîchir";
$l_stat_for_all = "Statistique pour <b><font color=\"darkblue\">tous</font></b> les utilisateurs";
$l_stat_for_user = "Statistique pour l'utilisateur :";
$l_maximum = "Maximum";
$l_average = "Moyenne";
$l_summary = "Récapitulatif";
} else if($Language == 'es') {
$l_Pagename = "Uso diario";
$l_title = "SAnálisis diario";
$l_sessions = "sesiones";
$l_usage = "total usage time";
$l_uploads = "Datos de salida";
$l_downloads = "Datos entrantes";
$l_downloads = "Datos entrantes";
$l_from = "Del";
$l_to = "al";
$l_user = "usuario";
$l_onserver = "en el servidor";
$l_fields_to_display = "Campos a mostrar";
$l_number_of_sessions = "Número de sesiones";
$l_total_usage_time = "Tiempo total de uso";
$l_date = "Fecha";
$l_daily_summary = "Resumen diaro";
$l_refresh = "Actualizar";
$l_stat_for_all = "Estadísticas para <b><font color=\"darkblue\">todos</font></b> los usuarios";
$l_stat_for_user = "Etadísticas para el usuario :";
$l_maximum = "Máximo";
$l_average = "Promedio";
$l_summary = "Résumen";
} else {
$l_Pagename = "Daily use";
$l_title = "Daily analysis";
$l_sessions = "Sessions";
$l_usage = "tiempo total de uso";
$l_uploads = "Uploads";
$l_downloads = "Downloads";
$l_downloads = "Downloads";
$l_from = "From";
$l_to = "to";
$l_user = "user";
$l_onserver = "on the server";
$l_fields_to_display = "Fields to display";
$l_number_of_sessions = "Number of sesions";
$l_total_usage_time = "Total usage time";
$l_date = "date";
$l_daily_summary = "Daily summary";
$l_refresh = "Refresh";
$l_stat_for_all = "Statistic for <b><font color=\"darkblue\">all</font></b> users";
$l_stat_for_user = "Statistic for user :";
$l_maximum = "Maximum";
$l_average = "Average";
$l_summary = "Summary";
}
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
106,10 → 133,11
$column[3] = "$column3";
$selected3["$column3"] = 'selected';
 
$message['sessions'] = $l_sessions;
$message['usage'] = $l_usage;
$message['sessions'] = $l_number_of_sessions;
$message['usage'] = $l_total_usage_time;
$message['upload'] = $l_uploads;
$message['download'] = $l_downloads;
 
if ($config['general_stats_use_totacct'] == 'yes'){
$sql_val['sessions'] = 'connnum';
$sql_val['usage'] = 'conntotduration';
/web/acc/manager/html/stats.html.php
7,21 → 7,21
<td colspan="2" align=center>
<table border=0 cellspacing=2 cellpadding=2>
<tr valign=bottom>
<td><small><b><?= $l_from ?></b></small></td>
<td><small><b><?= $l_to ?></b></small></td>
<td><small><b><?= $l_user ?></b></small></td>
<td><small><b><?= $l_onserver ?></b></small></td>
<td><small><b><?=$l_from?></b></small></td>
<td><small><b><?=$l_to?></b></small></td>
<td><small><b><?=$l_user?></b></small></td>
<td><small><b><?=$l_onserver?></b></small></td>
<td>&nbsp;</td>
</tr>
<tr valign=middle>
<?php if(!isset($login)) { $login = ""; } ?>
<td valign=middle><input type="text" name="after" size="12" value="<?php echo $after; ?>" ></td>
<td valign=middle><input type="text" name="before" size="12" value="<?php echo $before; ?>"></td>
<td valign=middle><input type="text" name="login" size="12" value="<?php echo $login; ?>" ></td>
<td valign=middle><input type="text" name="after" size="12" value="<?=$after?>" ></td>
<td valign=middle><input type="text" name="before" size="12" value="<?=$before?>"></td>
<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): ?>
<option value="<?php echo $val; ?>"><?php echo $key; ?>
<option value="<?=$val?>"><?=$key?>
<?php endforeach; ?>
</select>
</td>
31,86 → 31,49
</td>
</tr>
</table>
<center>Statistiques pour
<?php
if ($login == '')
echo <<<EOM
<b><font color="darkblue">tous</font></b> les usagers
EOM;
else
echo <<<EOM
l'usager <b><font color="darkblue">$login</font></b>
EOM;
?>
<tr>
<td align="center">
<tr>
<td>Champs affich&eacute;s :</td><td colspan=10 align=center nowrap><select name="column1">
<option <?php if(isset($selected1['sessions'])){print($selected1['sessions']);} ?> value="sessions">Nbre de sessions
<option <?php if(isset($selected1['usage'])){print($selected1['usage']);} ?> value="usage">Temps d'utilisation total
<option value="upload">------------------
<option <?php if(isset($selected1['upload'])){print($selected1['upload']);} ?> value="upload">uploads
<option <?php if(isset($selected1['download'])){print($selected1['download']);} ?> value="download">downloads
</select> <select name="column2">
<option <?php if(isset($selected2['sessions'])){print($selected2['sessions']);} ?> value="sessions">Nbre de sessions
<option <?php if(isset($selected2['usage'])){print($selected2['usage']);} ?> value="usage">Temps d'utilisation total
<option value="upload">------------------
<option <?php if(isset($selected2['upload'])){print($selected2['upload']);} ?> value="upload">uploads
<option <?php if(isset($selected2['download'])){print($selected2['download']);} ?> value="download">downloads
</select> <select name="column3">
<option <?php if(isset($selected3['sessions'])){print($selected3['sessions']);} ?> value="sessions">Nbre de sessions
<option <?php if(isset($selected3['usage'])){print($selected3['usage']);} ?> value="usage">Temps d'utilisation total
<option value="upload">------------------
<option <?php if(isset($selected3['upload'])){print($selected3['upload']);} ?> value="upload">uploads
<option <?php if(isset($selected3['download'])){print($selected3['download']);} ?> value="download">downloads
 
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td><?=$l_fields_to_display?></td><td>
<select name="column1">
<option <?php if(isset($selected1['sessions'])){print($selected1['sessions']);} ?> value="sessions"><?=$l_number_of_sessions?>
<option <?php if(isset($selected1['usage'])){print($selected1['usage']);} ?> value="usage"><?=$l_total_usage_time?>
<option value="upload">------------------
<option <?php if(isset($selected1['upload'])){print($selected1['upload']);} ?> value="upload"><?=$l_uploads?>
<option <?php if(isset($selected1['download'])){print($selected1['download']);} ?> value="download"><?=$l_downloads?>
</select> <select name="column2">
<option <?php if(isset($selected2['sessions'])){print($selected2['sessions']);} ?> value="sessions"><?=$l_number_of_sessions?>
<option <?php if(isset($selected2['usage'])){print($selected2['usage']);} ?> value="usage"><?=$l_total_usage_time?>
<option value="upload">------------------
<option <?php if(isset($selected2['upload'])){print($selected2['upload']);} ?> value="upload"><?=$l_uploads?>
<option <?php if(isset($selected2['download'])){print($selected2['download']);} ?> value="download"><?=$l_downloads?>
</select> <select name="column3">
<option <?php if(isset($selected3['sessions'])){print($selected3['sessions']);} ?> value="sessions"><?=$l_number_of_sessions?>
<option <?php if(isset($selected3['usage'])){print($selected3['usage']);} ?> value="usage"><?=$l_total_usage_time?>
<option value="upload">------------------
<option <?php if(isset($selected3['upload'])){print($selected3['upload']);} ?> value="upload"><?=$l_uploads?>
<option <?php if(isset($selected3['download'])){print($selected3['download']);} ?> value="download"><?=$l_downloads?>
</select>
</td>
</tr>
<hr size=1 noshade>
 
<tr>
<td colspan=10 align=center valign=middle>
</tr>
</table>
<hr size=1 noshade>
<table border=0 width="100%">
<tr>
<td width=100% align=left>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=right><input type="submit" class=button value="Rafra&icirc;chir"></td>
</tr>
</table>
<td align="center">
<?php
if ($login == '') echo $l_stat_for_all;
else echo "$l_stat_for_user <b><font color=\"darkblue\">$login</font></b>"
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<tr>
<td colspan=10 height=20><img src="images/pixel.gif"></td>
</tr>
</table>
</div>
<div class="panel-header"><?= $l_title ?></div>
<div class="panel-row">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tbody style='font-family: "DejaVu Sans";font-size: small;color: #666666;'>
<td colspan=10 height=20 align=center>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tbody>
<tr bgcolor="#666660" align=center valign=top><th>
<font color="white">Analyse journali&egrave;re</font>&nbsp;
</th>
</tr>
<tr bgcolor="#FFCC66">
<td>
<img src="/images/pix.gif" width="1" height="2">
</td>
</tr>
</tbody>
</table>
<tr valign=top>
<tr>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>date</th>
<th><?=$l_date?></th>
<?php
echo <<<EOM
<th colspan=3>$message[$column1]</th>
153,30 → 116,19
</tr>
</table>
</td>
 
</tr>
EOM;
}
?>
</table>
</tbody>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#666660" align=center valign=top>
<th>
<font color="white"><?=$l_daily_summary?></font>
</th>
</tr>
</table>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr valign=top>
<td width=440></td>
<tr bgcolor="#666660" align=center valign=top><th>
<font color="white">R&eacute;capitulatif journalier</font>&nbsp;
</th></tr>
<tr bgcolor="#FFCC66">
<td>
<img src="/images/pix.gif" width="1" height="3">
</td>
</tr>
</table>
</td></tr>
<tr valign=top><td colspan=2>
<tr><td>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ff
<table border=0 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ff
ffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>&nbsp;</th>
191,19 → 143,19
<?php
echo <<<EOM
<tr align=center bgcolor="#efefe4">
<td>maximum</td>
<td>$l_maximum</td>
<td>{$data['max'][1]}</td>
<td>{$data['max'][2]}</td>
<td>{$data['max'][3]}</td>
</tr>
<tr align=center bgcolor="#f7f7e4">
<td>moyenne</td>
<td>$l_average</td>
<td>{$data['avg'][1]}</td>
<td>{$data['avg'][2]}</td>
<td>{$data['avg'][3]}</td>
</tr>
<tr align=center bgcolor="#efefe4">
<td>r&eacute;capitulatif</td>
<td>$l_summary</td>
<td>{$data['sum'][1]}</td>
<td>{$data['sum'][2]}</td>
<td>{$data['sum'][3]}</td>
210,12 → 162,9
</tr>
EOM;
?>
</td></tr>
</td></tr>
</table>
</div>
</div>
</div>
</form>
</center>
</body>
</html>