Subversion Repositories ALCASAR

Rev

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

Rev 2809 Rev 2822
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: autoregistrationinfo.php 2809 2020-04-12 17:35:46Z rexy $
2
# $Id: autoregistrationinfo.php 2822 2020-05-23 16:03:33Z rexy $
-
 
3
#
-
 
4
# SMS Autoregistration
-
 
5
# By Rexy
3
 
6
 
4
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
7
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
5
 
8
 
6
// Read CONF_FILE
9
// Read CONF_FILE
7
$file_conf = fopen(CONF_FILE, 'r');
10
$file_conf = fopen(CONF_FILE, 'r');
Line 20... Line 23...
20
// Check if the SMS service is enable
23
// Check if the SMS service is enable
21
if ($conf['SMS'] !== 'on') {
24
if ($conf['SMS'] !== 'on') {
22
	header('Location: /');
25
	header('Location: /');
23
	exit();
26
	exit();
24
}
27
}
25
 
-
 
26
$organisme   = $conf['ORGANISM'];
28
$organisme   = $conf['ORGANISM'];
27
$current_num = $conf['SMS_NUM'];
29
$current_num = $conf['SMS_NUM'];
28
 
30
 
29
 
31
 
30
// Choice of language
32
// Choice of language
Line 85... Line 87...
85
	$l_autorefresh		= "Refresh: 10 sec";
87
	$l_autorefresh		= "Refresh: 10 sec";
86
}
88
}
87
 
89
 
88
// Get SMS from database
90
// Get SMS from database
89
require('/etc/freeradius-web/config.php');
91
require('/etc/freeradius-web/config.php');
-
 
92
$img_rep         = '/images/';
-
 
93
$img_sms         = 'sms.png';
90
 
94
 
91
$con = mysqli_connect($config['sql_server'], $config['sql_username'], $config['sql_password'], 'gammu');
95
$con = mysqli_connect($config['sql_server'], $config['sql_username'], $config['sql_password'], 'gammu');
92
 
96
 
93
if (mysqli_connect_errno()) {
97
if (mysqli_connect_errno()) {
94
	exit('Failed to connect to ' . $config['sql_type']/* . ': ' . mysqli_connect_error()*/);
98
	exit('Failed to connect to ' . $config['sql_type']/* . ': ' . mysqli_connect_error()*/);
Line 109... Line 113...
109
?>
113
?>
110
<!DOCTYPE html>
114
<!DOCTYPE html>
111
<html><!-- written by Rexy -->
115
<html><!-- written by Rexy -->
112
<head>
116
<head>
113
	<meta charset="utf-8">
117
	<meta charset="utf-8">
-
 
118
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
114
	<title>Auto enregistrement</title>
119
	<title>ALCASAR - <?= $l_title ?></title>
115
	<link rel="stylesheet" type="text/css" href="/css/error.css">
120
	<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
116
	<!-- DataTables CSS -->
121
	<link rel="stylesheet" type="text/css" href="/css/index.css">
117
	<link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.css">
122
	<link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.css">
118
	<!-- jQuery -->
-
 
119
	<script charset="utf8" src="/js/jquery.min.js"></script>
123
	<script src="/js/jquery.min.js"></script>
120
	<!-- DataTables -->
-
 
121
	<script charset="utf8" src="/js/jquery.dataTables.js"></script>
124
	<script src="/js/jquery.dataTables.js"></script>
122
	<script>
125
	<script>
123
	function timedRefresh(timeoutPeriod) {
126
	function timedRefresh(timeoutPeriod) {
124
		var interval = setInterval(refreshPage, timeoutPeriod);
127
		var interval = setInterval(refreshPage, timeoutPeriod);
125
	}
128
	}
126
 
129
 
Line 148... Line 151...
148
		});
151
		});
149
	});
152
	});
150
	</script>
153
	</script>
151
</head>
154
</head>
152
<body onload="timedRefresh(10000);">
155
<body onload="timedRefresh(10000);">
153
	<center>
-
 
154
	<div id="logon">
156
	<div class="col-xs-12 col-md-10 col-md-offset-1"> 
155
		<h1><?= $organisme ?></h1>
157
		<!-- HeaderBox -->
156
		<h2><?= $l_title ?></h2>
158
		<div class="row banner">
157
 
-
 
158
		<div>
159
			<!-- Logo box -->
159
		<table id="boite-info">
160
			<div class="img_banner hidden-xs col-sm-3 col-md-2 col-lg-2"> 
160
			<tr>
-
 
161
				<td rowspan="6" width="30%"><img id="logo-organ" src="/images/organisme.png"></td>
161
				<img class="img-responsive img-organisme" src="images/organisme.png">
162
			</tr>
162
			</div>
163
			<tr>
-
 
164
				<td><?= $l_tuto_1 ?></td>
-
 
165
			</tr>
163
			<!-- Title -->
