Subversion Repositories ALCASAR

Rev

Rev 1380 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1380 Rev 1387
Line 1... Line -...
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
 
2
<HTML><!-- written by Rexy -->
-
 
3
<head>
-
 
4
<META HTTP-EQUIV="Refresh" CONTENT="30">
-
 
5
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
-
 
6
<title>Auto enregistrement</title>
-
 
7
<link rel="stylesheet" href="/css/style.css">
-
 
8
</head>
-
 
9
<body>
-
 
10
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
-
 
11
<?
1
<?php
12
# Test présence de clé/modem
2
# Test présence de clé/modem
13
$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");
14
$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");
15
 
5
 
16
//$exec_com2=exec("lsusb | grep -i d-link | cut -d ' ' -f7");
6
//$exec_com2=exec("lsusb | grep -i d-link | cut -d ' ' -f7");
Line 45... Line 35...
45
	$l_time_account = "Durée pour une session créée";
35
	$l_time_account = "Durée pour une session créée";
46
	$l_time_perm = "Durée du blocage (en jours)";
36
	$l_time_perm = "Durée du blocage (en jours)";
47
	$l_status_gammu = "Etat du service";
37
	$l_status_gammu = "Etat du service";
48
	$l_start = "Démarrer";
38
	$l_start = "Démarrer";
49
	$l_status_device = "Status de votre périphérique";
39
	$l_status_device = "Status de votre périphérique";
50
	$l_key_diseable = "Aucune clé est connectée";
40
	$l_key_diseable = "Aucun périphérique détecté";
51
	$l_key_enable = "Votre clé est connectée";
41
	$l_key_enable = "Votre clé est connectée";
52
	$l_force_signal = "Force du signal";
42
	$l_force_signal = "Force du signal";
53
	$l_imei_device = "IMEI du périphérique";
43
	$l_imei_device = "IMEI du périphérique";
54
	$l_sms_received = "Nombre de SMS reçu";
44
	$l_sms_received = "Nombre de SMS reçu";
55
	$l_stop = "Arrêter";
45
	$l_stop = "Arrêter";
Line 58... Line 48...
58
	$l_edit = "Editer";
48
	$l_edit = "Editer";
59
	$l_error_label_empty = "Le champ est vide";
49
	$l_error_label_empty = "Le champ est vide";
60
	$l_error_label_num = "Ce n'est pas un PIN valide";
50
	$l_error_label_num = "Ce n'est pas un PIN valide";
61
	$l_error_label_num2 = "Ce n'est pas un nombre";
51
	$l_error_label_num2 = "Ce n'est pas un nombre";
62
	$l_error_label_num3 = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
52
	$l_error_label_num3 = "Le format n'est pas correct: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
63
	$l_error_writefail = "Gammu semble ne pas parvenir à discuter avec la clé (port ttyUSB0).";
53
	$l_error_writefail = "Le service semble ne pas parvenir à discuter avec la clé (port ttyUSB0).";
64
	$l_error_timeoutfail = "Impossible de se connecter à la clé 3G. Timeout.";
54
	$l_error_timeoutfail = "Impossible de se connecter à la clé 3G. Timeout.";
65
	$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est elle présente?";
55
	$l_error_simfail = "Un problème au niveau de la carte SIM a été détecté. Est elle présente?";
66
	$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br>
56
	$l_error_simsecu_l = "Attention, lors du dernier démarrage, votre code PIN était erroné.<br>
67
					La SIM doit être bloqué (code PUK). Consultez la documentation.";
57
					La SIM doit être bloqué (code PUK). Consultez la documentation.";
68
	$l_autorefresh = "Rafraichissement : 30 sec";
58
	$l_autorefresh = "Rafraichissement : 30 sec";
Line 80... Line 70...
80
	$l_service_status_img_ko="Arrété";
70
	$l_service_status_img_ko="Arrété";
81
	
71
	
