/alcasar.sh |
---|
44,6 → 44,7 |
# cron : Logs export + watchdog + connexion statistics |
# fail2ban : Fail2ban installation and configuration |
# post_install : Security, log rotation, etc. |
# gammu_smsd : Autoregister addon (gammu-smsd) |
DATE=`date '+%d %B %Y - %Hh%M'` |
DATE_SHORT=`date '+%d/%m/%Y'` |
65,6 → 66,7 |
# ******* DBMS parameters - paramètres SGBD ******** |
DB_RADIUS="radius" # database name used by FreeRadius server |
DB_USER="radius" # user name allows to request the users database |
DB_GAMMU="gammu" # database name used by Gammu-smsd |
# ******* Network parameters - paramètres réseau ******* |
HOSTNAME="alcasar" # |
DOMAIN="localdomain" # default local domain |
985,7 → 987,7 |
groupadd -f chilli |
useradd -r -g chilli -s /bin/false -c "system user for coova-chilli" chilli |
} # End of param_chilli () |
################################################################## |
## Fonction "param_dansguardian" ## |
## - Paramètrage du gestionnaire de contenu Dansguardian ## |
1657,6 → 1659,73 |
reboot |
} # End post_install () |
################################################################## |
## Fonction "gammu_smsd" ## |
## - Creation de la base de donnée Gammu ## |
## - Creation du fichier de config: gammu_smsd_conf ## |
## ## |
################################################################## |
gammu_smsd() |
{ |
# Create 'gammu' databse |
MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec" |
$MYSQL="CREATE DATABASE IF NOT EXISTS $DB_GAMMU;GRANT ALL ON $DB_GAMMU.* TO $DB_USER@localhost IDENTIFIED BY '$radiuspwd';FLUSH PRIVILEGES" |
# Add a gammu database structure |
mysql -u$DB_USER -p$radiuspwd $DB_GAMMU < $DIR_CONF/gammu-smsd-db-vierge.sql |
# Creation du fichier de config gammu_smsd_conf |
cat << EOF > /etc/gammu_smsd_conf |
[gammu] |
port = /dev/ttyUSB0 |
connection = at115200 |
;######################################################## |
[smsd] |
PIN = 1234 |
logfile = /var/log/gammu-smsd/gammu-smsd.log |
logformat = textall |
debuglevel = 0 |
service = sql |
driver = native_mysql |
user = $DB_USER |
password = $radiuspwd |
pc = localhost |
database = $DB_GAMMU |
RunOnReceive = /usr/local/bin/alcasar-sms.sh --new_sms |
StatusFrequency = 30 |
LoopSleep = 2 |
;ResetFrequency = 300 |
;HardResetFrequency = 120 |
CheckSecurity = 1 |
CheckSignal = 1 |
CheckBattery = 0 |
EOF |
chmod 755 /etc/gammu_smsd_conf |
#Creation dossier de log Gammu-smsd |
mkdir /var/log/gammu-smsd |
chmod 755 /var/log/gammu-smsd |
#Edition du script sql gammu <-> radius |
$SED "10c u_db=\"$DB_USER\"" $DIR_DEST_BIN/alcasar-sms.sh |
$SED "11c p_db=\"$radiuspwd\"" $DIR_DEST_BIN/alcasar-sms.sh |
} # END gammu_smsd() |
################################# |
# Main Install loop # |
################################# |
1719,7 → 1788,6 |
then |
exit 0 |
fi |
echo "STOP" ; read a |
if [ -e $CONF_FILE ] |
then |
# Uninstall the running version |
/conf/gammu-smsd-db-vierge.sql |
---|
0,0 → 1,295 |
-- phpMyAdmin SQL Dump |
-- version 3.5.8.2 |
-- http://www.phpmyadmin.net |
-- |
-- Client: localhost |
-- Généré le: Mar 06 Mai 2014 à 10:39 |
-- Version du serveur: 5.5.25-MariaDB |
-- Version de PHP: 5.3.27 |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
SET time_zone = "+00:00"; |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
/*!40101 SET NAMES utf8 */; |
-- |
-- Base de données: `gammu` |
-- |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `daemons` |
-- |
CREATE TABLE IF NOT EXISTS `daemons` ( |
`Start` text NOT NULL, |
`Info` text NOT NULL |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `gammu` |
-- |
CREATE TABLE IF NOT EXISTS `gammu` ( |
`Version` int(11) NOT NULL DEFAULT '0' |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
-- |
-- Contenu de la table `gammu` |
-- |
INSERT INTO `gammu` (`Version`) VALUES |
(13); |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `inbox` |
-- |
CREATE TABLE IF NOT EXISTS `inbox` ( |
`UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
`ReceivingDateTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`Text` text NOT NULL, |
`SenderNumber` varchar(20) NOT NULL DEFAULT '', |
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression', |
`UDH` text NOT NULL, |
`SMSCNumber` varchar(20) NOT NULL DEFAULT '', |
`Class` int(11) NOT NULL DEFAULT '-1', |
`TextDecoded` text NOT NULL, |
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`RecipientID` text NOT NULL, |
`Processed` enum('false','true') NOT NULL DEFAULT 'false', |
PRIMARY KEY (`ID`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ; |
-- |
-- Déclencheurs `inbox` |
-- |
DROP TRIGGER IF EXISTS `inbox_timestamp`; |
DELIMITER // |
CREATE TRIGGER `inbox_timestamp` BEFORE INSERT ON `inbox` |
FOR EACH ROW BEGIN |
IF NEW.ReceivingDateTime = '0000-00-00 00:00:00' THEN |
SET NEW.ReceivingDateTime = CURRENT_TIMESTAMP(); |
END IF; |
END |
// |
DELIMITER ; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `outbox` |
-- |
CREATE TABLE IF NOT EXISTS `outbox` ( |
`UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
`InsertIntoDB` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`SendingDateTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`SendBefore` time NOT NULL DEFAULT '23:59:59', |
`SendAfter` time NOT NULL DEFAULT '00:00:00', |
`Text` text, |
`DestinationNumber` varchar(20) NOT NULL DEFAULT '', |
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression', |
`UDH` text, |
`Class` int(11) DEFAULT '-1', |
`TextDecoded` text NOT NULL, |
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`MultiPart` enum('false','true') DEFAULT 'false', |
`RelativeValidity` int(11) DEFAULT '-1', |
`SenderID` varchar(255) DEFAULT NULL, |
`SendingTimeOut` timestamp NULL DEFAULT '0000-00-00 00:00:00', |
`DeliveryReport` enum('default','yes','no') DEFAULT 'default', |
`CreatorID` text NOT NULL, |
PRIMARY KEY (`ID`), |
KEY `outbox_date` (`SendingDateTime`,`SendingTimeOut`), |
KEY `outbox_sender` (`SenderID`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
-- |
-- Déclencheurs `outbox` |
-- |
DROP TRIGGER IF EXISTS `outbox_timestamp`; |
DELIMITER // |
CREATE TRIGGER `outbox_timestamp` BEFORE INSERT ON `outbox` |
FOR EACH ROW BEGIN |
IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN |
SET NEW.InsertIntoDB = CURRENT_TIMESTAMP(); |
END IF; |
IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN |
SET NEW.SendingDateTime = CURRENT_TIMESTAMP(); |
END IF; |
IF NEW.SendingTimeOut = '0000-00-00 00:00:00' THEN |
SET NEW.SendingTimeOut = CURRENT_TIMESTAMP(); |
END IF; |
END |
// |
DELIMITER ; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `outbox_multipart` |
-- |
CREATE TABLE IF NOT EXISTS `outbox_multipart` ( |
`Text` text, |
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression', |
`UDH` text, |
`Class` int(11) DEFAULT '-1', |
`TextDecoded` text, |
`ID` int(10) unsigned NOT NULL DEFAULT '0', |
`SequencePosition` int(11) NOT NULL DEFAULT '1', |
PRIMARY KEY (`ID`,`SequencePosition`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `pbk` |
-- |
CREATE TABLE IF NOT EXISTS `pbk` ( |
`ID` int(11) NOT NULL AUTO_INCREMENT, |
`GroupID` int(11) NOT NULL DEFAULT '-1', |
`Name` text NOT NULL, |
`Number` text NOT NULL, |
PRIMARY KEY (`ID`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `pbk_groups` |
-- |
CREATE TABLE IF NOT EXISTS `pbk_groups` ( |
`Name` text NOT NULL, |
`ID` int(11) NOT NULL AUTO_INCREMENT, |
PRIMARY KEY (`ID`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `phones` |
-- |
CREATE TABLE IF NOT EXISTS `phones` ( |
`ID` text NOT NULL, |
`UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
`InsertIntoDB` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`TimeOut` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`Send` enum('yes','no') NOT NULL DEFAULT 'no', |
`Receive` enum('yes','no') NOT NULL DEFAULT 'no', |
`IMEI` varchar(35) NOT NULL, |
`Client` text NOT NULL, |
`Battery` int(11) NOT NULL DEFAULT '-1', |
`Signal` int(11) NOT NULL DEFAULT '-1', |
`Sent` int(11) NOT NULL DEFAULT '0', |
`Received` int(11) NOT NULL DEFAULT '0', |
PRIMARY KEY (`IMEI`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
-- |
-- Déclencheurs `phones` |
-- |
DROP TRIGGER IF EXISTS `phones_timestamp`; |
DELIMITER // |
CREATE TRIGGER `phones_timestamp` BEFORE INSERT ON `phones` |
FOR EACH ROW BEGIN |
IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN |
SET NEW.InsertIntoDB = CURRENT_TIMESTAMP(); |
END IF; |
IF NEW.TimeOut = '0000-00-00 00:00:00' THEN |
SET NEW.TimeOut = CURRENT_TIMESTAMP(); |
END IF; |
END |
// |
DELIMITER ; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `sentitems` |
-- |
CREATE TABLE IF NOT EXISTS `sentitems` ( |
`UpdatedInDB` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
`InsertIntoDB` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`SendingDateTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', |
`DeliveryDateTime` timestamp NULL DEFAULT NULL, |
`Text` text NOT NULL, |
`DestinationNumber` varchar(20) NOT NULL DEFAULT '', |
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL DEFAULT 'Default_No_Compression', |
`UDH` text NOT NULL, |
`SMSCNumber` varchar(20) NOT NULL DEFAULT '', |
`Class` int(11) NOT NULL DEFAULT '-1', |
`TextDecoded` text NOT NULL, |
`ID` int(10) unsigned NOT NULL DEFAULT '0', |
`SenderID` varchar(255) NOT NULL, |
`SequencePosition` int(11) NOT NULL DEFAULT '1', |
`Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error') NOT NULL DEFAULT 'SendingOK', |
`StatusError` int(11) NOT NULL DEFAULT '-1', |
`TPMR` int(11) NOT NULL DEFAULT '-1', |
`RelativeValidity` int(11) NOT NULL DEFAULT '-1', |
`CreatorID` text NOT NULL, |
PRIMARY KEY (`ID`,`SequencePosition`), |
KEY `sentitems_date` (`DeliveryDateTime`), |
KEY `sentitems_tpmr` (`TPMR`), |
KEY `sentitems_dest` (`DestinationNumber`), |
KEY `sentitems_sender` (`SenderID`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
-- |
-- Déclencheurs `sentitems` |
-- |
DROP TRIGGER IF EXISTS `sentitems_timestamp`; |
DELIMITER // |
CREATE TRIGGER `sentitems_timestamp` BEFORE INSERT ON `sentitems` |
FOR EACH ROW BEGIN |
IF NEW.InsertIntoDB = '0000-00-00 00:00:00' THEN |
SET NEW.InsertIntoDB = CURRENT_TIMESTAMP(); |
END IF; |
IF NEW.SendingDateTime = '0000-00-00 00:00:00' THEN |
SET NEW.SendingDateTime = CURRENT_TIMESTAMP(); |
END IF; |
END |
// |
DELIMITER ; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `SMS_ban_perm` |
-- |
CREATE TABLE IF NOT EXISTS `SMS_ban_perm` ( |
`SenderNumber` varchar(20) CHARACTER SET utf8 NOT NULL, |
`Expiration` varchar(255) CHARACTER SET utf8 NOT NULL, |
`Perm` int(11) NOT NULL, |
`date_add` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, |
PRIMARY KEY (`SenderNumber`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf32; |
-- -------------------------------------------------------- |
-- |
-- Structure de la table `SMS_ban_temp` |
-- |
CREATE TABLE IF NOT EXISTS `SMS_ban_temp` ( |
`ID` int(11) NOT NULL AUTO_INCREMENT, |
`SenderNumber` varchar(20) NOT NULL, |
PRIMARY KEY (`ID`) |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
/conf/logrotate.d/gammu |
---|
0,0 → 1,7 |
/var/log/gammu-smsd/gammu-smsd.log { |
monthly |
rotate 12 |
nocreate |
missingok |
compress |
} |
/conf/sudoers |
---|
6,7 → 6,7 |
# |
# Host alias specification |
Host_Alias LAN_ORG=172.16.0.0/255.255.0.0,localhost #réseau de l'organisme |
Host_Alias LAN_ORG=192.168.182.0/255.255.255.0,localhost #réseau de l'organisme |
# User alias specification |
User_Alias ADMIN=sysadmin # compte d'admin local de l'organisme |
User_Alias ADMWEB=apache # compte lié à l'interface de gestion |
25,6 → 25,7 |
Cmnd_Alias UAM=/usr/local/sbin/alcasar-uamallowed.sh # pour gérer les site de confiance (uamallowed) |
Cmnd_Alias SERVICE=/sbin/service,/usr/bin/killall,/sbin/chkconfig,/bin/systemctl # pour gérer les services |
Cmnd_Alias SSL=/usr/bin/openssl # pour récupérer les info des certificats |
Cmnd_Alias GAMMU=/sbin/pidof,/usr/local/bin/alcasar-sms.sh # permet l'execution de gammu (droit root) |
# Defaults specification |
# Defaults syslog=auth |
44,6 → 45,6 |
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom |
# %users localhost=/sbin/shutdown -h now |
ADMWEB LAN_ORG=(root) NOPASSWD: NET,SYSTEM_BACKUP,SQL,BL,NF,EXPORT,RADDB,LOGOUT,UAM,SERVICE,SSL |
ADMIN LAN_ORG=(root) NOPASSWD: NET,/sbin/poweroff,/sbin/shutdown -h now,/sbin/reboot,URPMI,BYPASS,SYSTEM_BACKUP,SQL,EXPORT,SERVICE |
ADMWEB LAN_ORG=(root) NOPASSWD: NET,SYSTEM_BACKUP,SQL,BL,NF,EXPORT,RADDB,LOGOUT,UAM,SERVICE,SSL,GAMMU |
ADMIN LAN_ORG=(root) NOPASSWD: NET,/sbin/poweroff,/sbin/shutdown -h now,/sbin/reboot,URPMI,BYPASS,SYSTEM_BACKUP,SQL,EXPORT,SERVICE,GAMMU |
/scripts/alcasar-sms.sh |
---|
0,0 → 1,427 |
#!/bin/bash |
######################################### |
####### VARIABLES ne pas toucher ######## |
nb_essais=3 |
time_account=1 |
time_ban=1 |
numero_alcasar=XXXXXXXXXX |
######################################### |
####### IDs DB ########################## |
u_db="radius" |
p_db="password" |
######################################### |
######################################### |
rad="radcheck" |
radgp="radusergroup" |
radgpck="radgroupcheck" |
radinf="userinfo" |
sms_p="SMS_ban_perm" |
sms_t="SMS_ban_temp" |
inb="inbox" |
config="/etc/gammu_smsd_conf" |
logfile="/var/log/gammu-smsd/gammu-smsd.log" |
script="/usr/local/bin/alcasar-sms.sh" |
separator="########## START ##########" |
end="%%%%%%%%%% STOP %%%%%%%%%%" |
usage="Usage: alcasar-gammu.sh |
Start Gammu-smsd : --start |
Stop Gammu-smsd : --stop |
Process on new sms : --new_sms" |
nb_args=$# |
args=$1 |
# Functions |
function start_gammu() { |
#On truncate la table phones (informations signal / IMEI / batterie / sms recu et envoyé) |
sql_trunc_phones="connect gammu; TRUNCATE phones;" |
result=$(mysql --user=$u_db --password=$p_db -B -se "$sql_trunc_phones") |
#On verifie que le groupe sms est créé |
sql_check_gp="connect radius; SELECT * FROM $radgp WHERE username='sms' AND groupname='sms';" |
result=$(mysql --user=$u_db --password=$p_db -B -se "$sql_check_gp") |
if test -z "$result" |
then |
sql_add_gp="connect radius; INSERT INTO $radgp (username,groupname) VALUES ('sms','sms');" |
sql_add_gp_att="connect radius; INSERT INTO $radgpck (groupname,attribute,op,value) VALUES ('sms','Simultaneous-Use',':=',1);" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_gp" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_gp_att" |
fi |
#Start gammu |
echo $separator >> $logfile |
sudo gammu-smsd --config $config --pid /var/run/gammu-smsd.pid --daemon |
} # end function start_gammu |
function stop_gammu() { |
#Stop gammu |
sudo kill -9 gammu-smsd |
sleep 10 |
echo $end >> $logfile |
} # end function stop_gammu |
function unlock() { |
#Suppression du numero dans la table SMS_ban_perm |
sql_remove_ban_perm="connect gammu; DELETE FROM $sms_p" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_perm WHERE SenderNumber=$1;" |
# Ajout au groupe sms |
sql_remove_gp="connect radius; DELETE FROM $radgp WHERE username='$1';" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_gp" |
# Suppression du compte dans Radcheck |
sql_remove_compte="connect radius; DELETE FROM $rad WHERE username='$1';" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_compte" |
} # end function unlock |
function new_sms() { |
# Check Inbox table, manage Ban temp and perm, create account |
export salt='$1$passwd$' |
sql_select_inbox="connect gammu; SELECT ID, SenderNumber, TextDecoded FROM $inb;" |
sql_delete_inbox="connect gammu; DELETE FROM $inb" |
mysql --user=$u_db --password=$p_db -B -se "$sql_select_inbox" | while read result; |
do |
# On recupère le nombre de mots (resultat) |
nb=$(echo $result | wc -w) |
# On récypère le numéro de l'ID |
id=$(echo $result | cut -d ' ' -f1) |
numero=$(echo $result | cut -d ' ' -f2 | sed -e 's/+33/0/g') |
# On vérifie que le numéro n'est pas Ban Perm |
sql_ban_perm="connect gammu; SELECT * FROM $sms_p WHERE SenderNumber=$numero" |
result_bp=$(mysql --user=$u_db --password=$p_db -B -se "$sql_ban_perm") |
if test -z "$result_bp" |
then |
# Test sur le nombre de mots (resultat) |
if [ $nb -eq 2 ] # Si 2 mots : le mot de passe est manquant |
then |
# On incrémente de 1 dans la table des bans temp // NO PASSWORD |
sql_add_temp="connect gammu; INSERT INTO $sms_t(SenderNumber) VALUES ('$numero');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_temp" |
elif [ $nb -eq 3 ] # Si 3 mots : id + mot de passe + numero |
then |
export pass=$(echo $result | cut -d ' ' -f3) |
pass_salt=$(perl -e'print crypt($ARGV[0],$ARGV[1])' $pass $salt) |
export LC_TIME="en_US.UTF-8" |
expir=$(date '+%d %B %Y' -d "$time_account days") |
# Suppression du compte dans Radcheck |
sql_del_compte="connect radius; DELETE FROM $rad WHERE username='$numero';" |
mysql --user=$u_db --password=$p_db -B -se "$sql_del_compte" |
# Ajout table RadCheck : creation du compte |
sql_add_pass="connect radius; INSERT INTO $rad (username,attribute,op,value) VALUES ('$numero','Crypt-Password',':=','$pass_salt');" |
sql_add_expe="connect radius; INSERT INTO $rad (username,attribute,op,value) VALUES ('$numero','Expiration',':=','$expir');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_pass" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_expe" |
# Ajout au groupe sms |
sql_add_gp="connect radius; INSERT INTO $radgp (username,groupname) VALUES ('$numero','sms');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_gp" |
# Suppression du numéro dans table SMS_ban_temp |
sql_remove_ban_temp="connect gammu; DELETE FROM $sms_t" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_temp WHERE SenderNumber=$numero;" |
# Ajout du numero table SMS_ban_perm, 0 : creation du compte |
sql_add_ban_perm="connect gammu; INSERT INTO $sms_p (SenderNumber,Perm,Expiration) VALUES ('$numero',0,'$expir');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_ban_perm" |
else |
# Autrement, le mot de passe est trop grand ( > un mot ) |
# On incrémente d'un 1 dans la table des bans temp |
sql_add_temp="connect gammu; INSERT INTO $sms_t(SenderNumber) VALUES ('$numero');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_temp" |
fi |
# On gère les bans temp en ban perm |
sql_select_temp="connect gammu; SELECT ID FROM $sms_t WHERE SenderNumber='$numero'" |
r_select_temp=$(mysql --user=$u_db --password=$p_db -B -se "$sql_select_temp") |
nb_ban_t=$(echo $r_select_temp| wc -w) |
if [ $nb_ban_t -ge $nb_essais ] |
then |
# Suppression du numéro dans table SMS_ban_temp |
sql_remove_ban_temp="connect gammu; DELETE FROM $sms_t" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_temp WHERE SenderNumber=$numero;" |
export LC_TIME="en_US.UTF-8" |
expir_f=$(date '+%d %B %Y' -d "$time_ban days") |
# Ajout du numero table SMS_ban_perm, 1 : flood |
sql_add_ban_perm="connect gammu; INSERT INTO $sms_p (SenderNumber,Perm,Expiration) VALUES ('$numero',1,'$expir_f');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_ban_perm" |
fi |
else |
date_expiration=$(echo $result_bp | cut -d ' ' -f2,3,4) |
perm=$(echo $result_bp | cut -d ' ' -f5) |
export LC_TIME="en_US.UTF-8" |
date_script=$(date '+%d %B %Y' -d "now") |
# On converti les deux dates en secondes, pour les comparer. |
d_exp=$(date --date "$date_expiration" +%s) |
d_scr=$(date --date "$date_script" +%s) |
if test $d_scr -gt $d_exp # Si le ban à expiré |
then |
# Test sur le nombre de mots (resultat) |
if [ $nb -eq 2 ] # Si 2 mots : le mot de passe est manquant |
then |
# On incrémente de 1 dans la table des bans temp |
sql_add_temp="connect gammu; INSERT INTO $sms_t(SenderNumber) VALUES ('$numero');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_temp" |
elif [ $nb -eq 3 ] # Si 3 mots : id + mot de passe + numero |
then |
date_expiration=$(echo $result_bp | cut -d ' ' -f2,3,4) |
perm=$(echo $result_bp | cut -d ' ' -f5) |
date_script=$(date '+%d %B %Y' -d "now") |
# On converti les deux dates en secondes, pour les comparer. |
d_exp=$(date --date "$date_expiration" +%s) |
d_scr=$(date --date "$date_script" +%s) |
export pass=$(echo $result | cut -d ' ' -f3) |
pass_salt=$(perl -e'print crypt($ARGV[0],$ARGV[1])' $pass $salt) |
export LC_TIME="en_US.UTF-8" |
expir=$(date '+%d %B %Y' -d "$time_account days") |
# Suppression du compte dans Radcheck |
sql_del_compte="connect radius; DELETE FROM $rad WHERE username='$numero';" |
mysql --user=$u_db --password=$p_db -B -se "$sql_del_compte" |
# Creation du compte |
sql_add_pass="connect radius; INSERT INTO $rad (username,attribute,op,value) VALUES ('$numero','Crypt-Password',':=','$pass_salt');" |
sql_add_expe="connect radius; INSERT INTO $rad (username,attribute,op,value) VALUES ('$numero','Expiration',':=','$expir');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_pass" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_expe" |
# Ajout au groupe sms |
sql_add_gp="connect radius; INSERT INTO $radgp (username,groupname) VALUES ('$numero','sms');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_gp" |
# Suppression du numéro dans table SMS_ban_temp |
sql_remove_ban_temp="connect gammu; DELETE FROM $sms_t" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_temp WHERE SenderNumber=$numero;" |
#Suppression du numero dans la table SMS_ban_perm |
sql_remove_ban_perm="connect gammu; DELETE FROM $sms_p" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_perm WHERE SenderNumber=$numero;" |
# Ajout du numero table SMS_ban_perm, 0 : creation du compte |
sql_add_ban_perm="connect gammu; INSERT INTO $sms_p (SenderNumber,Perm,Expiration) VALUES ('$numero',0,'$expir');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_ban_perm" |
else |
# Autrement, le mot de passe est trop grand ( > un mot ) |
# On incrémente d'un 1 dans la table des bans temp |
sql_add_temp="connect gammu; INSERT INTO $sms_t(SenderNumber) VALUES ('$numero');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_temp" |
echo "Mot de passe incorrect, ajout du numero en ban temporaire" |
fi |
# On gère les bans temp en ban perm |
sql_select_temp="connect gammu; SELECT ID FROM $sms_t WHERE SenderNumber='$numero'" |
r_select_temp=$(mysql --user=$u_db --password=$p_db -B -se "$sql_select_temp") |
nb_ban_t=$(echo $r_select_temp| wc -w) |
if [ $nb_ban_t -ge $nb_essais ] |
then |
echo "Trop de ban temporaire" |
#Suppression du numero dans la table SMS_ban_perm |
sql_remove_ban_perm="connect gammu; DELETE FROM $sms_p" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_perm WHERE SenderNumber=$numero;" |
# Suppression du numéro dans table SMS_ban_temp |
sql_remove_ban_temp="connect gammu; DELETE FROM $sms_t" |
mysql --user=$u_db --password=$p_db -B -se "$sql_remove_ban_temp WHERE SenderNumber=$numero;" |
export LC_TIME="en_US.UTF-8" |
expir_f=$(date '+%d %B %Y' -d "$time_ban days") |
# Ajout du numero table SMS_ban_perm, 1 : flood |
sql_add_ban_perm="connect gammu; INSERT INTO $sms_p (SenderNumber,Perm,Expiration) VALUES ('$numero',1,'$expir_f');" |
mysql --user=$u_db --password=$p_db -B -se "$sql_add_ban_perm" |
fi |
else |
echo "Le ban de $numero est encore valide" |
fi |
fi |
# On supprime la ligne d'ID=$id dans inbox |
mysql --user=$u_db --password=$p_db -B -e "$sql_delete_inbox WHERE ID=$id;" |
done |
} # end function new_sms |
# CORE |
case $args in |
-h | --help) |
echo "$usage" |
exit 0 |
;; |
--start) |
start_gammu |
exit 0 |
;; |
--stop) |
stop_gammu |
exit 0 |
;; |
--last_nosim) |
# Récupère la dernière ligne où NOSIM est présent (error) |
cat $logfile | grep -n "NOSIM" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--last_start) |
# Récupère la dernière ligne où ########## est présent (séparateur) |
cat $logfile | grep -n "##########" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--last_stop) |
# Récupère la dernière ligne où %%%%%%%%%% est présent (séparateur) |
cat $logfile | grep -n "%%%%%%%%%%" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--last_writeerror) |
#Récupère la dernière ligne où SECURITYERROR est présent (error) |
cat $logfile | grep -n "DEVICEWRITEERROR" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--last_timeout) |
# Récupère la dernière ligne où SECURITYERROR est présent (error) |
cat $logfile | grep -n "TIMEOUT" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--last_secu) |
# Récupère la dernière ligne où SECURITYERROR est présent (error) |
cat $logfile | grep -n "SECURITYERROR" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--last_puk) |
# Récupère la dernière ligne où PUK est présent (error) |
cat $logfile | grep -n "UNKNOWN" | cut -d ':' -f1 | tail -n 1 |
exit 0 |
;; |
--log) |
# Récupère le nom du fichier de log |
cat $config | grep logfile | cut -d ' ' -f3 |
exit 0 |
;; |
--pin) |
# Récupère le code PIN (file de conf) |
cat $config | grep PIN | cut -d ' ' -f3 |
exit 0 |
;; |
--replace_pin) |
# Edition du code PIN |
sed -i "9c PIN = $2" $config |
exit 0 |
;; |
--try_ban) |
# Récupère le nombre d'essais avant le ban perm |
grep nb_essais= $script | head -n 1 | cut -d '=' -f2 |
exit 0 |
;; |
--replace_try_ban) |
# Edition le nombre d'essais avant le ban perm |
sed -i "4c nb_essais=$2" $script |
exit 0 |
;; |
--time_account) |
# Récupère la durée en jours de la session créée |
grep time_account= $script | head -n 1 | cut -d '=' -f2 |
exit 0 |
;; |
--replace_time_account) |
# Edition de la durée de la session créée |
sed -i "5c time_account=$2" $script |
exit 0 |
;; |
--time_perm) |
# Récupère la durée un jours d'un ban perm (après flood par exemple) |
grep time_ban= $script | head -n 1 | cut -d '=' -f2 |
exit 0 |
;; |
--replace_time_perm) |
# Edition de la durée d'un ban perm |
sed -i "6c time_ban=$2" $script |
exit 0 |
;; |
--unlock_num) |
# Appel de la fonction unlock : deban un numero $2 |
unlock "$2" |
exit 0 |
;; |
--new_sms) |
# Appel de la fonction new_sms : filtrage du password, creation du compte et ban |
new_sms |
exit 0 |
;; |
--imei_device) |
# Recuperation de l'imei du device |
sql_imei_phones="connect gammu; SELECT \`IMEI\` FROM phones;" |
mysql --user=$u_db --password=$p_db -B -se "$sql_imei_phones" |
exit 0 |
;; |
--signal_device) |
# Recuperation du signal du device |
sql_signal_phones="connect gammu; SELECT \`Signal\` FROM phones;" |
mysql --user=$u_db --password=$p_db -B -se "$sql_signal_phones" |
exit 0 |
;; |
--sms_received) |
# Recuperation du nombre de sms reçu. Depuis la dernière activation. |
sql_sms_received="connect gammu; SELECT \`Received\` FROM phones;" |
mysql --user=$u_db --password=$p_db -B -se "$sql_sms_received" |
exit 0 |
;; |
--numero_alcasar) |
# Récupère le numero de la clé 3g (téléphone) |
grep numero_alcasar= $script | head -n 1 | cut -d '=' -f2 |
exit 0 |
;; |
--replace_numero_alcasar) |
# Edition du numero de la clé 3g (téléphone) |
sed -i "7c numero_alcasar=$2" $script |
exit 0 |
;; |
*) |
# Default |
echo "$usage" |
exit 0 |
;; |
esac |
exit 0 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/scripts/alcasar-urpmi.sh |
---|
12,7 → 12,7 |
VERSION="4" |
ARCH="i586" |
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ****** |
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysql php-mbstring php-sockets rng-utils dnsmasq rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd man" |
PACKAGES="freeradius freeradius-mysql freeradius-ldap freeradius-web apache apache-mod_ssl apache-mod_php dansguardian ipset postfix mariadb ntp bind-utils openssh-server php-mysqli php-xml php-ldap php-mysql php-mbstring php-sockets rng-utils dnsmasq rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd man pm-fallback-policy gammu usbutils locales-en " |
rpm_repository_sync () |
{ |
/scripts/sbin/alcasar-uninstall.sh |
---|
15,7 → 15,7 |
echo "-----------------------------------------------------------------------------" |
echo |
#services_stop |
for i in squid ntpd iptables ulogd dansguardian chilli httpd radiusd freshclam havp dnsmasq mysqld named dhcpd |
for i in squid ntpd iptables ulogd dansguardian chilli httpd radiusd freshclam havp dnsmasq mysqld named dhcpd gammu-smsd |
do |
[ -e /etc/init.d/$i ] && /sbin/chkconfig --del $i && /etc/init.d/$i stop && killall $i 2>/dev/null |
done |
100,8 → 100,14 |
#param_squid |
echo -en "\n- param_squid(2) : " |
[ -e /etc/squid/squid.conf.default ] && mv /etc/squid/squid.conf.default /etc/squid/squid.conf && echo -n "1, " |
[ `ls /var/spool/squid/|wc -l` -ne "0" ] && rm -rf /var/spool/squid/* && echo -n "2" |
if [ -e /etc/squid/squid.conf ] |
then |
[ -e /etc/squid/squid.conf.default ] && mv /etc/squid/squid.conf.default /etc/squid/squid.conf && echo -n "1, " |
[ `ls /var/spool/squid/|wc -l` -ne "0" ] && rm -rf /var/spool/squid/* && echo -n "2" |
else |
echo -n "uninstalled" |
fi |
sleep 1 |
#param_dansguardian |
echo -en "\n- param_dansguardian(8) : " |
225,6 → 231,11 |
[ -e /lib/systemd/system/alcasar-load_balancing.service ] && rm -f /lib/systemd/system/alcasar-load_balancing.service && echo -n "12" |
sleep 1 |
#gammu-smsd |
echo -en "\n- gammu-smsd(1) :" |
rm -f /etc/gammu_smsd_conf |
echo -n "1" |
#nettoyage (on retire les services supprimés ou remplacés dans la nouvelle version) |
echo -en "\n- cleaning() : " |
for rm_fic in /usr/local/bin /usr/local/sbin /usr/local/etc |
/web/acc/auth.php |
---|
6,6 → 6,7 |
$select[4]=$l_import_empty; |
$select[5]="Exceptions"; |
$select[6]="$l_activity"; |
$select[7]=$l_gammu; |
$fich[0]="manager/htdocs/user_new.php"; |
$fich[1]="manager/htdocs/find.php"; |
$fich[2]="manager/htdocs/group_new.php"; |
13,6 → 14,7 |
$fich[4]="manager/htdocs/import_user.php"; |
$fich[5]="admin/auth_exceptions.php"; |
$fich[6]="manager/activity.php"; |
$fich[7]="manager/htdocs/autoregistration.php"; |
$j=0; |
$nb=count($select); |
while ($j != $nb) |
/web/acc/manager/htdocs/autoregistration.php |
---|
0,0 → 1,598 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<HTML><!-- written by Rexy --> |
<head> |
<META HTTP-EQUIV="Refresh" CONTENT="30"> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<title>Auto enregistrement</title> |
<link rel="stylesheet" href="/css/style.css"> |
</head> |
<body> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<? |
#Commandes |
$exec_com=exec("lsusb | grep -i huawei | cut -d ' ' -f6"); |
$exec_com2=exec("lsusb | grep -i d-link | cut -d ' ' -f7"); |
$status_key="false"; |
$script="/usr/local/bin/alcasar-sms.sh"; |
#Define |
$gammu_puk = ""; |
$gammu_simfail = ""; |
$gammu_simsecu = ""; |
$gammu_writeerror = ""; |
$gammu_timeout = ""; |
$error_pin = ""; |
$error_time_account = ""; |
$error_nb_essais = ""; |
$error_time_perm = ""; |
$error_num_alcasar = ""; |
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); } |
if($Language == 'fr'){ |
$l_title = "Auto enregistrement (SMS)"; |
$l_conf = "Configuration"; |
$l_conf_actu = "Configuration actuelle"; |
$l_pin = "Code PIN"; |
$l_num_alcasar = "Le numero de téléphone de la clé 3G"; |
$l_ban_temp = "Nombre d'essais max avant le ban permanant"; |
$l_time_account = "Durée pour une session créée"; |
$l_time_perm = "Durée en jours d'un bloquage (ban)"; |
$l_status_gammu = "Etat du service"; |
$l_start = "Démarrer"; |
$l_status_device = "Status de votre périphérique"; |
$l_key_diseable = "Aucune clé est connectée"; |
$l_key_enable = "Votre clé est connectée"; |
$l_force_signal = "Force du signal"; |
$l_imei_device = "IMEI du périphérique"; |
$l_sms_received = "Nombre de SMS reçu"; |
$l_stop = "Arrêter"; |
$l_gammu_on="Gammu est lancé"; |
$l_gammu_off="Gammu est arrêté"; |
$l_edit = "Editer"; |
$l_error_label_empty = "Le champ est vide"; |
$l_error_label_num = "Ce n'est pas un PIN valide"; |
$l_error_label_num2 = "Ce n'est pas un nombre"; |
$l_error_writefail = "Gammu semble ne pas parvenir à discuter avec la clé (port ttyUSB0)."; |
$l_error_timeoutfail = "Impossible de se connecter à la clé 3G. Timeout."; |
$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est elle présente?"; |
$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br> |
La SIM doit être bloqué (code PUK). Consultez la documentation."; |
$l_autorefresh = "Rafraichissement : 30 sec"; |
$l_days = "jours "; |
$l_num_block="Liste des numéros bloqués"; |
$l_num_num="Numéro"; |
$l_num_raison="Raison"; |
$l_num_expiration="Date d'expiration"; |
$l_num_action="Action"; |
$l_num_exist="Un compte a été créé"; |
$l_num_flood="Le nombre d'essais maximum a été dépacé"; |
$l_num_unlock="Effacer"; |
$l_service_status_img_ok="Démarré"; |
$l_service_status_img_ko="Arrété"; |
} |
else { |
$l_title = "Auto registration (SMS)"; |
$l_conf = "Configuration"; |
$l_conf_actu = "Current configuration"; |
$l_pin = "PIN password"; |
$l_num_alcasar = "Phone number (3g key)"; |
$l_ban_temp = "Max number of try before a permanent ban"; |
$l_time_account = "Time for a new session"; |
$l_time_perm = "Duration of a ban (for example, after X try)"; |
$l_status_gammu = "Service status"; |
$l_start = "Start"; |
$l_status_device = "Status of your device"; |
$l_key_diseable = "Your 3g key is not connected"; |
$l_key_enable = "Your 3g key is connected"; |
$l_force_signal = "Signal strength"; |
$l_imei_device = "Device IMEI"; |
$l_sms_received = "Number of SMS received"; |
$l_stop = "Stop"; |
$l_gammu_on="Gammu is running"; |
$l_gammu_off="Gammu is down"; |
$l_edit = "Edit"; |
$l_error_label_empty = "Field empty"; |
$l_error_label_num = "It's not a valid PIN password"; |
$l_error_label_num2 = "It's not a number"; |
$l_error_writefail = "Gammu can't listen the ttyUSB0 port."; |
$l_error_timeoutfail = "Timeout. Can not connect to modem."; |
$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?"; |
$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br> |
The Sim card must be blocked. Please read the documentation."; |
$l_autorefresh = "Refresh : 30 sec"; |
$l_days = "days "; |
$l_num_block="List of blocked phone"; |
$l_num_num="Phone number"; |
$l_num_raison="Reason"; |
$l_num_expiration="Expiration date"; |
$l_num_action="Action"; |
$l_num_exist="An account has been created"; |
$l_num_flood="The number of try has been reached"; |
$l_num_unlock="Erase"; |
$l_service_status_img_ok="Running"; |
$l_service_status_img_ko="Stopped"; |
} |
echo " |
<tr> |
<th>$l_title</th> |
</tr> |
<tr bgcolor=\"#FFCC66\"> |
<td><img src=\"/images/pix.gif\" width=\"1\" height=\"2\"></td> |
</tr> |
</TABLE> |
<br /> |
$l_autorefresh |
"; |
?> |
<center> |
<br /><br /> |
<table border=1 width=100%> |
<tr> |
<td colspan=2><h3><?php echo $l_status_device ?></h3></td> |
</tr> |
<tr> |
<?php |
if(!empty($exec_com) || !empty($exec_com2)) |
{ |
echo "<td>$l_key_enable</td>"; |
$status_key="true"; |
} |
else |
{ |
echo "<td>$l_key_diseable</td>"; |
$status_key="false"; |
} |
?> |
</tr> |
</table> |
</center> |
<br /><br /> |
<?php |
#Test si gammu est lancé |
$gammu_pid=exec("sudo /sbin/pidof gammu-smsd"); |
if ($status_key=="false") |
{ |
if ($gammu_pid!="") |
{ |
exec("sudo $script stop"); |
sleep(8); |
header('Location: autoregistration.php'); |
} |
} |
if ($status_key=="true") |
{ |
#Nom du fichier de log lorsque gammu est démarré |
$file_log = "gammu-smsd.log"; |
#Recuperation du code PIN actuel |
$current_pin = exec("sudo $script --pin"); |
#Recuperation du nombre de try avant le ban perm |
$current_try_ban = exec("sudo $script --try_ban"); |
#Recuperation de la durée d'une session créée |
$current_time_account = exec("sudo $script --time_account"); |
#Recuperation de la durée dun ban perm (après flood) |
$current_time_perm = exec("sudo $script --time_perm"); |
#Recuperation de l'adresse du log |
$current_log = exec("sudo $script --log"); |
#Detection neméro de tel |
$current_num_alcasar = exec("sudo $script --numero_alcasar"); |
#Detection problème avec la SIM |
$current_simfail = exec("sudo $script --last_nosim"); |
#Recuperation de la dernière ligne de START |
$current_last_start = exec("sudo $script --last_start"); |
#Recuperarion de la dernière ligne de STOP |
$current_last_stop = exec("sudo $script --last_stop"); |
#Recuperation de la dernière ligne de SECURITYERROR |
$current_last_secu = exec("sudo $script --last_secu"); |
#Recuperation de la dernière ligne de DEVICEWRITEERROR |
$current_last_write = exec("sudo $script --last_writeerror"); |
#Recuperation de la dernière ligne de TIMEOUT |
$current_last_timeout = exec("sudo $script --last_timeout"); |
if ($gammu_pid=="") |
{ |
$force_signal = "-"; |
$imei_device = "-"; |
$sms_received = "-"; |
$gammu="<td><img src=\"/images/state_error.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ko."\"></td><td>$l_gammu_off</td>"; |
$gammu_log=""; |
$gammu_status_on=""; |
$gammu_status_off="disabled"; |
if($current_last_secu!="") |
{ |
if(($current_last_secu > $current_last_start) && ($current_last_secu < $current_last_stop)) |
{ |
$gammu_simsecu="<tr><td colspan=7><font color=red>$l_error_simsecu_l</font></td></tr>"; |
} |
} |
} else { |
# Recuperation de la force du signal et IMEI et nombre de sms reçu |
$val_force_signal = exec("sudo $script --signal_device"); |
$imei_device = exec("sudo $script --imei_device"); |
$sms_received = exec("sudo $script --sms_received"); |
if ($val_force_signal < 21) { |
$force_signal = "<img src=\"/images/signal_0.png\"> -- ".$val_force_signal." %"; |
} elseif ($val_force_signal < 41) { |
$force_signal = "<img src=\"/images/signal_20.png\"> -- ".$val_force_signal." %"; |
} elseif ($val_force_signal < 61) { |
$force_signal = "<img src=\"/images/signal_40.png\"> -- ".$val_force_signal." %"; |
} elseif ($val_force_signal < 81) { |
$force_signal = "<img src=\"/images/signal_60.png\"> -- ".$val_force_signal." %"; |
} elseif ($val_force_signal < 101) { |
$force_signal = "<img src=\"/images/signal_80.png\"> -- ".$val_force_signal." %"; |
} |
$gammu="<td><img src=\"/images/state_ok.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ok."\"></td><td>$l_gammu_on</td>"; |
$gammu_log="<tr><td colspan=7>$current_log</td></tr>"; |
if($current_last_timeout!=""){ |
if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop)) |
{ |
$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>"; |
} |
} |
if($current_last_secu!="") |
{ |
if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop)) |
{ |
exec("sudo $script --stop"); |
} |
} |
if($current_last_write!=""){ |
if(($current_last_write > $current_last_start) && ($current_last_write > $current_last_stop)) |
{ |
$gammu_writeerror="<tr><td colspan=7><font color=red>$l_error_writefail</font></td></tr>"; |
} |
} |
if($current_simfail!="") |
{ |
if(($current_simfail > $current_last_start) && ($current_simfail > $current_last_stop)) |
{ |
$gammu_simfail="<tr><td colspan=7><font color=red>$l_error_simfail</font></td></tr>"; |
} |
} |
$gammu_status_on="disabled"; |
$gammu_status_off=""; |
} |
#Lancement et arret de gammu-smsd |
if(isset($_GET["start"])){ |
$gammu_1=exec("sudo $script --start"); |
sleep(7); |
if($current_last_secu!="") |
{ |
if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop)) |
{ |
exec("sudo $script --stop"); |
} |
} |
sleep(7); |
if($current_last_secu!="") |
{ |
if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop)) |
{ |
exec("sudo $script --stop"); |
} |
} |
sleep(7); |
if($current_last_secu!="") |
{ |
if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop)) |
{ |
exec("sudo $script --stop"); |
} |
} |
header('Location: autoregistration.php'); |
} |
if(isset($_GET["stop"])){ |
exec("sudo $script --stop"); |
sleep(8); |
header('Location: autoregistration.php'); |
} |
#Edition du NUMERO de telephone |
if(isset($_GET["b_num_alcasar"])){ |
$num = $_GET["num_alcasar"]; |
$error_num_alcasar = ""; |
if($num !="") |
{ |
if(is_numeric($num)) |
{ |
exec("sudo $script --replace_numero_alcasar $num"); |
header('Location: autoregistration.php'); |
} |
else |
{ |
$error_num_alcasar=$l_error_label_num2; |
} |
} |
else |
{ |
$error_num_alcasar=$l_error_label_empty; |
} |
} |
#Edition du code PIN |
if(isset($_GET["b_pin"])){ |
$pin = $_GET["pin"]; |
$error_pin = ""; |
if($pin !="") |
{ |
if(is_numeric($pin)) |
{ |
exec("sudo $script --replace_pin $pin"); |
header('Location: autoregistration.php'); |
} |
else |
{ |
$error_pin=$l_error_label_num; |
} |
} |
else |
{ |
$error_pin=$l_error_label_empty; |
} |
} |
#Edition du nombre d'essais avant le ban perm |
if(isset($_GET["b_ban_temp"])){ |
$nb_ban_temp = $_GET["nb_essais"]; |
$error_nb_essais = ""; |
if($nb_ban_temp !="") |
{ |
if(is_numeric($nb_ban_temp)) |
{ |
exec("sudo $script --replace_try_ban $nb_ban_temp"); |
header('Location: autoregistration.php'); |
} |
else |
{ |
$error_nb_essais=$l_error_label_num2; |
} |
} |
else |
{ |
$error_nb_essais=$l_error_label_empty; |
} |
} |
#Edition de la durée pour un compte créé |
if(isset($_GET["b_time_account"])){ |
$time_account = $_GET["time_account"]; |
$error_time_account = ""; |
if($time_account !="") |
{ |
if(is_numeric($time_account)) |
{ |
exec("sudo $script --replace_time_account $time_account"); |
header('Location: autoregistration.php'); |
} |
else |
{ |
$error_time_account=$l_error_label_num2; |
} |
} |
else |
{ |
$error_time_account=$l_error_label_empty; |
} |
} |
#Edition de la durée d'un ban perm (après flood) |
if(isset($_GET["b_time_perm"])){ |
$time_perm = $_GET["time_perm"]; |
$error_time_perm = ""; |
if($time_perm !="") |
{ |
if(is_numeric($time_perm)) |
{ |
exec("sudo $script --replace_time_perm $time_perm"); |
header('Location: autoregistration.php'); |
} |
else |
{ |
$error_time_perm=$l_error_label_num2; |
} |
} |
else |
{ |
$error_time_perm=$l_error_label_empty; |
} |
} |
# Suppression d'un numero bloqué |
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"); |
exec("sudo $script --unlock_num $numero"); |
header('Location: autoregistration.php'); |
} |
#Si une clé 3g est plugué |
echo "<form action=\"autoregistration.php\" methode=\"GET\"> |
<table border=1> |
<tr> |
<td colspan=4><b>$l_status_gammu</b></td> |
<td><b><center>$l_force_signal</center></b></td> |
<td><b><center>$l_imei_device</center></b></td> |
<td><b><center>$l_sms_received</center></b></td> |
</tr> |
<tr> |
$gammu |
<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td> |
<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td> |
<td><center>$force_signal</center></td> |
<td><center>$imei_device</center></td> |
<td><center>$sms_received</center></td> |
</tr> |
$gammu_log |
$gammu_puk |
$gammu_simfail |
$gammu_simsecu |
$gammu_timeout |
$gammu_writeerror |
</table> |
<br /><br /> |
<table border=1> |
<tr> |
<td colspan=3><b>$l_conf</b></td> |
<td><b>$l_conf_actu</b></td> |
</tr> |
<tr> |
<td> $l_num_alcasar </td><td><input type=text name='num_alcasar' maxlength=\"10\"><font color=red><b>$error_num_alcasar</b></font></td> |
<td><button type=\"submit\" name=\"b_num_alcasar\" $gammu_status_on>$l_edit</button></td> |
<td><center><font color=\"green\">$current_num_alcasar</font></center></td> |
</tr> |
<tr> |
<td> $l_pin </td><td><input type=text name='pin' maxlength=\"8\"><font color=red><b>$error_pin</b></font></td> |
<td><button type=\"submit\" name=\"b_pin\" $gammu_status_on>$l_edit</button></td> |
<td><center><font color=\"green\">$current_pin</font></center></td> |
</tr> |
<tr> |
<td> $l_time_account </td><td><input type=text name='time_account'> $l_days <font color=red><b>$error_time_account</b></font> |
<td><button type=\"submit\" name=\"b_time_account\" $gammu_status_on>$l_edit</button></td> |
<td><center><font color=\"blue\">$current_time_account</font></center></td> |
</tr> |
<tr> |
<td> $l_ban_temp </td><td><input type=text name='nb_essais'><font color=red><b>$error_nb_essais</b></font></td> |
<td><button type=\"submit\" name=\"b_ban_temp\" $gammu_status_on>$l_edit</button></td> |
<td><center><font color=\"orange\">$current_try_ban</font></center></td> |
</tr> |
<tr> |
<td>$l_time_perm</td><td><input type=text name='time_perm'> $l_days <font color=red><b>$error_time_perm</b></font> |
<td><button type=\"submit\" name=\"b_time_perm\" $gammu_status_on>$l_edit</button></td> |
<td><center><font color=\"orange\">$current_time_perm</font></center></td> |
</tr> |
</tr> |
</table> |
</form>"; |
require('/etc/freeradius-web/config.php'); |
if (is_file("../../../pass/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../../../pass/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b>\n"; |
exit(); |
} |
$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu"); |
if(mysqli_connect_errno()) |
{ |
echo "Fail to connect to $config[sql_type]" . mysqli_connect_error(); |
} |
$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm"); |
echo " <br /> |
<table border =1> |
<tr> |
<td colspan=4><b>$l_num_block</b></td> |
</tr> |
<tr> |
<td><b>$l_num_num</b></td> |
<td><b>$l_num_raison</b></td> |
<td><b>$l_num_expiration</b></td> |
<td><b>$l_num_action</b></td> |
</tr>"; |
while($row = mysqli_fetch_array($result)) |
{ |
echo " |
<form action=\"autoregistration.php\" methode=\"POST\"> |
<tr> |
<td> |
<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\"> |
" . $row['SenderNumber'] . "</td>"; |
if($row['Perm']=='0') |
{ |
echo "<td>$l_num_exist</td>"; |
} |
if($row['Perm']=='1') |
{ |
echo "<td>$l_num_flood</td>"; |
} |
echo " <td>" . $row['Expiration']. "</td> |
<td> |
<input type='submit' value='".$l_num_unlock."'> |
</td> |
</form> |
</tr>"; |
} |
echo "</table>"; |
mysqli_close($con); |
} |
?> |
</html> |
/web/acc/menu.php |
---|
43,6 → 43,7 |
$l_stat_network="trafic réseau"; |
$l_security="sécurité"; |
$l_menu="Menu"; |
$l_gammu="Auto enregistrement (SMS)"; |
} |
else |
{ |
69,6 → 70,7 |
$l_stat_network="network traffic"; |
$l_security="security"; |
$l_menu="Main"; |
$l_gammu="Auto registration (SMS)"; |
} |
echo " |
<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=0> |
/web/autoregistrationinfo.php |
---|
0,0 → 1,195 |
<?php |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf"); |
$ouvre=fopen(CONF_FILE,"r"); |
if($ouvre){ |
while(!feof ($ouvre)) |
{ |
$tampon = fgets($ouvre, 4096); |
if(strpos($tampon,"=")!=false) |
{ |
$tmp = explode("=",$tampon); |
$conf[$tmp[0]] = $tmp[1]; |
} |
} |
} else { |
exit("Erreur d'ouverture du fichier".CONF_FILE); |
} |
fclose($ouvre); |
$organisme = trim($conf["ORGANISM"]); |
?> |
<!DOCTYPE HTML> |
<HTML><!-- written by Rexy --> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<title>Auto enregistrement</title> |
<link rel="stylesheet" href="/css/style_intercept.css"> |
<style type=text/css"></style> |
</head> |
<body> |
<? |
# Choice of language |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]),0,2)); } |
if($Language == 'fr'){ |
$l_title = "Page d'auto enregistrement"; |
$l_num_exist = "Compte actif"; |
$l_num_flood = "Numéro bloqué: nombre d'essai dépassé."; |
$l_num_num = "Numero de téléphone"; |
$l_num_raison = "Etat de votre numéro"; |
$l_num_expiration = "Expiration du bloquage"; |
$l_num_inconnu = "Le numero renseigné n'est dans la base de donnée"; |
$l_num_empty = "Le champ de recherche est vide."; |
$l_num_recherche = "Rechercher votre numéro:"; |
$l_recherche = "Rechercher"; |
$l_tuto_1 = "Bienvenue sur la page d'auto enregistrement."; |
$l_tuto_2 = "Le portail auquel vous essayez de vous connectez offre la possibilité de s'inscrire automatiquement, en envoyant votre mot de passe par SMS au numéro (prix d'un SMS, non surtaxé):"; |
$l_tuto_3 = "Votre SMS ne doit contenir qu'un seul mot."; |
$l_tuto_4 = "A la suite de votre inscription, vous pourrez retrouver votre numéro de téléphone dans le tableau ci-dessous, avec l'état et la date d'expiration de validité ou bloquage de ce dernier. Seul les 30 dernier numéros peuvent être affichés. Un champ de recherche est néanmoins disponible."; |
} |
else { |
} |
?> |
<center> |
<div id="logon"> |
<h1><?php echo "$organisme" ?></h1> |
<h2><?php echo "$l_title" ?></h2> |
<div> |
<table id="boite-info"> |
<tr> |
<td rowspan="6" width="20%"><img id="logo-organ" src="/images/organisme.png"></td> |
</tr> |
<tr> |
<td><?php echo "$l_tuto_1" ?></td> |
</tr> |
<tr> |
<td><?php echo "$l_tuto_2" ?></td> |
</tr> |
<tr> |
<td align="center"> |
<h3> |
<?php |
$current_num = exec("sudo /usr/local/bin/alcasar-sms.sh --numero_alcasar"); |
echo "$current_num"; |
?> |
</h3> |
</td> |
</tr> |
<tr> |
<td><?php echo "$l_tuto_3" ?></td> |
</tr> |
<tr> |
<td><?php echo "$l_tuto_4" ?></td> |
</tr> |
</table> |
</div> |
<?php |
require('/etc/freeradius-web/config.php'); |
if (is_file("./pass/sql/drivers/$config[sql_type]/functions.php")) |
include_once("./pass/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
echo "<b>Could not include SQL library</b>\n"; |
exit(); |
} |
$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu"); |
if(mysqli_connect_errno()) |
{ |
echo "Fail to connect to $config[sql_type]" . mysqli_connect_error(); |
} |
$result = mysqli_query($con, "SELECT * |
FROM `SMS_ban_perm` |
ORDER BY date_add DESC |
LIMIT 0,30;"); |
echo " <br /> |
<table id=\"boite-info\" border=\"1\"> |
<tr> |
<td><b>$l_num_num</b></td> |
<td><b>$l_num_raison</b></td> |
<td><b>$l_num_expiration</b></td> |
</tr>"; |
while($row = mysqli_fetch_array($result)) |
{ |
$start = substr($row['SenderNumber'], 0, 3); |
$end = substr($row['SenderNumber'], -3); |
echo " |
<tr> |
<td>".$start."****".$end."</td>"; |
if($row['Perm']=='0') |
{ |
echo "<td>$l_num_exist</td>"; |
} |
if($row['Perm']=='1') |
{ |
echo "<td>$l_num_flood</td>"; |
} |
echo " <td>" . $row['Expiration']. "</td> |
</tr>"; |
} |
if (isset($_POST['number'])) |
{ |
$num = mysqli_real_escape_string($con, $_POST['number']); |
echo "<tr>"; |
if($num!=""){ |
echo "<td><b>$num</b></td>"; |
$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm WHERE SenderNumber='$num';"); |
$row = mysqli_fetch_array($result); |
if($row['Perm']=="") |
{ |
echo "<td colspan=\"2\"><b><font color=\"red\">$l_num_inconnu</font></b></td>"; |
} else { |
if($row['Perm']==0) |
{ |
echo "<td><b><font color=\"red\">$l_num_exist</font></b></td>"; |
} |
if($row['Perm']==1) |
{ |
echo "<td><b><font color=\"red\">$l_num_flood</font></b></td>"; |
} |
echo " <td><b>" . $row['Expiration']. "</b></td>"; |
} |
} else { |
echo "<td colspan=\"3\"><b><font color=\"red\">$l_num_empty</font></b></td>"; |
} |
echo "</tr>"; |
} |
echo "</table>"; |
mysqli_close($con); |
?> |
<table id="boite-info"> |
<tr> |
<form action="autoregistrationinfo.php" method="POST"> |
<td><?php echo "$l_num_recherche"; ?> <input type="text" name="number" maxlength="10" size="10"> <input type="submit" value="<?php echo "$l_recherche" ?>"></td> |
</form> |
</tr> |
</table> |
<br /> |
</div> |
</center> |
</body> |
</html> |
/web/css/style_intercept.css |
---|
120,8 → 120,7 |
box-shadow: 0px 0px 12px #000; |
} |
#boite-logon { |
background-image: url(../images/fond-bdd_grand.png); |
background-repeat: repeat-x; |
background-image: linear-gradient(#efefef, #d5d5d5); |
padding: 10px; |
width: 420px; |
height: 189px; |
128,6 → 127,7 |
} |
#boite-logon TD { |
padding-top: 10px; |
padding-left: 30px; |
} |
#boite-info { |
border: 0px; |
/web/images/signal_0.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/images/signal_20.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/images/signal_40.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/images/signal_60.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/images/signal_80.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/web/intercept.php |
---|
106,7 → 106,8 |
$l_reply_6 = "Your authorized connexion time has been reached"; |
$l_online_time = "Tiempo en linea"; |
$l_remaining_time = "Tiempo restante"; |
$l_uam_domain = "Sitios web autorizados : ";} |
$l_uam_domain = "Sitios web autorizados : "; |
$l_autoregistration = "Registo automático";} |
else if ($Language == 'pt'){ |
$l_ChilliError = "A autenticação precisa ser bem sucedida através do portal."; |
$l_login = "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão"; |
138,44 → 139,41 |
$l_reply_6 = "Seu tempo de conexão autorizada finalizou"; |
$l_online_time = "Tempo Online"; |
$l_remaining_time = "Tempo restante"; |
$l_uam_domain = "Sites autorizados : ";} |
$l_uam_domain = "Sites autorizados : "; |
$l_autoregistration = "Registo automático";} |
else if($Language == 'de'){ |
$l_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt."; |
//$l_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung"; |
$l_login = "Anmeldung erfolgreich.<HR>Das Schließen dieses Fensters trennt die Verbindung"; |
//$l_logout = "Beenden der Verbindung"; |
$l_logout = "Verbindung beenden"; |
$l_loginfailed = "Anmeldung fehlgeschlagen"; |
$l_loggingin = "Sie sind Angemeldet"; |
$l_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung"; |
$l_logout = "Beenden der Verbindung"; |
$l_loginfailed = "Authentifizierungsfehler Eigenverbrauch"; |
$l_loggingin = "Kennzeichnung auf dem Eigenverbrauch"; |
$l_loggedcont = "Zutrittskontrolle"; |
//$l_loggedout = "Ihre Sitzung ist geschlossen"; |
$l_loggedout = "Ihre Sitzung wurde beendet"; |
$l_loggedout = "Ihre Sitzung ist geschlossen"; |
$l_user = "Benutzer"; |
$l_password = "Passwort"; |
$l_wait = "Bitte warten Sie einen Moment ..."; |
$l_onlinetime = "Online-Zeit:"; |
$l_remainingtime = "Restzeit:"; // (NON UTILSE ?) |
$l_encrypted = "Die Verbindung muss verschlüsselt sein"; |
$l_boutonO = "Anmelden"; |
$l_remainingtime = "Abmelden:"; |
$l_encrypted = "Die Öffnung muß der Anschluß Zahlen"; |
$l_boutonO = "Authentifizierung"; |
$l_boutonF = "Schließen"; |
$l_loggedin_stringl1 = "Information System Security"; |
//$l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen."; |
$l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um jeglichen Missbrauch durch den, eindeutig identifizierbaren, Benutzer zurückverfolgen zu können."; |
$l_loggedin_stringl3 = "Ihre Aktivität wird unter Beachtung der Privatsphäre aufgezeichnet."; #statt "Aktivitaet" kann auch "Sitzung" benutzt werden |
$l_loggedin_stringl4 = "Die gespeicherten Daten können nur im Falle einer Ermittlung von der Justiz genutzt werden."; |
//$l_loggedin_stringl4 = "Die gespeicherten Daten werden im Falle einer Ermittlung an die Justiz weitergegeben."; |
$l_loggedin_stringl5 = "Diese Daten werden nach einem Jahr automatisch geloescht."; |
$l_loggedin_stringl6 = "Klicken Sie <a href='$alcasarpath'>hier</a> um ihre Passwort zu ändern, oder um das Sicherheitszertifikat in ihren Browser zu integrieren"; |
$l_loggedout_string = "Trennung des Portals erfolgt !"; // à modifier |
$l_reply_1 = "Ihr Tages Limit ist aufgebraucht"; |
$l_reply_2 = "Ihr Monats Limit ist aufgebraucht"; |
$l_reply_3 = "Sie versuchen sich ausserhalb des erlaubten Zeitraumes anzumelden"; |
$l_reply_4 = "Ihr Benutzerkonto ist abgelaufen"; |
$l_reply_5 = "Sie haben die maximale Anzahl an gleichzeitigen Anmeldungen erreicht"; |
$l_reply_6 = "Ihr Zeit-Guthaben ist aufgebraucht"; |
$l_loggedin_stringl2 = "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen."; |
$l_loggedin_stringl3 = "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre."; |
$l_loggedin_stringl4 = "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung."; |
$l_loggedin_stringl5 = "Diese Daten werden automatisch gelöscht nach einem Jahr."; |
$l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser"; |
$l_loggedout_string = "Trennung des Portals erfolgt Gefangener!"; |
$l_reply_1 = "Your daily connexion time has been reached"; |
$l_reply_2 = "Your monthly connexion time has been reached"; |
$l_reply_3 = "You try to connect outside of your allowed timespan"; |
$l_reply_4 = "your account expired"; |
$l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
$l_reply_6 = "Your authorized connexion time has been reached"; |
$l_online_time = "Online-zeit"; |
$l_remaining_time = "Restzeit"; |
$l_uam_domain = "Autorisierten websites : ";} |
$l_uam_domain = "Autorisierten websites : "; |
$l_autoregistration = "Automatische registrierung";} |
else if($Language == 'nl'){ |
$l_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst."; |
$l_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie."; |
207,7 → 205,8 |
$l_reply_6 = "Your authorized connexion time has been reached"; |
$l_online_time = "Online tijd"; |
$l_remaining_time = "Reterende tijd"; |
$l_uam_domain = "Geautoriseerde website : ";} |
$l_uam_domain = "Geautoriseerde website : "; |
$l_autoregistration = "Automatische registratie";} |
else if($Language == 'fr'){ |
$l_ChilliError = "L'authentification doit être réussie sur le portail captif."; |
$l_login = "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session."; |
239,7 → 238,8 |
$l_reply_6 = "Votre durée de connexion autorisée a été atteinte"; |
$l_online_time = "Temps de connexion"; |
$l_remaining_time = "Temps restant"; |
$l_uam_domain = "Sites autorisés : ";} |
$l_uam_domain = "Sites autorisés : "; |
$l_autoregistration = "Auto enregistrement";} |
else{ |
$l_ChilliError = "The authentication must be successful through the captive portal service."; |
$l_login = "Successful authentication.<HR>Closing this window interrupts your session"; |
271,7 → 271,8 |
$l_reply_6 = "Your authorized connexion time has been reached"; |
$l_online_time = "Online time"; |
$l_remaining_time = "Remaining time"; |
$l_uam_domain = "Authorized websites : ";} |
$l_uam_domain = "Authorized websites : "; |
$l_autoregistration = "Auto registration";} |
# If https not use, tell it's wrong |
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) { |
389,10 → 390,10 |
<html> |
<head> |
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> |
<title>$l_loggingin</title> |
<meta http-equiv=\"Cache-control\" content=\"no-cache\"> |
<meta http-equiv=\"Pragma\" content=\"no-cache\"> |
<script type=\"text/javascript\" language=\"JavaScript\"> |
<title>$l_loggingin</title> |
<meta http-equiv=\"Cache-control\" content=\"no-cache\"> |
<meta http-equiv=\"Pragma\" content=\"no-cache\"> |
<script type=\"text/javascript\" language=\"JavaScript\"> |
alcasar_popup = null; |
function popUp(URL) { |
if (self.name != \"alcasar_popup\") { |
446,7 → 447,7 |
<input type=\"hidden\" name=\"userurl\" value=\"$userurl\"> |
<table id=\"boite-logon\"> |
<tr> |
<td width=\"20%\" rowspan=\"3\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td> |
<td width=\"20%\" rowspan=\"4\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td> |
<td width=\"30%\" align=\"right\">$l_user</td> |
<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\" autocomplete=\"off\"></td> |
</tr> |
454,12 → 455,22 |
<td align=\"right\">$l_password</td> |
<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\" autocomplete=\"off\"></td> |
</tr> |
<tr> |
<td height=\"23\" colSpan=\"2\" align=\"center\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td> |
</tr> |
</table> |
<tr>"; |
echo "</td><td height=\"23\" align=\"left\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"javascript:popUp('$statuspath')\"></td> |
"; |
$gammu_smsd=exec("pidof gammu-smsd"); |
if ($gammu_smsd != "") |
{ |
echo "<td height=\"23\" align=\"left\"><a target=\"_blank\" href=\"autoregistrationinfo.php\">$l_autoregistration</a></td></tr>"; |
} |
echo "</table> |
</form> |
<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\"> |
<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"80%\"> |
<tr> |
<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td> |
</tr> |