Subversion Repositories ALCASAR

Rev

Rev 1380 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1380 Rev 1387
Line 25... Line 25...
25
<head>
25
<head>
26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
27
<title>Auto enregistrement</title>
27
<title>Auto enregistrement</title>
28
<link rel="stylesheet" href="/css/style_intercept.css">
28
<link rel="stylesheet" href="/css/style_intercept.css">
29
<style type=text/css"></style>
29
<style type=text/css"></style>
-
 
30
<!-- DataTables CSS -->
-
 
31
<link rel="stylesheet" type="text/css" href="../css/jquery.dataTables.css">
-
 
32
<!-- jQuery -->
-
 
33
<script type="text/javascript" charset="utf8" src="../js/jquery.js"></script>
-
 
34
<!-- DataTables -->
-
 
35
<script type="text/javascript" charset="utf8" src="../js/jquery.dataTables.js"></script>
-
 
36
<script type="text/javascript">
-
 
37
$(document).ready( function () {
-
 
38
    $('#table_id').DataTable({
-
 
39
		"language": {
-
 
40
			"paginate": {
-
 
41
			"sFirst": "Premier",
-
 
42
			"sLast": "Dernier",
-
 
43
			"sPrevious": "Précédent",
-
 
44
			"sNext": "Suivant"
-
 
45
			},
-
 
46
            "lengthMenu": "Montrer _MENU_ résultat par page",
-
 
47
            "zeroRecords": "Aucun résultat",
-
 
48
            "info": "Affiche la page _PAGE_ sur _PAGES_",
-
 
49
            "infoEmpty": "Aucun résultat",
-
 
50
			"sSearch": "Recherche (5 dernier chiffre) :"
-
 
51
        }
-
 
52
	});
-
 
53
} );
-
 
54
</script>
30
</head>
55
</head>
31
<body>
56
<body>
32
<?
57
<?
33
# Choice of language
58
# Choice of language
34
$Language = 'en';
59
$Language = 'en';
Line 43... Line 68...
43
	$l_num_num = "Numero de téléphone";
68
	$l_num_num = "Numero de téléphone";
44
	$l_num_raison = "Etat de votre numéro";
69
	$l_num_raison = "Etat de votre numéro";
45
	$l_num_expiration = "Expiration du bloquage";
70
	$l_num_expiration = "Expiration du bloquage";
46
	$l_num_inconnu = "Le numero renseigné n'est dans la base de donnée";
71
	$l_num_inconnu = "Le numero renseigné n'est dans la base de donnée";
47
	$l_num_empty = "Le champ de recherche est vide.";
72
	$l_num_empty = "Le champ de recherche est vide.";
48
	$l_num_invalid = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
73
	$l_num_invalid = "Le format n'est pas correct: xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
49
	$l_num_recherche = "Rechercher votre numéro:";
74
	$l_num_recherche = "Rechercher votre numéro:";
50
 
75
 
51
	$l_recherche = "Rechercher";
76
	$l_recherche = "Rechercher";
52
 
77
 
53
	$l_tuto_1 = "Bienvenue sur la page d'auto enregistrement.";
78
	$l_tuto_1 = "Bienvenue sur la page d'auto enregistrement.";
54
	$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é):";
79
	$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é):";
55
       	$l_tuto_3 = "Votre SMS ne doit contenir qu'un seul mot.";
80
       	$l_tuto_3 = "Votre SMS ne doit contenir qu'un seul mot.";
56
	$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.";	
81
	$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.";	
57
	$l_help_s = "Pour la France: +3312234455";
82
	$l_tuto_5 = "Le champ de recherche ci-dessous vous permet de rechercher votre numéro suivant les 5 derniers chiffres.";	
58
}
83
}
59
else {
84
else {
60
 
85
 
61
}
86
}
62
?>
87
?>
Line 67... Line 92...
67
<h1><?php echo "$organisme" ?></h1>
92
<h1><?php echo "$organisme" ?></h1>
68
<h2><?php echo "$l_title" ?></h2>
93
<h2><?php echo "$l_title" ?></h2>
69
<div>
94
<div>
70
<table id="boite-info">
95
<table id="boite-info">
71
	<tr>
96
	<tr>
72
		<td rowspan="6" width="20%"><img id="logo-organ" src="/images/organisme.png"></td>
97
		<td rowspan="6" width="30%"><img id="logo-organ" src="/images/organisme.png"></td>
73
	</tr>
98
	</tr>
74
	<tr>
99
	<tr>
75
		<td><?php echo "$l_tuto_1" ?></td>
100
		<td><?php echo "$l_tuto_1" ?></td>
76
	</tr>
101
	</tr>
77
	<tr>
102
	<tr>
Line 93... Line 118...
93
		<td><?php echo "$l_tuto_3" ?></td>
118
		<td><?php echo "$l_tuto_3" ?></td>
94
	</tr>
119
	</tr>
95
	<tr>
120
	<tr>
96
		<td><?php echo "$l_tuto_4" ?></td>
121
		<td><?php echo "$l_tuto_4" ?></td>
97
	</tr>
122
	</tr>
-
 
123
	<tr>
-
 
124
		<td colspan="2"><?php echo "$l_tuto_5" ?></td>