82
	$l_conf_name="Configuration : ";
72
	$l_conf_name="Configuration : ";
83
	$l_current_connect = "Connexion";
73
	$l_current_connect = "Connexion";
84
 
74
 
-
 
75
	$l_tab_first = "premier";
-
 
76
	$l_tab_last = "dernier";
-
 
77
	$l_tab_next = "suivant";
-
 
78
	$l_tab_prev = "précédent";
-
 
79
	$l_tab_search = "Recherche :";
-
 
80
	$l_tab_pmenu = "Affiche la page _PAGE_ sur _PAGES_";
-
 
81
	$l_tab_info = "Montrer _MENU_ résultat par page";
-
 
82
	$l_tab_infoempty = "Aucun résultat";
85
}
83
}
86
else {
84
else {
87
	$l_title = "Auto registration (SMS)";
85
	$l_title = "Auto registration (SMS)";
88
	$l_conf = "Configuration";
86
	$l_conf = "Configuration";
89
	$l_conf_actu = "Current configuration";
87
	$l_conf_actu = "Current configuration";
Line 93... Line 91...
93
	$l_time_account = "Time for a new session";
91
	$l_time_account = "Time for a new session";
94
	$l_time_perm = "Duration of a ban (for example, after X try)";
92
	$l_time_perm = "Duration of a ban (for example, after X try)";
95
	$l_status_gammu = "Service status";
93
	$l_status_gammu = "Service status";
96
	$l_start = "Start";
94
	$l_start = "Start";
97
	$l_status_device = "Status of your device";
95
	$l_status_device = "Status of your device";
98
	$l_key_diseable = "Your 3g key is not connected";
96
	$l_key_diseable = "No device detected";
99
	$l_key_enable = "Your 3g key is connected";
97
	$l_key_enable = "Your 3g key is connected";
100
	$l_force_signal = "Signal strength";
98
	$l_force_signal = "Signal strength";
101
	$l_imei_device = "Device IMEI";
99
	$l_imei_device = "Device IMEI";
102
	$l_sms_received = "Number of SMS received";
100
	$l_sms_received = "Number of SMS received";
103
	$l_stop = "Stop";
101
	$l_stop = "Stop";
Line 106... Line 104...
106
	$l_edit = "Edit";
104
	$l_edit = "Edit";
107
	$l_error_label_empty = "Field empty";
105
	$l_error_label_empty = "Field empty";
108
	$l_error_label_num = "It's not a valid PIN password";
106
	$l_error_label_num = "It's not a valid PIN password";
109
	$l_error_label_num2 = "It's not a number";
107
	$l_error_label_num2 = "It's not a number";
110
	$l_error_label_num3 = "The phone number is not good: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
108
	$l_error_label_num3 = "The phone number is not good: +xxxYYYYYYYYY (xxx: code pays / YYYYYYYYY: numéro de téléphone)";
111
	$l_error_writefail = "Gammu semble ne pas parvenir à discuter avec la clé (port ttyUSB0).";
-
 
112
	$l_error_writefail = "Gammu can't listen the ttyUSB0 port.";
109
	$l_error_writefail = "Can not listen the ttyUSB0 port.";
113
	$l_error_timeoutfail = "Timeout. Can not connect to modem.";
110
	$l_error_timeoutfail = "Timeout. Can not connect to modem.";
114
	$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?";
111
	$l_error_simfail = "An issue with your Sim card was detected. Is it in the key?";
115
	$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br>
112
	$l_error_simsecu_l = "Warning, during the last startup, the PIN code was wrong. <br>
116
				The Sim card must be blocked. Please read the documentation.";
113
				The Sim card must be blocked. Please read the documentation.";
117
	$l_autorefresh = "Refresh : 30 sec";
114
	$l_autorefresh = "Refresh : 30 sec";
Line 128... Line 125...
128
	$l_service_status_img_ok="Running";
125
	$l_service_status_img_ok="Running";
129
	$l_service_status_img_ko="Stopped";
126
	$l_service_status_img_ko="Stopped";
130
	
127
	
131
	$l_conf_name="Configuration : ";
128
	$l_conf_name="Configuration : ";
132
	$l_current_connect = "Connection";
129
	$l_current_connect = "Connection";
-
 
130
	
-
 
131
	$l_tab_first = "first";
-
 
132
	$l_tab_last = "last";
-
 
133
	$l_tab_next = "next";
-
 
134
	$l_tab_prev = "previous";
-
 
135
	$l_tab_search = "Search :";
-
 
136
	$l_tab_pmenu = "Showing _PAGE_ to _PAGE_ of _PAGE_ entries :";
-
 
137
	$l_tab_info = "Show _MENU_ entries";
-
 
138
	$l_tab_infoempty = "No matching records found";
133
}
139
}
-
 
