Subversion Repositories ALCASAR

Rev

Rev 1387 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1387 Rev 1416
1
<?php
1
<?php
2
# Test présence de clé/modem
2
# Test présence de clé/modem
3
$exec_com=exec("lsusb | grep -i 067b | cut -d ' ' -f6 | cut -d ' ' -f1");
3
$exec_com=exec("lsusb | grep -i 067b | cut -d ' ' -f6 | cut -d ' ' -f1");
4
$exec_com2=exec("lsusb | grep -i 12d1 | cut -d ' ' -f6 | cut -d ' ' -f1");
4
$exec_com2=exec("lsusb | grep -i 12d1 | cut -d ' ' -f6 | cut -d ' ' -f1");
5
 
5
 
6
//$exec_com2=exec("lsusb | grep -i d-link | cut -d ' ' -f7");
6
//$exec_com2=exec("lsusb | grep -i d-link | cut -d ' ' -f7");
7
 
7
 
8
$status_key="false";
8
$status_key="false";
9
$script="/usr/local/bin/alcasar-sms.sh";
9
$script="/usr/local/bin/alcasar-sms.sh";
10
 
10
 
11
#Define
11
#Define
12
$gammu_puk = "";
12
$gammu_puk = "";
13
$gammu_simfail = "";
13
$gammu_simfail = "";
14
$gammu_simsecu = "";
14
$gammu_simsecu = "";
15
$gammu_writeerror = "";
15
$gammu_writeerror = "";
16
$gammu_timeout = "";
16
$gammu_timeout = "";
17
$error_pin = "";
17
$error_pin = "";
18
$error_time_account = "";
18
$error_time_account = "";
19
$error_nb_essais = "";
19
$error_nb_essais = "";
20
$error_time_perm = "";
20
$error_time_perm = "";
21
$error_num_alcasar = "";
21
$error_num_alcasar = "";
-
 
22
$country_filter="";
22
 
23
 
23
# Choice of language
24
# Choice of language
24
$Language = 'en';
25
$Language = 'en';
25
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
26
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
26
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
27
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
27
	$Language = strtolower(substr(chop($Langue[0]),0,2)); }
28
	$Language = strtolower(substr(chop($Langue[0]),0,2)); }
