Subversion Repositories ALCASAR

Rev

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

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