140
?>
-
 
141
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
 
142
<HTML><!-- written by Rexy -->
-
 
143
<head>
-
 
144
<META HTTP-EQUIV="Refresh" CONTENT="30">
-
 
145
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
-
 
146
<title>Auto enregistrement</title>
-
 
147
<link rel="stylesheet" href="/css/style.css">
-
 
148
<!-- DataTables CSS -->
-
 
149
<link rel="stylesheet" type="text/css" href="../../../css/jquery.dataTables.css">
-
 
150
<!-- jQuery -->
-
 
151
<script type="text/javascript" charset="utf8" src="../../../js/jquery.js"></script>
-
 
152
<!-- DataTables -->
-
 
153
<script type="text/javascript" charset="utf8" src="../../../js/jquery.dataTables.js"></script>
-
 
154
<script type="text/javascript">
-
 
155
$(document).ready( function () {
-
 
156
    $('#table_id').DataTable({
-
 
157
		"language": {
-
 
158
			"paginate": {
-
 
159
			"sFirst": "<?php echo $l_tab_dirst; ?>",
-
 
160
			"sLast": "<?php echo $l_tab_last; ?>",
-
 
161
			"sPrevious": "<?php echo $l_tab_prev; ?>",
-
 
162
			"sNext": "<?php echo $l_tab_next; ?>"
-
 
163
			},
-
 
164
            "lengthMenu": "<?php echo $l_tab_info; ?>",
-
 
165
            "zeroRecords": "<?php echo $l_tab_infoempty; ?>",
-
 
166
            "info": "<?php echo $l_tab_pmenu; ?>",
-
 
167
            "infoEmpty": "<?php echo $l_tab_infoempty; ?>",
-
 
168
			"sSearch": "<?php echo $l_tab_search; ?>"
-
 
169
        }
-
 
170
	});
-
 
171
} );
-
 
172
</script>
-
 
173
</head>
-
 
174
<body>
-
 
175
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
-
 
176
<?php
134
echo "
177
echo "
135
	<tr>
178
	<tr>
136
		<th>$l_title</th>
179
		<th>$l_title</th>
137
	</tr>
180
	</tr>
138
	<tr bgcolor=\"#FFCC66\">
181
	<tr bgcolor=\"#FFCC66\">
Line 222... Line 265...
222
}
265
}
223
 
266
 