28
if($Language == 'fr'){
29
if($Language == 'fr'){
29
	$l_title = "Auto enregistrement (SMS)";
30
	$l_title = "Auto enregistrement (SMS)";
30
	$l_conf = "Configuration";
31
	$l_conf = "Configuration";
31
	$l_conf_actu = "Configuration actuelle";
32
	$l_conf_actu = "Configuration actuelle";
32
	$l_pin = "Code PIN";
33
	$l_pin = "Code PIN";
33
	$l_num_alcasar = "Le numero de téléphone de la clé 3G";
34
	$l_num_alcasar = "Le numero de téléphone de la clé 3G";
34
	$l_ban_temp = "Nombre d'essais avant le blocage";
35
	$l_ban_temp = "Nombre d'essais avant le blocage";
35
	$l_time_account = "Durée pour une session créée";
36
	$l_time_account = "Durée pour une session créée";
36
	$l_time_perm = "Durée du blocage (en jours)";
37
	$l_time_perm = "Durée du blocage (en jours)";
37
	$l_status_gammu = "Etat du service";
38
	$l_status_gammu = "Etat du service";
38
	$l_start = "Démarrer";
39
	$l_start = "Démarrer";
39
	$l_status_device = "Status de votre périphérique";
40
	$l_status_device = "Status de votre périphérique";
40
	$l_key_diseable = "Aucun périphérique détecté";
41
	$l_key_diseable = "Aucun périphérique détecté";
41
	$l_key_enable = "Votre clé est connectée";
42
	$l_key_enable = "Votre clé est connectée";
42
	$l_force_signal = "Force du signal";
43
	$l_force_signal = "Force du signal";
43
	$l_imei_device = "IMEI du périphérique";
44
	$l_imei_device = "IMEI du périphérique";
44
	$l_sms_received = "Nombre de SMS reçu";
45
	$l_sms_received = "Nombre de SMS reçu";
45
	$l_stop = "Arrêter";
46
	$l_stop = "Arrêter";
46
	$l_gammu_on="Gammu est lancé";
47
	$l_gammu_on="Gammu est lancé";
47
	$l_gammu_off="Gammu est arrêté";
48
	$l_gammu_off="Gammu est arrêté";
48
	$l_edit = "Editer";
49
	$l_edit = "Editer";
49
	$l_error_label_empty = "Le champ est vide";
50
	$l_error_label_empty = "Le champ est vide";
50
	$l_error_label_num = "Ce n'est pas un PIN valide";
51
	$l_error_label_num = "Ce n'est pas un PIN valide";
51
	$l_error_label_num2 = "Ce n'est pas un nombre";
52
	$l_error_label_num2 = "Ce n'est pas un nombre";
52
	$l_error_label_num3 = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
53
	$l_error_label_num3 = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
53
	$l_error_writefail = "Le service semble ne pas parvenir à discuter avec la clé (port ttyUSB0).";
54
	$l_error_writefail = "Le service semble ne pas parvenir à discuter avec la clé (port ttyUSB0).";
54
	$l_error_timeoutfail = "Impossible de se connecter à la clé 3G. Timeout.";
55
	$l_error_timeoutfail = "Impossible de se connecter à la clé 3G. Timeout.";
55
	$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est elle présente?";
56
	$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est elle présente?";
56
	$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br>
57
	$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br>
57
					La SIM doit être bloqué (code PUK). Consultez la documentation.";
58
					La SIM doit être bloqué (code PUK). Consultez la documentation.";
58
	$l_autorefresh = "Rafraichissement : 30 sec";
59
	$l_autorefresh = "Rafraichissement : 30 sec";
59
	$l_days = "jours ";
60
	$l_days = "jours ";
60
	
61
	
61
	$l_num_block="Liste des numéros bloqués";
62
	$l_num_block="Liste des numéros bloqués";
62
	$l_num_num="Numéro";
63
	$l_num_num="Numéro";
63
	$l_num_raison="Raison";
64
	$l_num_raison="Raison";
64
	$l_num_expiration="Date d'expiration";
65
	$l_num_expiration="Date d'expiration";
65
	$l_num_action="Action";
66
	$l_num_action="Action";
66
	$l_num_exist="Un compte a été créé";
67
	$l_num_exist="Un compte a été créé";
67
	$l_num_flood="Le nombre d'essais maximum a été dépacé";
68
	$l_num_flood="Le nombre d'essais maximum a été dépassé";
68
	$l_num_unlock="Effacer";
69
	$l_num_unlock="Effacer";
-
 
70
	$l_country_enable="Activer";
-
 
71
	$l_country_disable="Désactiver";
69
	$l_service_status_img_ok="Démarré";
72
	$l_service_status_img_ok="Démarré";
70
	$l_service_status_img_ko="Arrété";
73
	$l_service_status_img_ko="Arrété";
71
	
74
	
72
	$l_conf_name="Configuration : ";
75
	$l_conf_name="Configuration : ";
73
	$l_current_connect = "Connexion";
76
	$l_current_connect = "Connexion";
74
 
77
 
75
	$l_tab_first = "premier";
78
	$l_tab_first = "premier";
76
	$l_tab_last = "dernier";
79
	$l_tab_last = "dernier";
77
	$l_tab_next = "suivant";
80
	$l_tab_next = "suivant";
78
	$l_tab_prev = "précédent";
81
	$l_tab_prev = "précédent";
79
	$l_tab_search = "Recherche :";
82
	$l_tab_search = "Recherche :";
80
	$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_";
83
	$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_";
81
	$l_tab_info = "Montrer _MENU_ résultat par page";
84
	$l_tab_info = "Montrer _MENU_ résultats par page";
82
	$l_tab_infoempty = "Aucun résultat";
85
	$l_tab_infoempty = "Aucun résultat";
-
 
86
 
-
 
87
	$l_country_filter = "Filtrage en cours : ";
-
 
88
	$l_country_filtering = " Filtrage par pays";
-
 
89
	$l_country_filtering_plus = " Filtrage par pays avancé";
-
 
90
	$l_phone_ban = " Numéro de téléphone bloqués";
-
 
91
	$l_country_france_ena = "Autorise les numéros français";
-
 
92
	$l_country_ue_ena = "Autorise les numéros européens";
-
 
93
	$l_country_all_ena = "Autorise tous les pays";
-
 
94
	$l_country_advanced_ena = "Autorisation personnalisé";
-
 
95
	$l_advance = "Avancé";
83
}
96
}
84
else {
97
else {
85
	$l_title = "Auto registration (SMS)";
98
	$l_title = "Auto registration (SMS)";
86
	$l_conf = "Configuration";
99
	$l_conf = "Configuration";
87
	$l_conf_actu = "Current configuration";
100
	$l_conf_actu = "Current configuration";
88
	$l_pin = "PIN password";
101
	$l_pin = "PIN password";
89
	$l_num_alcasar = "Phone number (3g key)";
102
	$l_num_alcasar = "Phone number (3g key)";
90
	$l_ban_temp = "Max number of try before a permanent ban"; 
103
	$l_ban_temp = "Max number of try before a permanent ban"; 
91
	$l_time_account = "Time for a new session";
104
	$l_time_account = "Time for a new session";
92
	$l_time_perm = "Duration of a ban (for example, after X try)";
105
	$l_time_perm = "Duration of a ban (for example, after X try)";
93
	$l_status_gammu = "Service status";
106
	$l_status_gammu = "Service status";
94
	$l_start = "Start";
107
	$l_start = "Start";
95
	$l_status_device = "Status of your device";
108
	$l_status_device = "Status of your device";
96
	$l_key_diseable = "No device detected";
109
	$l_key_diseable = "No device detected";
97
	$l_key_enable = "Your 3g key is connected";
110
	$l_key_enable = "Your 3g key is connected";
98
	$l_force_signal = "Signal strength";
111
	$l_force_signal = "Signal strength";
99
	$l_imei_device = "Device IMEI";
112
	$l_imei_device = "Device IMEI";
100
	$l_sms_received = "Number of SMS received";
113
	$l_sms_received = "Number of SMS received";
101
	$l_stop = "Stop";
114
	$l_stop = "Stop";
102
	$l_gammu_on="Gammu is running";
115
	$l_gammu_on="Gammu is running";
103
	$l_gammu_off="Gammu is down";
116
	$l_gammu_off="Gammu is down";
104
	$l_edit = "Edit";
117
	$l_edit = "Edit";
105
	$l_error_label_empty = "Field empty";
118
	$l_error_label_empty = "Field empty";
106
	$l_error_label_num = "It's not a valid PIN password";
119
	$l_error_label_num = "It's not a valid PIN password";
107
	$l_error_label_num2 = "It's not a number";
120
	$l_error_label_num2 = "It's not a number";
108
	$l_error_label_num3 = "The phone number is not good: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
121
	$l_error_label_num3 = "The phone number is not good: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
109
	$l_error_writefail = "Can not listen the ttyUSB0 port.";
122
	$l_error_writefail = "Can not listen the ttyUSB0 port.";
110
	$l_error_timeoutfail = "Timeout. Can not connect to modem.";
123
	$l_error_timeoutfail = "Timeout. Can not connect to modem.";
111
	$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?";
124
	$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?";
112
	$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br>
125
	$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br>
113
				The Sim card must be blocked. Please read the documentation.";
126
				The Sim card must be blocked. Please read the documentation.";
114
	$l_autorefresh = "Refresh : 30 sec";
127
	$l_autorefresh = "Refresh : 30 sec";
115
	$l_days = "days ";
128
	$l_days = "days ";
116
	
129
	
117
	$l_num_block="List of blocked phone";
130
	$l_num_block="List of blocked phone";
118
	$l_num_num="Phone number";
131
	$l_num_num="Phone number";
119
	$l_num_raison="Reason";
132
	$l_num_raison="Reason";
120
	$l_num_expiration="Expiration date";
133
	$l_num_expiration="Expiration date";
121
	$l_num_action="Action";
134
	$l_num_action="Action";
122
	$l_num_exist="An account has been created";
135
	$l_num_exist="An account has been created";
123
	$l_num_flood="The number of try has been reached";
136
	$l_num_flood="The number of try has been reached";
124
	$l_num_unlock="Erase";
137
	$l_num_unlock="Erase";
-
 
138
	$l_country_enable="Enable";
-
 
139
	$l_country_disable="Disable";
125
	$l_service_status_img_ok="Running";
140
	$l_service_status_img_ok="Running";
126
	$l_service_status_img_ko="Stopped";
141
	$l_service_status_img_ko="Stopped";
127
	
142
	
128
	$l_conf_name="Configuration : ";
143
	$l_conf_name="Configuration : ";
129
	$l_current_connect = "Connection";
144
	$l_current_connect = "Connection";
130
	
145
	
131
	$l_tab_first = "first";
146
	$l_tab_first = "first";
132
	$l_tab_last = "last";
147
	$l_tab_last = "last";
133
	$l_tab_next = "next";
148
	$l_tab_next = "next";
134
	$l_tab_prev = "previous";
149
	$l_tab_prev = "previous";
135
	$l_tab_search = "Search :";
150
	$l_tab_search = "Search :";
136
	$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :";
151
	$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :";
137
	$l_tab_info = "Show _MENU_ entries";
152
	$l_tab_info = "Show _MENU_ entries";
138
	$l_tab_infoempty = "No matching records found";
153
	$l_tab_infoempty = "No matching records found";
-
 
154
 
-
 
155
	$l_country_filter = "Current filtering : ";
-
 
156
	$l_country_filtering = " Country filtering";
-
 
157
	$l_country_filtering_plus = " Country filtering advanced";
-
 
158
	$l_phone_ban = " Phone Number banned";
-
 
159
	$l_country_france_ena = "Authorize the french numbers";
-
 
160
	$l_country_ue_ena = "Authorize european numbers";
-
 
161
	$l_country_all_ena = "Authorize all countries";
-
 
162
	$l_country_advanced_ena = "Advanced Authorization";
-
 
163
	$l_advance = "Advanced";
139
}
164
}
140
?>
165
?>
141
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
166
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
142
<HTML><!-- written by Rexy -->
167
<HTML><!-- written by Rexy -->
143
<head>
168
<head>
144
<META HTTP-EQUIV="Refresh" CONTENT="30">
169
<!--<META HTTP-EQUIV="Refresh" CONTENT="30">-->
145
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
170
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
146
<title>Auto enregistrement</title>
171
<title>Auto enregistrement</title>
147
<link rel="stylesheet" href="/css/style.css">
172
<link rel="stylesheet" href="/css/style.css">
148
<!-- DataTables CSS -->
173
<!-- DataTables CSS -->
149
<link rel="stylesheet" type="text/css" href="../../../css/jquery.dataTables.css">
174
<link rel="stylesheet" type="text/css" href="../../../css/jquery.dataTables.css">
150
<!-- jQuery -->
175
<!-- jQuery -->
151
<script type="text/javascript" charset="utf8" src="../../../js/jquery.js"></script>
176
<script type="text/javascript" charset="utf8" src="../../../js/jquery.js"></script>
152
<!-- DataTables -->
177
<!-- DataTables -->
153
<script type="text/javascript" charset="utf8" src="../../../js/jquery.dataTables.js"></script>
178
<script type="text/javascript" charset="utf8" src="../../../js/jquery.dataTables.js"></script>
154
<script type="text/javascript">
179
<script type="text/javascript">
-
 