166
			<tr>
-
 
167
				<td><?= $l_tuto_2 ?></td>
164
			<div id="cadre_titre" class="titre_banner col-xs-12 col-sm-8">
168
			</tr>
-
 
169
			<tr>
-
 
170
				<td align="center"><h3><?= $current_num ?></h3></td>
165
					<p id="acces_controle" class="titre_controle"><?= $l_title ?></p>
171
			</tr>
166
			</div>
172
			<tr>
-
 
173
				<td><?= $l_tuto_3 ?></td>
167
			<!-- Logo box -->
174
			</tr>
-
 
175
			<tr>
-
 
176
				<td><?= $l_tuto_4 ?></td>
168
			<div class="img_banner hidden-xs col-sm-3 col-md-2 col-lg-2">
177
			</tr>
-
 
178
<!--
-
 
179
			<tr>
-
 
180
				<td colspan="2"><?= $l_tuto_5 ?></td>
169
				<img class="img-responsive img-organisme" src="images/logo-alcasar_70.png">
181
			</tr>
170
			</div>
182
-->
-
 
183
		</table>
-
 
184
		</div>
171
		</div>
185
 
-
 
-
 
172
		<!-- Main content box -->
186
		<div>
173
		<div class="row">
187
		<label><input type="checkbox" checked="checked" name="autoRefreshCheckboxes"><?= $l_autorefresh ?></label>
174
			<div id="contenu_acces" class="col-xs-12 col-lg-offset-1 col-lg-10">
-
 
175
				<h3><?= $l_tuto_2 ?></h3>
-
 
176
				<div class="menu-container container col_xs_12 col-sm-7">
188
		<table id="table_id" class="display">
177
					<div class="box_menu_right box_menu">
-
 
178
						<span><?= $current_num ?></span>
-
 
179
						<div class="menu-image">						
-
 
180
							<img class="img-responsive" src="<?= $img_rep.$img_sms ?>">
189
			<thead>
181
						</div>
-
 
182
					</div>
190
				<tr>
183
				</div>
191
					<th><b><?= $l_num_num ?></b></th>
184
				<div class="info-box-container col-sm-5">
192
					<th><b><?= $l_num_raison ?></b></th>
185
					<div id="box_infos">
193
					<th><b><?= $l_num_expiration ?></b></th>
186
						<p class="box_infos_explanations"><?= $l_tuto_3 ?>
-
 
187
					</div>
194
				</tr>
188
				</div>
195
			</thead>
189
			</div>
196
			<tbody>
190
		</div>
-
 
191
	<p>
-
 
192
		<div class="row">
-
 
193
			<div id="contenu_acces" class="col-xs-12 col-lg-offset-1 col-lg-10">
-
 
194
				<h4><?= $l_tuto_4 ?></h4>
-
 
195
				<h4><?= $l_tuto_5 ?></h4>
-
 
196
				<label><input type="checkbox" checked="checked" name="autoRefreshCheckboxes"><?= $l_autorefresh ?></label>
197
				<?php foreach ($smsBanPerms as $smsBanPerm): ?>
197
				<table id="table_id" class="display">
-
 
198
				<thead>
198
					<tr>
199
					<tr>
-
 
200
						<th><b><?= $l_num_num ?></b></th>
-
 
201
						<th><b><?= $l_num_raison ?></b></th>
-
 
202
						<th><b><?= $l_num_expiration ?></b></th>
-
 
203
					</tr>
-
 
204
				</thead>
-
 
205
				<tbody>
-
 
206
					<?php foreach ($smsBanPerms as $smsBanPerm): ?>
-
 
207
						<tr>
199
						<td><?= $smsBanPerm->numberHidden ?></td>
208
							<td><?= $smsBanPerm->numberHidden ?></td>
200
 
-
 
201
						<?php if ($smsBanPerm->perm == '0'): ?>
209
							<?php if ($smsBanPerm->perm == '0'): ?>
202
							<td><?= $l_num_exist ?></td>
210
							<td><?= $l_num_exist ?></td>
203
						<?php elseif ($smsBanPerm->perm == '1'): ?>
211
							<?php elseif ($smsBanPerm->perm == '1'): ?>
204
							<td><?= $l_num_flood ?></td>
212
							<td><?= $l_num_flood ?></td>
205
						<?php endif ?>
213
							<?php endif ?>
206
 
-
 
207
						<td><?= $smsBanPerm->expiration ?></td>
214
							<td><?= $smsBanPerm->expiration ?></td>
208
					</tr>
215
						</tr>
209
				<?php endforeach; ?>
216
					<?php endforeach; ?>
210
			</tbody>
217
				</tbody>
211
		</table>
218
				</table>
-
 
219
			</div>
212
		</div>
220
		</div>
213
	</div>
221
	</div>
214
	</center>
-
 
215
</body>
222
</body>
216
</html>
223
</html>