224
if ($status_key=="true")
267
if ($status_key=="true")
225
{
268
{
226
	#Nom du fichier de log lorsque gammu est démarré
269
	#Nom du fichier de log lorsque gammu est démarré
227
	$file_log = "gammu-smsd.log";
270
	#$file_log = "gammu-smsd.log";
228
 
271
 
229
	#Recuperation du code PIN actuel
272
	#Recuperation du code PIN actuel
230
	$current_pin = exec("sudo $script --pin");	
273
	$current_pin = exec("sudo $script --pin");	
231
	
274
	
232
	#Recuperation du nombre de try avant le ban perm
275
	#Recuperation du nombre de try avant le ban perm
Line 236... Line 279...
236
	$current_time_account = exec("sudo $script --time_account");	
279
	$current_time_account = exec("sudo $script --time_account");	
237
 
280
 
238
	#Recuperation de la durée dun ban perm (après flood)
281
	#Recuperation de la durée dun ban perm (après flood)
239
	$current_time_perm = exec("sudo $script --time_perm");	
282
	$current_time_perm = exec("sudo $script --time_perm");	
240
 
283
 
241
	#Recuperation de l'adresse du log
-
 
242
	$current_log = exec("sudo $script --log");
-
 
243
 
-
 
244
	#Detection neméro de tel
284
	#Detection neméro de tel
245
	$current_num_alcasar = exec("sudo $script --numero_alcasar");
285
	$current_num_alcasar = exec("sudo $script --numero_alcasar");
246
	
286
	
247
	#Detection problème avec la SIM
287
	#Detection problème avec la SIM
248
	$current_simfail = exec("sudo $script --last_nosim");
288
	$current_simfail = exec("sudo $script --last_nosim");
Line 268... Line 308...
268
		$force_signal = "-";
308
		$force_signal = "-";
269
		$imei_device = "-";
309
		$imei_device = "-";
270
		$sms_received = "-";
310
		$sms_received = "-";
271
 
311
 
272
		$gammu="<td><img src=\"/images/state_error.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ko."\"></td><td>$l_gammu_off</td>";	
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>";	
273
		$gammu_log="";
-
 
274
		$gammu_status_on="";
313
		$gammu_status_on="";
275
		$gammu_status_off="disabled";
314
		$gammu_status_off="disabled";
276
 
315
 
277
		if($current_last_secu!="")
316
		if($current_last_secu!="")
278
		{
317
		{
Line 306... Line 345...
306
 
345
 
307
 
346
 
308
 
347
 
309
 
348
 
310
		$gammu="<td><img src=\"/images/state_ok.gif\" width=\"15\" height=\"15\" alt=\"".$l_service_status_img_ok."\"></td><td>$l_gammu_on</td>";	
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>";	
311
		$gammu_log="<tr><td colspan=7>$current_log</td></tr>";
-
 
312
		
350
				
313
		
351
		
314
		if($current_last_timeout!=""){
352
		if($current_last_timeout!=""){
315
			if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop))
353
			if(($current_last_timeout > $current_last_start) && ($current_last_timeout > $current_last_stop))
316
			{
354
			{
317
				$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>";	
355
				$gammu_timeout="<tr><td colspan=7><font color=red>$l_error_timeoutfail</font></td></tr>";	
Line 516... Line 554...
516
	#Si une clé 3g est plugué
554
	#Si une clé 3g est plugué
517
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
555
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
518
			
556
			
519
		<table border=1>
557
		<table border=1>
520
		<tr>
558
		<tr>
521
		<td colspan=4><b>$l_status_gammu</b></td>
559
			<td colspan=4><b>$l_status_gammu</b></td>
522
		<td><b><center>$l_force_signal</center></b></td>
560
			<td><b><center>$l_force_signal</center></b></td>
523
		<td><b><center>$l_imei_device</center></b></td> 
561
			<td><b><center>$l_imei_device</center></b></td> 
524
		<td><b><center>$l_sms_received</center></b></td> 
562
			<td><b><center>$l_sms_received</center></b></td> 
525
		</tr>
563
		</tr>
526
		<tr>
564
		<tr>
527
		$gammu
565
			$gammu
528
		<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td>		
566
			<td><button type=\"submit\" name=\"start\" $gammu_status_on>$l_start</button></td>		
529
		<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td>
567
			<td><button type=\"submit\" name=\"stop\" $gammu_status_off>$l_stop</button></td>
530
		<td><center>$force_signal</center></td>
568
			<td><center>$force_signal</center></td>
531
		<td><center>$imei_device</center></td>
569
			<td><center>$imei_device</center></td>
532
		<td><center>$sms_received</center></td>
570
			<td><center>$sms_received</center></td>
533
		</tr>
571
		</tr>
534
		$gammu_log
-
 
535
		$gammu_puk
572
		$gammu_puk
536
		$gammu_simfail
573
		$gammu_simfail
537
		$gammu_simsecu
574
		$gammu_simsecu
538
		$gammu_timeout
575
		$gammu_timeout
539
		$gammu_writeerror
576
		$gammu_writeerror
Line 603... Line 640...
603
		echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
640
		echo "Fail to connect to $config[sql_type]" . mysqli_connect_error();
604
	}
641
	}
605
 
642
 
606
	$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm");
643
	$result = mysqli_query($con, "SELECT * FROM SMS_ban_perm");
607
 
644
 
-
 
645
?>
608
		echo "	<br />
646
	<table id="table_id" class="display">
609
			<table border =1>
647
		<thead>
610
			<tr>
648
			<tr>
-
 
649
				<th><b><font color="black"><?php echo $l_num_num; ?></font></b></th>
-
 
650
				<th><b><font color="black"><?php echo $l_num_raison; ?></font></b></th>
-
 
651
				<th><b><font color="black"><?php echo $l_num_expiration; ?></font></b></th>
611
		<td colspan=4><b>$l_num_block</b></td>
652
				<th><b><font color="black">Action</font></b></th>
612
 
-
 
613
			</tr>
653
			</tr>
614
			<tr>
654
		</thead>
615
			<td><b>$l_num_num</b></td>
655
		<tbody>
616
			<td><b>$l_num_raison</b></td>
-
 
617
			<td><b>$l_num_expiration</b></td>
-
 
618
			<td><b>$l_num_action</b></td>
-
 
619
			</tr>";
656
	<?php 
620
 
-
 
621
	while($row = mysqli_fetch_array($result))
657
	while($row = mysqli_fetch_array($result))
622
	{
658
	{
623
		echo "	
659
		echo "	
624
			<form action=\"autoregistration.php\" methode=\"POST\">
-
 
625
			<tr>
660
			<tr>
-
 
661
			<form action=\"autoregistration.php\" methode=\"POST\">
626
			<td>
662
			<td>
627
				<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\">	
663
				<input type=\"hidden\" name=\"num_select\" value=\"" .$row['SenderNumber']."\">	
628
			" . $row['SenderNumber'] . "</td>";
664
				".$row['SenderNumber']."
-
 
665
			</td>";
629
		
666
		
630
		if($row['Perm']=='0')
667
		if($row['Perm']=='0')
631
		{
668
		{
632
			echo "<td>$l_num_exist</td>";
669
			echo "<td>$l_num_exist</td>";
633
		}
670
		}
634
		if($row['Perm']=='1')
671
		if($row['Perm']=='1')
635
		{
672
		{
636
			echo "<td>$l_num_flood</td>";
673
			echo "<td>$l_num_flood</td>";
637
		}
674
		}
638
		echo "	<td>" . $row['Expiration']. "</td>
675
		echo "	<td>" . $row['Expiration']. "</td>
639
			
-
 
640
			<td>
676
				<td>
641
			<input type='submit' value='".$l_num_unlock."'>
677
					<input type='submit' value='".$l_num_unlock."'>
642
			</td>
678
				</td>
643
			</form>	
679
				</form>
644
			</tr>";
680
			</tr>
-
 
681
			";
645
	}
682
	}
-
 
683
	?>
-
 
684
		</tbody>
646
	echo "</table>";
685
	</table>
647
 
686
<?php
648
	mysqli_close($con);
687
	mysqli_close($con);
649
	
-
 
650
	}
688
	}
651
	
-
 
652
?>
689
?>
653
 
-
 
654
</html>
690
</html>