180
function timedRefresh(timeoutPeriod) {
-
 
181
    var interval = setInterval(refreshPage, timeoutPeriod);
-
 
182
}
-
 
183
 
-
 
184
function refreshPage() {
-
 
185
    if ($("input[name=autoRefreshCheckboxes]").is(":checked")) {
-
 
186
        location.reload(true);
-
 
187
    }
-
 
188
}
-
 
189
 
155
$(document).ready( function () {
190
$(document).ready( function () {
-
 
191
 
156
    $('#table_id').DataTable({
192
    	$('#table_id').DataTable({
-
 
193
		"language": {
-
 
194
			"paginate": {
-
 
195
			"sFirst": "<?php echo $l_tab_first; ?>",
-
 
196
			"sLast": "<?php echo $l_tab_last; ?>",
-
 
197
			"sPrevious": "<?php echo $l_tab_prev; ?>",
-
 
198
			"sNext": "<?php echo $l_tab_next; ?>"
-
 
199
			},
-
 
200
            "lengthMenu": "<?php echo $l_tab_info; ?>",
-
 
201
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
-
 
202
            "info": "<?php echo $l_tab_pmenu; ?>",
-
 
203
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
-
 
204
			"sSearch": "<?php echo $l_tab_search; ?>"
-
 
205
        }
-
 
206
	});
-
 
207
 
-
 
208
	$('#table_country').DataTable({
157
		"language": {
209
		"language": {
158
			"paginate": {
210
			"paginate": {
159
			"sFirst": "<?php echo $l_tab_dirst; ?>",
211
			"sFirst": "<?php echo $l_tab_first; ?>",
160
			"sLast": "<?php echo $l_tab_last; ?>",
212
			"sLast": "<?php echo $l_tab_last; ?>",
161
			"sPrevious": "<?php echo $l_tab_prev; ?>",
213
			"sPrevious": "<?php echo $l_tab_prev; ?>",
162
			"sNext": "<?php echo $l_tab_next; ?>"
214
			"sNext": "<?php echo $l_tab_next; ?>"
163
			},
215
			},
164
            "lengthMenu": "<?php echo $l_tab_info; ?>",
216
            "lengthMenu": "<?php echo $l_tab_info; ?>",
165
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
217
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
166
            "info": "<?php echo $l_tab_pmenu; ?>",
218
            "info": "<?php echo $l_tab_pmenu; ?>",
167
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
219
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
168
			"sSearch": "<?php echo $l_tab_search; ?>"
220
			"sSearch": "<?php echo $l_tab_search; ?>"
169
        }
221
        }
170
	});
222
	});
-
 
223
 
-
 
224
	$(".showhide-div_country").slideUp("slow");	
-
 
225
	$(".showhide-div_ban").slideUp("slow");
-
 
226
	$(".showhide-div_country_plus").slideUp("slow");
-
 
227
 
-
 
228
	$(".showhide-but_country").on("click", function(){
-
 
229
	    $(".showhide-div_country").slideToggle("slow");
-
 
230
	});
-
 
231
 
-
 
232
	$(".showhide-but_country_plus").on("click", function(){
-
 
233
	    $(".showhide-div_country_plus").slideToggle("slow");
-
 
234
	});
-
 
235
 
-
 
236
	$(".showhide-but_ban").on("click", function(){
-
 
237
	    $(".showhide-div_ban").slideToggle("slow");
-
 
238
	});
-
 
239
 
171
} );
240
} );
172
</script>
241
</script>
173
</head>
242
</head>
174
<body>
243
<body onload="JavaScript:timedRefresh(30000);">
175
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
244
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
176
<?php
245
<?php
177
echo "
246
echo "
178
	<tr>
247
	<tr>
179
		<th>$l_title</th>
248
		<th>$l_title</th>
180
	</tr>
249
	</tr>
181
	<tr bgcolor=\"#FFCC66\">
250
	<tr bgcolor=\"#FFCC66\">
182
		<td><img src=\"/images/pix.gif\" width=\"1\" height=\"2\"></td>
251
		<td><img src=\"/images/pix.gif\" width=\"1\" height=\"2\"></td>
183
	</tr>
252
	</tr>
184
	</TABLE>
253
	</TABLE>
185
	<br />
254
	<br />
186
	$l_autorefresh	
255
	<input type='checkbox' checked='checked' name='autoRefreshCheckboxes' >".$l_autorefresh."</input>	
187
	";
256
	";
188
 
257
 
189
?>
258
?>
190
<center>
259
<center>
191
<br /><br />
260
<br /><br />
192
<table border=1 width=100%>
261
<table border=1 width=100%>
193
<tr>
262
<tr>
194
<td colspan=3><h3><?php echo $l_status_device ?></h3></td>
263
<td colspan=3><h3><?php echo $l_status_device ?></h3></td>
195
</tr>
264
</tr>
196
 
265
 
197
<tr>
266
<tr>
198
<?php
267
<?php
199
if(!empty($exec_com) || !empty($exec_com2))
268
if(!empty($exec_com) || !empty($exec_com2))
200
{
269
{
201
 
270
 
202
	if(isset($_GET['config_submit'])){
271
	if(isset($_GET['config_submit'])){
203
		switch ($_GET['config']) {
272
		switch ($_GET['config']) {
204
		case "at":
273
		case "at":
205
			exec("sudo $script --replace_connect  ");
274
			exec("sudo $script --replace_connect  ");
206
			break;
275
			break;
207
		case "9600":
276
		case "9600":
208
			exec("sudo $script --replace_connect 9600");
277
			exec("sudo $script --replace_connect 9600");
209
			break;
278
			break;
210
		case "19200":
279
		case "19200":
211
			exec("sudo $script --replace_connect 19200");
280
			exec("sudo $script --replace_connect 19200");
212
			break;
281
			break;
213
		case "115200":
282
		case "115200":
214
			exec("sudo $script --replace_connect 115200");
283
			exec("sudo $script --replace_connect 115200");
215
			break;
284
			break;
216
 
285
 
217
		}	
286
		}	
218
	}
287
	}
219
 
288
 
220
	$current_connect = exec("sudo $script --connect");
289
	$current_connect = exec("sudo $script --connect");
221
	
290
	
222
 
291
 
223
	echo '<td width="50%">'.$l_key_enable.'</td>';
292
	echo '<td width="50%">'.$l_key_enable.'</td>';
224
	echo '<td width="20%">'.$l_current_connect.' : '.$current_connect.'</td>';
293
	echo '<td width="20%">'.$l_current_connect.' : '.$current_connect.'</td>';
225
	echo '	<form form="GET" action="./autoregistration.php">
294
	echo '	<form form="GET" action="./autoregistration.php">
226
			<td align="right">	'.$l_conf_name.'
295
			<td align="right">	'.$l_conf_name.'
227
				<select name="config">
296
				<select name="config">
228
					<option value="at">at</option>
297
					<option value="at">at</option>
229
					<option value="9600">at9600</option>
298
					<option value="9600">at9600</option>
230
					<option value="19200">at19200</option>
299
					<option value="19200">at19200</option>
231
					<option value="115200">at115200</option>
300
					<option value="115200">at115200</option>
232
				</select>
301
				</select>
233
				<input type="submit" name="config_submit"></submit> 
302
				<input type="submit" name="config_submit"></submit> 
234
			</td>
303
			</td>
235
		</form>
304
		</form>
236
		';
305
		';
237
 
306
 
238
	$status_key="true";
307
	$status_key="true";
239
}
308
}
240
else
309
else
241
{
310
{
242
	echo "<td>$l_key_diseable</td>";
311
	echo "<td>$l_key_diseable</td>";
243
	$status_key="false";
312
	$status_key="false";
244
}
313
}
245
?>
314
?>
246
</tr>
315
</tr>
247
</table>
316
</table>
248
</center>
317
</center>
249
<br /><br />
318
<br /><br />
250
 