-
 
125
	</tr>
98
</table>
126
</table>
99
</div>
127
</div>
100
<?php
128
<?php
101
 
129
 
102
require('/etc/freeradius-web/config.php');
130
require('/etc/freeradius-web/config.php');
Line 116... Line 144...
116
	echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
144
	echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
117
}
145
}
118
 
146
 
119
$result = mysqli_query($con, "SELECT * 
147
$result = mysqli_query($con, "SELECT * 
120
				FROM `SMS_ban_perm` 
148
				FROM `SMS_ban_perm` 
121
				ORDER BY date_add DESC
149
				ORDER BY date_add DESC;");
122
				LIMIT 0,30;");
-
 
123
 
150
?>
124
	echo "	<br />
-
 
125
		<table id=\"boite-info\" border=\"1\">
-
 
126
		<tr>
-
 
127
		<td><b>$l_num_num</b></td>
-
 
128
		<td><b>$l_num_raison</b></td>
-
 
129
		<td><b>$l_num_expiration</b></td>
-
 
130
		</tr>";
-
 
131
 
151
 
-
 
152
<table id="table_id" class="display">
-
 
153
    <thead>
-
 
154
        <tr>
-
 
155
            <th><b><?php echo $l_num_num; ?></b></th>
-
 
156
			<th><b><?php echo $l_num_raison; ?></b></th>
-
 
157
			<th><b><?php echo $l_num_expiration; ?></b></th>
-
 
158
        </tr>
-
 
159
    </thead>
-
 
160
    <tbody>
-
 
161
<?php 
132
while($row = mysqli_fetch_array($result))
162
while($row = mysqli_fetch_array($result))
133
{
163
{
134
	$start = substr($row['SenderNumber'], 0, 5);
164
	$start = substr($row['SenderNumber'], 0, 3);
135
	$end = substr($row['SenderNumber'], -3);
165
	$end = substr($row['SenderNumber'], -5);
136
	echo "	
166
	echo "	
137
		<tr>
167
		<tr>
138
		<td>".$start."****".$end."</td>";
168
		<td>".$start."****".$end."</td>";
139
	
169
	
140
	if($row['Perm']=='0')
170
	if($row['Perm']=='0')
Line 146... Line 176...
146
		echo "<td>$l_num_flood</td>";
176
		echo "<td>$l_num_flood</td>";
147
	}
177
	}
148
	echo "	<td>" . $row['Expiration']. "</td>
178
	echo "	<td>" . $row['Expiration']. "</td>
149
		</tr>";
179
		</tr>";
150
}
180
}
151
 
-
 
152
if (isset($_POST['number']))
-
 
153
{
-
 
154
	$num = mysqli_real_escape_string($con, $_POST['number']);
-
 
155
	echo "<tr>";
-
 
156
	if($num!=""){
-
 
157
		if(preg_match('#^\+#', $num) == 1)
-
 
158
		{
-
 
159
			echo "<td><b>$num</b></td>";
-
 
160
			$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm WHERE SenderNumber='$num';");
-
 
161
			$row = mysqli_fetch_array($result);
-
 
162
			if($row['Perm']=="")
-
 
163
			{
-
 
164
				echo "<td colspan=\"2\"><b><font color=\"red\">$l_num_inconnu</font></b></td>";	
-
 
165
			} else {
-
 
166
				if($row['Perm']==0)
-
 
167
				{
-
 
168
					echo "<td><b><font color=\"red\">$l_num_exist</font></b></td>";
-
 
169
				}
-
 
170
			if($row['Perm']==1)
-
 
171
			{
-
 
172
				echo "<td><b><font color=\"red\">$l_num_flood</font></b></td>";
-
 
173
				}
-
 
174
				echo "	<td><b>" . $row['Expiration']. "</b></td>";	
-
 
175
			}
-
 
176
		} else {
-
 
177
			echo "<td colspan=\"3\"><b><font color=\"red\">$l_num_invalid</font></b></td>";
-
 
178
		}
-
 
179
	} else {	
-
 
180
		echo "<td colspan=\"3\"><b><font color=\"red\">$l_num_empty</font></b></td>";
-
 
181
	}
-
 
182
	echo "</tr>";
-
 
183
}
-
 
184
 
-
 
185
 
-
 
186
echo "</table>";
-
 
187
mysqli_close($con);
-
 
188
?>
181
?>
189
<table id="boite-info">
-
 
190
	<tr>
-
 
191
		<form action="autoregistrationinfo.php" method="POST">
-
 
192
	<td><?php echo "$l_num_recherche"; ?> <input type="text" name="number" maxlength="10" size="10"> <input type="submit" value="<?php echo "$l_recherche" ?>"></td>
-
 
193
		</form>
182
    </tbody>
194
	</tr>
-
 
195
	<tr>
-
 
196
	<td colspan=\"2\"><?php echo $l_help_s; ?></td>
-
 
197
	</tr>
-
 
198
</table>
183
</table>
199
 
184
 
200
 
-
 
-
 
185
<?php mysqli_close($con); ?>
201
<br />
186
<br />
202
</div>
187
</div>
203
</center>
188
</center>
204
</body>
189
</body>
205
</html>
190
</html>