1,257 → 1,219 |
<?php |
# CHECK IF the SMS service is enable |
# $Id$ |
|
// CHECK IF the SMS service is enable |
$service_SMS_status=false; |
|
if(!$service_SMS_status){ |
header('Location: ./'); |
if (!$service_SMS_status) { |
header('Location: /'); |
exit(); |
} |
?> |
<?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); |
|
define('CONF_FILE', '/usr/local/etc/alcasar.conf'); |
|
// Read CONF_FILE |
$file_conf = fopen(CONF_FILE, 'r'); |
if (!$file_conf) { |
exit('Error opening the file '.CONF_FILE); |
} |
fclose($ouvre); |
while (!feof($file_conf)) { |
$buffer = fgets($file_conf, 4096); |
if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) { |
$tmp = explode('=', $buffer); |
$conf[$tmp[0]] = trim($tmp[1]); |
} |
} |
fclose($file_conf); |
|
$organisme = trim($conf["ORGANISM"]); |
$current_num='XXXXXXXXXX'; |
|
?> |
<? |
# Choice of language |
|
// 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é."; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]), 0, 2)); |
} |
if ($Language === 'fr') { // French |
$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_num = "Numero de téléphone"; |
$l_num_raison = "Etat de votre numéro"; |
$l_num_expiration = "Expiration du bloquage"; |
|
$l_tuto_1 = "Bienvenue sur la page d'auto enregistrement."; |
$l_tuto_2 = "Ce portail d'accès à Internet vous offre la possibilité de vous inscrire en envoyant le mot de passe de votre choix par SMS au numéro suivant (prix d'un SMS, non surtaxé)."; |
$l_tuto_3 = "Votre SMS ne doit contenir qu'un seul mot."; |
$l_tuto_4 = "Votre inscription sera activée lorsque vous retrouverez votre numéro de téléphone dans le tableau ci-dessous. Ce numéro de téléphone constitue votre identifiant de connexion"; |
$l_tuto_5 = "Le champ de recherche ci-dessous vous permet de retrouver votre numéro suivant les 5 derniers chiffres."; |
$l_tuto_1 = "Bienvenue sur la page d'auto enregistrement."; |
$l_tuto_2 = "Ce portail d'accès à Internet vous offre la possibilité de vous inscrire en envoyant le mot de passe de votre choix par SMS au numéro suivant (prix d'un SMS, non surtaxé)."; |
$l_tuto_3 = "Votre SMS ne doit contenir qu'un seul mot."; |
$l_tuto_4 = "Votre inscription sera activée lorsque vous retrouverez votre numéro de téléphone dans le tableau ci-dessous. Ce numéro de téléphone constitue votre identifiant de connexion"; |
$l_tuto_5 = "Le champ de recherche ci-dessous vous permet de retrouver votre numéro suivant les 5 derniers chiffres."; |
|
$l_tab_first = "premier"; |
$l_tab_last = "dernier"; |
$l_tab_next = "suivant"; |
$l_tab_prev = "précédent"; |
$l_tab_search = "Recherche :"; |
$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_"; |
$l_tab_info = "Montrer _MENU_ résultats par page"; |
$l_tab_infoempty = "Aucun résultat"; |
$l_autorefresh = "Rafraichissement : 10 sec"; |
|
} elseif($Language == 'en'){ |
$l_title = "Autoregistration"; |
$l_num_exist = "Account enables"; |
$l_num_flood = "Phone number banned: Number of trial exceeded."; |
$l_tab_first = "premier"; |
$l_tab_last = "dernier"; |
$l_tab_next = "suivant"; |
$l_tab_prev = "précédent"; |
$l_tab_search = "Recherche :"; |
$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_"; |
$l_tab_info = "Montrer _MENU_ résultats par page"; |
$l_tab_infoempty = "Aucun résultat"; |
|
$l_num_num = "Phone number"; |
$l_num_raison = "Status of your phone number"; |
$l_num_expiration = "Expiration"; |
$l_autorefresh = "Rafraichissement : 10 sec"; |
} else { // English |
$l_title = "Autoregistration"; |
$l_num_exist = "Account enables"; |
$l_num_flood = "Phone number banned: Number of trial exceeded."; |
|
$l_tuto_1 = "Welcome to the auto-enrollment page"; |
$l_tuto_2 = "This portal allows you to enroll by sending the password of you choice via SMS to the following number (no surcharge) :"; |
$l_tuto_3 = "Just send 1 word in your SMS."; |
$l_tuto_4 = "Your registration will be activated when you'll find your phone number in the following table. This phone number is your login name"; |
$l_tuto_5 = "You can search your phone number according to the 5 last digits in your phone number."; |
$l_num_num = "Phone number"; |
$l_num_raison = "Status of your phone number"; |
$l_num_expiration = "Expiration"; |
|
$l_tuto_1 = "Welcome to the auto-enrollment page"; |
$l_tuto_2 = "This portal allows you to enroll by sending the password of you choice via SMS to the following number (no surcharge) :"; |
$l_tuto_3 = "Just send 1 word in your SMS."; |
$l_tuto_4 = "Your registration will be activated when you'll find your phone number in the following table. This phone number is your login name"; |
$l_tuto_5 = "You can search your phone number according to the 5 last digits in your phone number."; |
|
$l_tab_first = "first"; |
$l_tab_last = "last"; |
$l_tab_next = "next"; |
$l_tab_prev = "previous"; |
$l_tab_search = "Search :"; |
$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :"; |
$l_tab_info = "Show _MENU_ entries"; |
$l_tab_infoempty = "No matching records found"; |
|
$l_autorefresh = "Rafraichissement : 10 sec"; |
|
} else { |
$l_tab_first = "first"; |
$l_tab_last = "last"; |
$l_tab_next = "next"; |
$l_tab_prev = "previous"; |
$l_tab_search = "Search :"; |
$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :"; |
$l_tab_info = "Show _MENU_ entries"; |
$l_tab_infoempty = "No matching records found"; |
|
$l_title = "Autoregistration"; |
$l_num_exist = "Account enables"; |
$l_num_flood = "Phone number banned: Number of trial exceeded."; |
$l_autorefresh = "Refresh: 10 sec"; |
} |
|
$l_num_num = "Phone number"; |
$l_num_raison = "Status of your phone number"; |
$l_num_expiration = "Expiration"; |
// Get SMS from database |
require('/etc/freeradius-web/config.php'); |
|
$l_tuto_1 = "Welcome"; |
$l_tuto_2 = "You can have an acces to the Internet if you send a password via SMS to this phone number (no surcharge) :"; |
$l_tuto_3 = "Just send 1 word in your SMS."; |
$l_tuto_4 = "If your registration is a success or a failure, you can find the raison in the table bellow."; |
$l_tuto_5 = "You can search your phone number according to the 5 last digits in your phone number."; |
|
$l_tab_first = "first"; |
$l_tab_last = "last"; |
$l_tab_next = "next"; |
$l_tab_prev = "previous"; |
$l_tab_search = "Search :"; |
$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :"; |
$l_tab_info = "Show _MENU_ entries"; |
$l_tab_infoempty = "No matching records found"; |
|
$l_autorefresh = "Refresh : 10 sec"; |
$con = mysqli_connect($config['sql_server'], $config['sql_username'], $config['sql_password'], 'gammu'); |
|
if (mysqli_connect_errno()) { |
exit('Failed to connect to ' . $config['sql_type']/* . ': ' . mysqli_connect_error()*/); |
} |
|
$result = mysqli_query($con, 'SELECT * FROM `SMS_ban_perm` ORDER BY date_add DESC;'); |
|
$smsBanPerms = []; |
while ($row = mysqli_fetch_array($result)) { |
$smsBanPerms[] = (object) [ |
'numberHidden' => substr($row['SenderNumber'], 0, 3) . '****' . substr($row['SenderNumber'], -5), |
'expiration' => $row['Expiration'], |
'perm' => $row['Perm'] |
]; |
} |
mysqli_close($con); |
|
?> |
<!DOCTYPE HTML> |
<HTML><!-- written by Rexy --> |
<!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> |
<!-- DataTables CSS --> |
<link rel="stylesheet" type="text/css" href="../css/jquery.dataTables.css"> |
<!-- jQuery --> |
<script type="text/javascript" charset="utf8" src="../js/jquery.js"></script> |
<!-- DataTables --> |
<script type="text/javascript" charset="utf8" src="../js/jquery.dataTables.js"></script> |
<script type="text/javascript"> |
function timedRefresh(timeoutPeriod) { |
var interval = setInterval(refreshPage, timeoutPeriod); |
} |
<meta charset="utf-8"> |
<title>Auto enregistrement</title> |
<link rel="stylesheet" type="text/css" href="/css/style_intercept.css"> |
<!-- DataTables CSS --> |
<link rel="stylesheet" type="text/css" href="../css/jquery.dataTables.css"> |
<!-- jQuery --> |
<script charset="utf8" src="../js/jquery.js"></script> |
<!-- DataTables --> |
<script charset="utf8" src="../js/jquery.dataTables.js"></script> |
<script> |
function timedRefresh(timeoutPeriod) { |
var interval = setInterval(refreshPage, timeoutPeriod); |
} |
|
function refreshPage() { |
if ($("input[name=autoRefreshCheckboxes]").is(":checked")) { |
location.reload(true); |
} |
} |
function refreshPage() { |
if ($('input[name=autoRefreshCheckboxes]').is(':checked')) { |
location.reload(true); |
} |
} |
|
$(document).ready( function () { |
$('#table_id').DataTable({ |
"language": { |
"paginate": { |
"sFirst": "<?php echo $l_tab_first; ?>", |
"sLast": "<?php echo $l_tab_last; ?>", |
"sPrevious": "<?php echo $l_tab_prev; ?>", |
"sNext": "<?php echo $l_tab_next; ?>" |
}, |
"lengthMenu": "<?php echo $l_tab_info; ?>", |
"zeroRecords": "<?php echo $l_tab_infoempty; ?>", |
"info": "<?php echo $l_tab_pmenu; ?>", |
"infoEmpty": "<?php echo $l_tab_infoempty; ?>", |
"sSearch": "<?php echo $l_tab_search; ?>" |
} |
$(document).ready( function () { |
$('#table_id').DataTable({ |
"language": { |
"paginate": { |
"sFirst": "<?= $l_tab_first ?>", |
"sLast": "<?= $l_tab_last ?>", |
"sPrevious": "<?= $l_tab_prev ?>", |
"sNext": "<?= $l_tab_next ?>" |
}, |
"lengthMenu": "<?= $l_tab_info ?>", |
"zeroRecords": "<?= $l_tab_infoempty ?>", |
"info": "<?= $l_tab_pmenu ?>", |
"infoEmpty": "<?= $l_tab_infoempty ?>", |
"sSearch": "<?= $l_tab_search ?>" |
} |
}); |
}); |
} ); |
</script> |
</script> |
</head> |
<body onload="JavaScript:timedRefresh(10000);"> |
<body onload="timedRefresh(10000);"> |
<center> |
<div id="logon"> |
<h1><?= $organisme ?></h1> |
<h2><?= $l_title ?></h2> |
|
<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="30%"><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='XXXXXXXXXX'; |
echo "$current_num"; |
?> |
</h3> |
</td> |
</tr> |
|
<tr> |
<td><?php echo "$l_tuto_3" ?></td> |
</tr> |
<tr> |
<td><?php echo "$l_tuto_4" ?></td> |
</tr> |
<!-- <tr> |
<td colspan="2"><?php echo "$l_tuto_5" ?></td> |
</tr> |
<div> |
<table id="boite-info"> |
<tr> |
<td rowspan="6" width="30%"><img id="logo-organ" src="/images/organisme.png"></td> |
</tr> |
<tr> |
<td><?= $l_tuto_1 ?></td> |
</tr> |
<tr> |
<td><?= $l_tuto_2 ?></td> |
</tr> |
<tr> |
<td align="center"><h3><?= $current_num ?></h3></td> |
</tr> |
<tr> |
<td><?= $l_tuto_3 ?></td> |
</tr> |
<tr> |
<td><?= $l_tuto_4 ?></td> |
</tr> |
<!-- |
<tr> |
<td colspan="2"><?= $l_tuto_5 ?></td> |
</tr> |
--> |
</table> |
</div> |
<?php |
</table> |
</div> |
|
require('/etc/freeradius-web/config.php'); |
<div> |
<label><input type="checkbox" checked="checked" name="autoRefreshCheckboxes"><?= $l_autorefresh ?></label> |
<table id="table_id" class="display"> |
<thead> |
<tr> |
<th><b><?= $l_num_num ?></b></th> |
<th><b><?= $l_num_raison ?></b></th> |
<th><b><?= $l_num_expiration ?></b></th> |
</tr> |
</thead> |
<tbody> |
<?php foreach ($smsBanPerms as $smsBanPerm): ?> |
<tr> |
<td><?= $smsBanPerm->numberHidden ?></td> |
|
$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu"); |
<?php if ($smsBanPerm->perm == '0'): ?> |
<td><?= $l_num_exist ?></td> |
<?php elseif ($smsBanPerm->perm == '1'): ?> |
<td><?= $l_num_flood ?></td> |
<?php endif ?> |
|
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;"); |
?> |
<input type='checkbox' checked='checked' name='autoRefreshCheckboxes' ><?php echo $l_autorefresh; ?></input> |
<table id="table_id" class="display"> |
<thead> |
<tr> |
<th><b><?php echo $l_num_num; ?></b></th> |
<th><b><?php echo $l_num_raison; ?></b></th> |
<th><b><?php echo $l_num_expiration; ?></b></th> |
</tr> |
</thead> |
<tbody> |
<?php |
while($row = mysqli_fetch_array($result)) |
{ |
$start = substr($row['SenderNumber'], 0, 3); |
$end = substr($row['SenderNumber'], -5); |
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>"; |
} |
?> |
</tbody> |
</table> |
|
<?php mysqli_close($con); ?> |
<br /> |
</div> |
</center> |
<td><?= $smsBanPerm->expiration ?></td> |
</tr> |
<?php endforeach; ?> |
</tbody> |
</table> |
</div> |
</div> |
</center> |
</body> |
</html> |
Property changes: |
Added: svn:keywords |
+Id |
\ No newline at end of property |