319
 
251
<?php
320
<?php
252
 
321
 
253
#Test si gammu est lancé
322
#Test si gammu est lancé
254
$gammu_pid=exec("sudo /sbin/pidof gammu-smsd");
323
$gammu_pid=exec("sudo /sbin/pidof gammu-smsd");
255
 
324
 
256
 
325
 
257
if ($status_key=="false")
326
if ($status_key=="false")
258
{
327
{
259
	if ($gammu_pid!="")
328
	if ($gammu_pid!="")
260
	{
329
	{
261
		exec("sudo $script stop");
330
		exec("sudo $script stop");
262
		sleep(8);
331
		sleep(8);
263
		header('Location: autoregistration.php');	
332
		header('Location: autoregistration.php');	
264
	}
333
	}
265
}
334
}
266
 
335
 
267
if ($status_key=="true")
336
if ($status_key=="true")
268
{
337
{
269
	#Nom du fichier de log lorsque gammu est démarré
338
	#Nom du fichier de log lorsque gammu est démarré
270
	#$file_log = "gammu-smsd.log";
339
	#$file_log = "gammu-smsd.log";
271
 
340
 
272
	#Recuperation du code PIN actuel
341
	#Recuperation du code PIN actuel
273
	$current_pin = exec("sudo $script --pin");	
342
	$current_pin = exec("sudo $script --pin");	
274
	
343
	
275
	#Recuperation du nombre de try avant le ban perm
344
	#Recuperation du nombre de try avant le ban perm
276
	$current_try_ban = exec("sudo $script --try_ban");	
345
	$current_try_ban = exec("sudo $script --try_ban");	
277
 
346
 
278
	#Recuperation de la durée d'une session créée
347
	#Recuperation de la durée d'une session créée
279
	$current_time_account = exec("sudo $script --time_account");	
348
	$current_time_account = exec("sudo $script --time_account");	
280
 
349
 
281
	#Recuperation de la durée dun ban perm (après flood)
350
	#Recuperation de la durée dun ban perm (après flood)
282
	$current_time_perm = exec("sudo $script --time_perm");	
351
	$current_time_perm = exec("sudo $script --time_perm");	
283
 
352
 
284
	#Detection neméro de tel
353
	#Detection neméro de tel
285
	$current_num_alcasar = exec("sudo $script --numero_alcasar");
354
	$current_num_alcasar = exec("sudo $script --numero_alcasar");
286
	
355
	
287
	#Detection problème avec la SIM
356
	#Detection problème avec la SIM
288
	$current_simfail = exec("sudo $script --last_nosim");
357
	$current_simfail = exec("sudo $script --last_nosim");
289
 
358
 
290
	#Recuperation de la dernière ligne de START
359
	#Recuperation de la dernière ligne de START
291
	$current_last_start = exec("sudo $script --last_start");
360
	$current_last_start = exec("sudo $script --last_start");
292
 
361
 
293
	#Recuperarion de la dernière ligne de STOP
362
	#Recuperarion de la dernière ligne de STOP
294
	$current_last_stop = exec("sudo $script --last_stop");
363
	$current_last_stop = exec("sudo $script --last_stop");
295
 
364
 
296
	#Recuperation de la dernière ligne de SECURITYERROR
365
	#Recuperation de la dernière ligne de SECURITYERROR
297
	$current_last_secu = exec("sudo $script --last_secu");
366
	$current_last_secu = exec("sudo $script --last_secu");
298
 
367
 
299
	#Recuperation de la dernière ligne de DEVICEWRITEERROR
368
	#Recuperation de la dernière ligne de DEVICEWRITEERROR
300
	$current_last_write = exec("sudo $script --last_writeerror");
369
	$current_last_write = exec("sudo $script --last_writeerror");
301
 
370
 
302
	#Recuperation de la dernière ligne de TIMEOUT
371
	#Recuperation de la dernière ligne de TIMEOUT
303
	$current_last_timeout = exec("sudo $script --last_timeout");
372
	$current_last_timeout = exec("sudo $script --last_timeout");
304
	
373
	
305
	# Test si le service est lancé
374
	# Test si le service est lancé
306
	if ($gammu_pid=="")
375
	if ($gammu_pid=="")
307
	{
376
	{
308
		$force_signal = "-";
377
		$force_signal = "-";
309
		$imei_device = "-";
378
		$imei_device = "-";
310
		$sms_received = "-";
379
		$sms_received = "-";
311
 
380
 
312
		$gammu="<td><img src=\"/images/state_error.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ko."\"></td><td>$l_gammu_off</td>";	
381
		$gammu="<td><img src=\"/images/state_error.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ko."\"></td><td>$l_gammu_off</td>";	
313
		$gammu_status_on="";
382
		$gammu_status_on="";
314
		$gammu_status_off="disabled";
383
		$gammu_status_off="disabled";
315
 
384
 
316
		if($current_last_secu!="")
385
		if($current_last_secu!="")
317
		{
386
		{
318
			if(($current_last_secu > $current_last_start) && ($current_last_secu < $current_last_stop))
387
			if(($current_last_secu > $current_last_start) && ($current_last_secu < $current_last_stop))
319
			{
388
			{
320
				$gammu_simsecu="<tr><td colspan=7><font color=red>$l_error_simsecu_l</font></td></tr>";	
389
				$gammu_simsecu="<tr><td colspan=7><font color=red>$l_error_simsecu_l</font></td></tr>";	
321
			}
390
			}
322
		}
391
		}
323
	} else {
392
	} else {
324
		# Recuperation de la force du signal et IMEI et nombre de sms reçu
393
		# Recuperation de la force du signal et IMEI et nombre de sms reçu
325
		$val_force_signal = exec("sudo $script --signal_device");
394
		$val_force_signal = exec("sudo $script --signal_device");
326
		$imei_device = exec("sudo $script --imei_device");
395
		$imei_device = exec("sudo $script --imei_device");
327
		$sms_received = exec("sudo $script --sms_received");
396
		$sms_received = exec("sudo $script --sms_received");
328
 
397
 
329
		if ($val_force_signal < 21) {
398
		if ($val_force_signal < 21) {
330
			$force_signal = "<img src=\"/images/signal_0.png\">  --  ".$val_force_signal." %";
399
			$force_signal = "<img src=\"/images/signal_0.png\">  --  ".$val_force_signal." %";
331
		} elseif ($val_force_signal < 41) {
400
		} elseif ($val_force_signal < 41) {
332
			$force_signal = "<img src=\"/images/signal_20.png\">  --  ".$val_force_signal." %";
401
			$force_signal = "<img src=\"/images/signal_20.png\">  --  ".$val_force_signal." %";
333
 
402
 
334
		} elseif ($val_force_signal < 61) {
403
		} elseif ($val_force_signal < 61) {
335
			$force_signal = "<img src=\"/images/signal_40.png\">  --  ".$val_force_signal." %";
404
			$force_signal = "<img src=\"/images/signal_40.png\">  --  ".$val_force_signal." %";
336
 
405
 
337
		} elseif ($val_force_signal < 81) {
406
		} elseif ($val_force_signal < 81) {
338
			$force_signal = "<img src=\"/images/signal_60.png\">  --  ".$val_force_signal." %";
407
			$force_signal = "<img src=\"/images/signal_60.png\">  --  ".$val_force_signal." %";
339
 
408
 
340
		} elseif ($val_force_signal < 101) {
409
		} elseif ($val_force_signal < 101) {
341
			$force_signal = "<img src=\"/images/signal_80.png\">  --  ".$val_force_signal." %";
410
			$force_signal = "<img src=\"/images/signal_80.png\">  --  ".$val_force_signal." %";
342
 
411
 
343
		}
412
		}
344
 
413
 
345
 
414
 
346
 
415
 
347
 
416
 
348
 
417
 
349
		$gammu="<td><img src=\"/images/state_ok.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ok."\"></td><td>$l_gammu_on</td>";	
418
		$gammu="<td><img src=\"/images/state_ok.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ok."\"></td><td>$l_gammu_on</td>";	
350
				
419
				
351
		
420
		
352
		if($current_last_timeout!=""){
421
		if($current_last_timeout!=""){
353
			if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop))
422
			if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop))
354
			{
423
			{
355
				$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>";	
424
				$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>";	
356
			}
425
			}
357
		}
426
		}
358
		
427
		
359
		if($current_last_secu!="")
428
		if($current_last_secu!="")
360
		{
429
		{
361
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
430
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
362
			{
431
			{
363
				exec("sudo $script --stop");
432
				exec("sudo $script --stop");
364
			}
433
			}
365
		}
434
		}
366
		
435
		
367
		if($current_last_write!=""){
436
		if($current_last_write!=""){
368
			if(($current_last_write > $current_last_start) && ($current_last_write > $current_last_stop))
437
			if(($current_last_write > $current_last_start) && ($current_last_write > $current_last_stop))
369
			{
438
			{
370
				$gammu_writeerror="<tr><td colspan=7><font color=red>$l_error_writefail</font></td></tr>";	
439
				$gammu_writeerror="<tr><td colspan=7><font color=red>$l_error_writefail</font></td></tr>";	
371
			}
440
			}
372
		}
441
		}
373
		
442
		
374
		if($current_simfail!="")
443
		if($current_simfail!="")
375
		{
444
		{
376
			if(($current_simfail > $current_last_start) && ($current_simfail > $current_last_stop))
445
			if(($current_simfail > $current_last_start) && ($current_simfail > $current_last_stop))
377
			{
446
			{
378
				$gammu_simfail="<tr><td colspan=7><font color=red>$l_error_simfail</font></td></tr>";
447
				$gammu_simfail="<tr><td colspan=7><font color=red>$l_error_simfail</font></td></tr>";
379
			}
448
			}
380
		}
449
		}
381
		$gammu_status_on="disabled";
450
		$gammu_status_on="disabled";
382
		$gammu_status_off="";
451
		$gammu_status_off="";
383
	}
452
	}
384
 
453
 
385
 
454
 
386
	#Lancement et arret de gammu-smsd 3*7sec
455
	#Lancement et arret de gammu-smsd 3*7sec
387
	if(isset($_GET["start"])){
456
	if(isset($_GET["start"])){
388
		$gammu_1=exec("sudo $script --start");
457
		$gammu_1=exec("sudo $script --start");
389
		sleep(7);
458
		sleep(7);
390
		
459
		
391
		if($current_last_secu!="")
460
		if($current_last_secu!="")
392
		{
461
		{
393
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
462
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
394
			{
463
			{
395
				exec("sudo $script --stop");
464
				exec("sudo $script --stop");
396
			}
465
			}
397
		}
466
		}
398
		
467
		
399
		sleep(7);
468
		sleep(7);
400
		if($current_last_secu!="")
469
		if($current_last_secu!="")
401
		{
470
		{
402
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
471
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
403
			{
472
			{
404
				exec("sudo $script --stop");
473
				exec("sudo $script --stop");
405
			}
474
			}
406
		}
475
		}
407
		
476
		
408
		sleep(7);	
477
		sleep(7);	
409
		if($current_last_secu!="")
478
		if($current_last_secu!="")
410
		{
479
		{
411
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
480
			if(($current_last_secu > $current_last_start) && ($current_last_secu > $current_last_stop))
412
			{
481
			{
413
				exec("sudo $script --stop");
482
				exec("sudo $script --stop");
414
			}
483
			}
415
		}
484
		}
416
		
485
		
417
		
486
		
418
		
487
		
419
		header('Location: autoregistration.php');
488
		header('Location: autoregistration.php');
420
	}
489
	}
421
 
490
 
422
	if(isset($_GET["stop"])){
491
	if(isset($_GET["stop"])){
423
		exec("sudo $script --stop");
492
		exec("sudo $script --stop");
424
		sleep(8);
493
		sleep(8);
425
		header('Location: autoregistration.php');
494
		header('Location: autoregistration.php');
426
	}
495
	}
427
 
496
 
428
 
497
 
429
	#Edition du NUMERO de telephone
498
	#Edition du NUMERO de telephone
430
	if(isset($_GET["b_num_alcasar"])){
499
	if(isset($_GET["b_num_alcasar"])){
431
		$num = $_GET["num_alcasar"];
500
		$num = $_GET["num_alcasar"];
432
		$error_num_alcasar = "";
501
		$error_num_alcasar = "";
433
		if($num !="")
502
		if($num !="")
434
		{
503
		{
435
			if(preg_match('#^\+#',$num))
504
			if(preg_match('#^\+#',$num))
436
			{
505
			{
437
				exec("sudo $script --replace_numero_alcasar  $num");
506
				exec("sudo $script --replace_numero_alcasar  $num");
438
				header('Location: autoregistration.php');
507
				header('Location: autoregistration.php');
439
			}
508
			}
440
			else
509
			else
441
			{
510
			{
442
				$error_num_alcasar=$l_error_label_num3;
511
				$error_num_alcasar=$l_error_label_num3;
443
			}
512
			}
444
		}
513
		}
445
		else
514
		else
446
		{
515
		{
447
			$error_num_alcasar=$l_error_label_empty;
516
			$error_num_alcasar=$l_error_label_empty;
448
		}
517
		}
449
	}
518
	}
450
	
519
	
451
	#Edition du code PIN
520
	#Edition du code PIN
452
	if(isset($_GET["b_pin"])){
521
	if(isset($_GET["b_pin"])){
453
		$pin = $_GET["pin"];
522
		$pin = $_GET["pin"];
454
		$error_pin = "";
523
		$error_pin = "";
455
		if($pin !="")
524
		if($pin !="")
456
		{
525
		{
457
			if(is_numeric($pin))
526
			if(is_numeric($pin))
458
			{
527
			{
459
				exec("sudo $script --replace_pin  $pin");
528
				exec("sudo $script --replace_pin  $pin");
460
				header('Location: autoregistration.php');
529
				header('Location: autoregistration.php');
461
			}
530
			}
462
			else
531
			else
463
			{
532
			{
464
				$error_pin=$l_error_label_num;			
533
				$error_pin=$l_error_label_num;			
465
			}
534
			}
466
		}
535
		}
467
		else
536
		else
468
		{
537
		{
469
			$error_pin=$l_error_label_empty;
538
			$error_pin=$l_error_label_empty;
470
		}
539
		}
471
	}
540
	}
472
	
541
	
473
	
542
	
474
	#Edition du nombre d'essais avant le ban perm
543
	#Edition du nombre d'essais avant le ban perm
475
	if(isset($_GET["b_ban_temp"])){
544
	if(isset($_GET["b_ban_temp"])){
476
		$nb_ban_temp = $_GET["nb_essais"];
545
		$nb_ban_temp = $_GET["nb_essais"];
477
		$error_nb_essais = "";
546
		$error_nb_essais = "";
478
		if($nb_ban_temp !="")
547
		if($nb_ban_temp !="")
479
		{
548
		{
480
			if(is_numeric($nb_ban_temp))
549
			if(is_numeric($nb_ban_temp))
481
			{
550
			{
482
				exec("sudo $script --replace_try_ban  $nb_ban_temp");
551
				exec("sudo $script --replace_try_ban  $nb_ban_temp");
483
				header('Location: autoregistration.php');
552
				header('Location: autoregistration.php');
484
			}
553
			}
485
			else
554
			else
486
			{
555
			{
487
				$error_nb_essais=$l_error_label_num2;			
556
				$error_nb_essais=$l_error_label_num2;			
488
			}
557
			}
489
		}
558
		}
490
		else
559
		else
491
		{
560
		{
492
			$error_nb_essais=$l_error_label_empty;
561
			$error_nb_essais=$l_error_label_empty;
493
		}
562
		}
494
	}
563
	}
495
 
564
 
496
 
565
 
497
	#Edition de la durée pour un compte créé
566
	#Edition de la durée pour un compte créé
498
	if(isset($_GET["b_time_account"])){
567
	if(isset($_GET["b_time_account"])){
499
		$time_account = $_GET["time_account"];
568
		$time_account = $_GET["time_account"];
500
		$error_time_account = "";
569
		$error_time_account = "";
501
		if($time_account !="")
570
		if($time_account !="")
502
		{
571
		{
503
			if(is_numeric($time_account))
572
			if(is_numeric($time_account))
504
			{
573
			{
505
				exec("sudo $script --replace_time_account  $time_account");
574
				exec("sudo $script --replace_time_account  $time_account");
506
				header('Location: autoregistration.php');
575
				header('Location: autoregistration.php');
507
			}
576
			}
508
			else
577
			else
509
			{
578
			{
510
				$error_time_account=$l_error_label_num2;
579
				$error_time_account=$l_error_label_num2;
511
			}
580
			}
512
		}
581
		}
513
		else
582
		else
514
		{
583
		{
515
			$error_time_account=$l_error_label_empty;
584
			$error_time_account=$l_error_label_empty;
516
		}
585
		}
517
	}
586
	}
518
 
587
 
519
	#Edition de la durée d'un ban perm (après flood)
588
	#Edition de la durée d'un ban perm (après flood)
520
	if(isset($_GET["b_time_perm"])){
589
	if(isset($_GET["b_time_perm"])){
521
		$time_perm = $_GET["time_perm"];
590
		$time_perm = $_GET["time_perm"];
522
		$error_time_perm = "";
591
		$error_time_perm = "";
523
		if($time_perm !="")
592
		if($time_perm !="")
524
		{
593
		{
525
			if(is_numeric($time_perm))
594
			if(is_numeric($time_perm))
526
			{
595
			{
527
				exec("sudo $script --replace_time_perm  $time_perm");
596
				exec("sudo $script --replace_time_perm  $time_perm");
528
				header('Location: autoregistration.php');
597
				header('Location: autoregistration.php');
529
			}
598
			}
530
			else
599
			else
531
			{
600
			{
532
				$error_time_perm=$l_error_label_num2;
601
				$error_time_perm=$l_error_label_num2;
533
			}
602
			}
534
		}
603
		}
535
		else
604
		else
536
		{
605
		{
537
			$error_time_perm=$l_error_label_empty;
606
			$error_time_perm=$l_error_label_empty;
538
		}
607
		}
539
	}
608
	}
540
 
609
 
541
	# Suppression d'un numero bloqué
610
	# Suppression d'un numero bloqué
542
	if(isset($_GET['num_select'])){
611
	if(isset($_GET['num_select'])){
543
		$numero=$_GET['num_select'];
612
		$numero=$_GET['num_select'];
544
 
613
 
545
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep $numero | cut -d ' ' -f1");
614
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep $numero | cut -d ' ' -f1");
546
		exec("sudo /usr/sbin/chilli_query logout $add_mac");
615
		exec("sudo /usr/sbin/chilli_query logout $add_mac");
547
 
616
 
548
		exec("sudo $script --unlock_num $numero");
617
		exec("sudo $script --unlock_num $numero");
549
		header('Location: autoregistration.php');
618
		header('Location: autoregistration.php');
550
	}
619
	}
551
 
620
 
-
 
621
	# Edition etat pays
-
 
622
	if(isset($_GET['country_select'])){
-
 
623
		$country=utf8_decode($_GET['country_select']);
-
 
624
		exec("sudo $script --change_country $country");
-
 
625
		exec("sudo $script --change_country_filter advance");
-
 
626
		header('Location: autoregistration.php');
-
 
627
	}
-
 
628
 
-
 
629
	if(isset($_GET['b_france_enable'])){
-
 
630
		exec("sudo $script --change_country_dis_all");
-
 
631
		exec("sudo $script --change_country France");
-
 
632
		exec("sudo $script --change_country_filter fr");
-
 
633
		header('Location: autoregistration.php');
-
 
634
	}
-
 
635
 
-
 
636
	if(isset($_GET['b_ue_enable'])){
-
 
637
		exec("sudo $script --change_country_dis_all");
-
 
638
		$array_ue = array("Allemagne","Autriche","Belgique","Bulgarie","Chypre","Croatie","Danemark","Espagne","Estonie","Finlande","France","Grece","Hongrie","Irlande","Italie","Lettonie","Lituanie","Luxembourg","Malte","Pays-Bas"," Pologne","Portugal","Republique Tcheque","Roumanie","Angleterre","Slovaquie","Slovenie","Suede");
-
 
639
		foreach ($array_ue as $pays){
-
 
640
			exec("sudo $script --change_country $pays");
-
 
641
		}
-
 
642
		
-
 
643
		exec("sudo $script --change_country_filter ue");
-
 
644
		header('Location: autoregistration.php');
-
 
645
	}
-
 
646
 
-
 
647
	if(isset($_GET["b_country_enable"])){
-
 
648
		exec("sudo $script --change_country_ena_all");		
-
 
649
		exec("sudo $script --change_country_filter all");
-
 
650
		header('Location: autoregistration.php');
-
 
651
	}
-
 
652
 
-
 
653
	if(isset($_GET["b_country_disable"])){
-
 
654
		exec("sudo $script --change_country_dis_all");
-
 
655
		header('Location: autoregistration.php');
-
 
656
	}
552
 
657
 
553
 
658
 
554
	#Si une clé 3g est plugué
659
	#Si une clé 3g est plugué
555
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
660
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
556
			
661
			
557
		<table border=1>
662
		<table border=1>
558
		<tr>
663
		<tr>
559
			<td colspan=4><b>$l_status_gammu</b></td>
664
			<td colspan=4><b>$l_status_gammu</b></td>
560
			<td><b><center>$l_force_signal</center></b></td>
665
			<td><b><center>$l_force_signal</center></b></td>
561
			<td><b><center>$l_imei_device</center></b></td> 
666
			<td><b><center>$l_imei_device</center></b></td> 
562
			<td><b><center>$l_sms_received</center></b></td> 
667
			<td><b><center>$l_sms_received</center></b></td> 
563
		</tr>
668
		</tr>
564
		<tr>
669
		<tr>
565
			$gammu
670
			$gammu
566
			<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td>		
671
			<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td>		
567
			<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td>
672
			<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td>
568
			<td><center>$force_signal</center></td>
673
			<td><center>$force_signal</center></td>
569
			<td><center>$imei_device</center></td>
674
			<td><center>$imei_device</center></td>
570
			<td><center>$sms_received</center></td>
675
			<td><center>$sms_received</center></td>
571
		</tr>
676
		</tr>
572
		$gammu_puk
677
		$gammu_puk
573
		$gammu_simfail
678
		$gammu_simfail
574
		$gammu_simsecu
679
		$gammu_simsecu
575
		$gammu_timeout
680
		$gammu_timeout
576
		$gammu_writeerror
681
		$gammu_writeerror
577
		</table>
682
		</table>
578
	<br /><br />
683
	<br /><br />
579
		
684
		
580
		<table border=1>
685
		<table border=1>
581
		<tr>
686
		<tr>
582
		<td colspan=3><b>$l_conf</b></td>
687
		<td colspan=3><b>$l_conf</b></td>
583
		<td><b>$l_conf_actu</b></td>
688
		<td><b>$l_conf_actu</b></td>
584
		</tr>
689
		</tr>
585
		
690
		
586
		<tr>
691
		<tr>
587
		<td> $l_num_alcasar </td><td><input type=text name='num_alcasar' maxlength=\"20\"></td>
692
		<td> $l_num_alcasar </td><td><input type=text name='num_alcasar' maxlength=\"20\"></td>
588
		<td><button type=\"submit\" name=\"b_num_alcasar\" $gammu_status_on>$l_edit</button></td>
693
		<td><button type=\"submit\" name=\"b_num_alcasar\" $gammu_status_on>$l_edit</button></td>
589
		<td><center><font color=\"green\">$current_num_alcasar</font></center></td>
694
		<td><center><font color=\"green\">$current_num_alcasar</font></center></td>
590
		</tr>
695
		</tr>
591
		<tr><td colspan=\"4\"><font color=red><b>$error_num_alcasar</b></font></td></tr>
696
		<tr><td colspan=\"4\"><font color=red><b>$error_num_alcasar</b></font></td></tr>
592
		
697
		
593
		<tr>		
698
		<tr>		
594
		<td> $l_pin </td><td><input type=text name='pin' maxlength=\"8\"></td>
699
		<td> $l_pin </td><td><input type=text name='pin' maxlength=\"8\"></td>
595
		<td><button type=\"submit\" name=\"b_pin\" $gammu_status_on>$l_edit</button></td>
700
		<td><button type=\"submit\" name=\"b_pin\" $gammu_status_on>$l_edit</button></td>
596
		<td><center><font color=\"green\">$current_pin</font></center></td>
701
		<td><center><font color=\"green\">$current_pin</font></center></td>
597
		</tr>
702
		</tr>
598
		<tr><td colspan=\"4\"><font color=red><b>$error_pin</b></font></td></tr>
703
		<tr><td colspan=\"4\"><font color=red><b>$error_pin</b></font></td></tr>
599
 
704
 
600
		<td> $l_time_account </td><td><input type=text name='time_account'> $l_days </td>
705
		<td> $l_time_account </td><td><input type=text name='time_account'> $l_days </td>
601
		<td><button type=\"submit\" name=\"b_time_account\" $gammu_status_on>$l_edit</button></td>	
706
		<td><button type=\"submit\" name=\"b_time_account\" $gammu_status_on>$l_edit</button></td>	
602
		<td><center><font color=\"blue\">$current_time_account</font></center></td>
707
		<td><center><font color=\"blue\">$current_time_account</font></center></td>
603
		</tr>
708
		</tr>
604
		<tr><td colspan=\"4\"><font color=red><b>$error_time_account</b></font></td></tr>
709
		<tr><td colspan=\"4\"><font color=red><b>$error_time_account</b></font></td></tr>
605
		
710
		
606
		<tr>
711
		<tr>
607
		<td> $l_ban_temp </td><td><input type=text name='nb_essais'></td>	
712
		<td> $l_ban_temp </td><td><input type=text name='nb_essais'></td>	
608
		<td><button type=\"submit\" name=\"b_ban_temp\" $gammu_status_on>$l_edit</button></td>	
713
		<td><button type=\"submit\" name=\"b_ban_temp\" $gammu_status_on>$l_edit</button></td>	
609
		<td><center><font color=\"orange\">$current_try_ban</font></center></td>
714
		<td><center><font color=\"orange\">$current_try_ban</font></center></td>
610
		</tr>
715
		</tr>
611
		<tr><td colspan=\"4\"><font color=red><b>$error_nb_essais</b></font></td></tr>
716
		<tr><td colspan=\"4\"><font color=red><b>$error_nb_essais</b></font></td></tr>
612
		
717
		
613
		<tr>
718
		<tr>
614
		<td>$l_time_perm</td><td><input type=text name='time_perm'> $l_days</td>
719
		<td>$l_time_perm</td><td><input type=text name='time_perm'> $l_days</td>
615
		<td><button type=\"submit\" name=\"b_time_perm\" $gammu_status_on>$l_edit</button></td>	
720
		<td><button type=\"submit\" name=\"b_time_perm\" $gammu_status_on>$l_edit</button></td>	
616
		<td><center><font color=\"orange\">$current_time_perm</font></center></td>
721
		<td><center><font color=\"orange\">$current_time_perm</font></center></td>
617
		</tr>
722
		</tr>
618
		<tr><td colspan=\"4\"><font color=red><b>$error_time_perm</b></font></td></tr>
723
		<tr><td colspan=\"4\"><font color=red><b>$error_time_perm</b></font></td></tr>
619
		
724
		
620
		
725
		
621
		</tr>
726
		</tr>
622
		</table>
727
		</table>
623
		</form>";		
728
		</form>";
624
	
729
 
625
	
730
	
626
	require('/etc/freeradius-web/config.php');
731
	require('/etc/freeradius-web/config.php');
627
 
732
 
628
	if (is_file("../../../pass/sql/drivers/$config[sql_type]/functions.php"))
733
	if (is_file("../../../pass/sql/drivers/$config[sql_type]/functions.php"))
629
		include_once("../../../pass/sql/drivers/$config[sql_type]/functions.php");
734
		include_once("../../../pass/sql/drivers/$config[sql_type]/functions.php");
630
	else{
735
	else{
631
		echo "<b>Could not include SQL library</b>\n";
736
		echo "<b>Could not include SQL library</b>\n";
632
		exit();
737
		exit();
633
	}
738
	}	
634
 
-
 
635
 
739
 
636
	$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu");
740
	$con = mysqli_connect("$config[sql_server]","$config[sql_username]","$config[sql_password]","gammu");
637
 
741
 
638
	if(mysqli_connect_errno())
742
	if(mysqli_connect_errno())
639
	{
743
	{
640
		echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
744
		echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
641
	}
745
	}
642
 
746
 
-
 
747
 
643
	$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm");
748
	# Country table
644
 
749
 
645
?>
750
?>
-
 
751
 
-
 
752
	<div style="border-radius: 5px; background: #BDBDBD; margin-top: 15px;">
-
 
753
		 <span class="showhide-but_country"><?php echo "<strong>$l_country_filtering<strong>" ?><img src="/images/down2.gif" width="15" height="15"></span>
-
 
754
 
646
	<table id="table_id" class="display">
755
		<div class="showhide-div_country">
647
		<thead>
756
		<br />
-
 
757
			<table width=100% style="background: #BDBDBD;">
648
			<tr>
758
			<tr>
-
 
759
				<?php 
649
				<th><b><font color="black"><?php echo $l_num_num; ?></font></b></th>
760
					$result_country_filter = mysqli_query($con, "SELECT id FROM SMS_country WHERE name = 'FILTRAGE'");
650
				<th><b><font color="black"><?php echo $l_num_raison; ?></font></b></th>
761
					$row = mysqli_fetch_array($result_country_filter);
-
 
762
 
-
 
763
					if($row['id'] == "advance") {
651
				<th><b><font color="black"><?php echo $l_num_expiration; ?></font></b></th>
764
						$country_filter = $l_country_advanced_ena;
-
 
765
					} elseif($row['id'] == "ue") {
-
 
766
						$country_filter = $l_country_ue_ena;
-
 
767
					} elseif($row['id'] == "fr") {
652
				<th><b><font color="black">Action</font></b></th>
768
						$country_filter = $l_country_france_ena;
-
 
769
					} elseif($row['id'] == "all") {
-
 
770
						$country_filter = $l_country_all_ena;
-
 
771
					} else {
-
 
772
						$country_filter = "Err.";
-
 
773
					}
-
 
774
				?>
-
 
775
				<td colspan="3" align="center"><strong><?php echo $l_country_filter; ?></strong><font size="3" color="red"><?php echo $country_filter; ?></font></td>
653
			</tr>
776
			</tr>
654
		</thead>
-
 
655
		<tbody>
-
 
656
	<?php 
-
 
657
	while($row = mysqli_fetch_array($result))
-
 
658
	{
-
 
659
		echo "	
-
 
660
			<tr>
777
			<tr>
661
			<form action=\"autoregistration.php\" methode=\"POST\">
778
				<form action="autoregistration.php" methode="POST">
662
			<td>
-
 
663
				<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\">	
779
					<td align="center" width=33%><button type="submit" name="b_france_enable"><?php echo "$l_country_france_ena" ?></button></td>
664
				".$row['SenderNumber']."
-
 
665
			</td>";
-
 
666
		
-
 
667
		if($row['Perm']=='0')
-
 
668
		{
-
 
669
			echo "<td>$l_num_exist</td>";
-
 
670
		}
-
 
671
		if($row['Perm']=='1')
-
 
672
		{
-
 
673
			echo "<td>$l_num_flood</td>";
-
 
674
		}
-
 
675
		echo "	<td>" . $row['Expiration']. "</td>
780
					<td align="center" width=34%><button type="submit" name="b_ue_enable"><?php echo "$l_country_ue_ena" ?></button></td>
676
				<td>
-
 
677
					<input type='submit' value='".$l_num_unlock."'>
781
					<td align="center" width=33%><button type="submit" name="b_country_enable"><?php echo "$l_country_all_ena" ?></button></td>
678
				</td>
-
 
679
				</form>
782
				</form>
680
			</tr>
783
			</tr>	
-
 
784
			</table>
-
 
785
			<div style="border-radius: 5px; background: #D8D8D8; margin: 15px;">
-
 
786
			<span class="showhide-but_country_plus"><?php echo "<strong>$l_country_filtering_plus<strong>" ?> <img src="/images/down2.gif" width="15" height="15"></span>
-
 
787
				<div class="showhide-div_country_plus">
-
 
788
				<table id="table_country" class="display">
-
 
789
					<thead>
-
 
790
						<tr>
-
 
791
							<th><b><font color="black">Pays</font></b></th>
-
 
792
							<th><b><font color="black">code</font></b></th>
-
 
793
							<th><b><font color="black">Etat</font></b></th>
-
 
794
						</tr>
-
 
795
					</thead>
-
 
796
					<tbody>
-
 
797
						<?php 
-
 
798
 
-
 
799
						$result_country = mysqli_query($con, "SELECT * FROM SMS_country WHERE name != 'FILTRAGE'");
-
 
800
						while($row = mysqli_fetch_array($result_country))
-
 
801
						{
-
 
802
						echo "	
-
 
803
						<tr>
-
 
804
						<form action=\"autoregistration.php\" methode=\"POST\">
-
 
805
						<td>
-
 
806
							<input type=\"hidden\" name=\"country_select\" value=\"" .$row['name']."\">	
-
 
807
							".$row['name']."
-
 
808
						</td>
-
 
809
						<td>".$row['id']."</td>
681
			";
810
						";
682
	}
811
			
-
 
812
						if($row['status']=='0')
-
 
813
						{
-
 
814
							echo "<td><input type='image' src=\"/images/state_error.gif\" width=\"15\" height=\"15\"></td>";
-
 
815
						}
-
 
816
						if($row['status']=='1')
-
 
817
						{
-
 
818
							echo "<td><input type='image' src=\"/images/state_ok.gif\" width=\"15\" height=\"15\"></td>";
-
 
819
						}
-
 
820
						echo "	</form>
-
 
821
							</tr>
-
 
822
							";
-
 
823
						}
-
 
824
						?>
-
 
825
					</tbody>
-
 
826
				</table>
-
 
827
				</div>
-
 
828
			</div>
-
 
829
		</div>	
-
 
830
	</div>
-
 
831
<?php 
-
 
832
	$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm");
-
 
833
 
683
	?>
834
?>
-
 
835
 
-
 
836
<div style="border-radius: 5px; background: #BDBDBD; margin-top: 15px;">
-
 
837
		<span class="showhide-but_ban"><?php echo "<strong>$l_phone_ban</strong>" ?><img src="/images/down2.gif" width="15" height="15"></span>
-
 
838
 
-
 
839
		<div class="showhide-div_ban">
-
 
840
	
-
 
841
			<table id="table_id" class="display">
-
 
842
				<thead>
-
 
843
					<tr>
-
 
844
						<th><b><font color="black"><?php echo $l_num_num; ?></font></b></th>
-
 
845
						<th><b><font color="black"><?php echo $l_num_raison; ?></font></b></th>
-
 
846
						<th><b><font color="black"><?php echo $l_num_expiration; ?></font></b></th>
-
 
847
						<th><b><font color="black">Action</font></b></th>
-
 
848
					</tr>
-
 
849
				</thead>
-
 
850
				<tbody>
-
 
851
					<?php 
-
 
852
					while($row = mysqli_fetch_array($result))
-
 
853
					{
-
 
854
					echo "	
-
 
855
						<tr>
-
 
856
						<form action=\"autoregistration.php\" methode=\"POST\">
-
 
857
						<td>
-
 
858
							<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\">	
-
 
859
							".$row['SenderNumber']."
-
 
860
						</td>";
-
 
861
		
-
 
862
					if($row['Perm']=='0')
-
 
863
					{
-
 
864
						echo "<td>$l_num_exist</td>";
-
 
865
					}
-
 
866
					if($row['Perm']=='1')
-
 
867
					{
-
 
868
						echo "<td>$l_num_flood</td>";
-
 
869
					}
-
 
870
					echo "	<td>" . $row['Expiration']. "</td>
-
 
871
							<td>
-
 
872
								<input type='submit' value='".$l_num_unlock."'>
-
 
873
							</td>
-
 
874
							</form>
-
 
875
						</tr>
-
 
876
						";
-
 
877
					}
-
 
878
					?>
684
		</tbody>
879
				</tbody>
685
	</table>
880
			</table>
-
 
881
		</div>
-
 
882
	</div>
686
<?php
883
<?php
687
	mysqli_close($con);
884
	mysqli_close($con);
688
	}
885
	}
689
?>
886
?>
690
</html>
887
</html>
691
 
888