Subversion Repositories ALCASAR

Rev

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

Rev 2164 Rev 2207
Line 1... Line 1...
1
<?php
1
<?php
-
 
2
# $Id: index.php 2207 2017-05-06 18:10:53Z tom.houdayer $
-
 
3
#
2
# change user password on ALACASAR NAC
4
# change user password on ALACASAR NAC
3
# Copyright (C) 2003, 2004 Mondru AB.
5
# Copyright (C) 2003, 2004 Mondru AB.
4
# Copyright (C) 2008-20017 ANGEL95 & REXY
6
# Copyright (C) 2008-20017 ANGEL95 & REXY
5
 
7
 
-
 
8
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
-
 
9
 
-
 
10
// Read CONF_FILE
-
 
11
$file_conf = fopen(CONF_FILE, 'r');
-
 
12
if (!$file_conf) {
-
 
13
	exit('Error opening the file '.CONF_FILE);
-
 
14
}
-
 
15
while (!feof($file_conf)) {
-
 
16
	$tampon = fgets($file_conf, 4096);
-
 
17
	if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) {
-
 
18
		$tmp = explode('=', $tampon);
-
 
19
		$conf[$tmp[0]] = trim($tmp[1]);
-
 
20
	}
-
 
21
}
-
 
22
fclose($file_conf);
-
 
23
 
6
require('/etc/freeradius-web/config.php');
24
require('/etc/freeradius-web/config.php');
7
 
25
 
8
$current_page = htmlspecialchars($_SERVER['PHP_SELF']);
26
$current_page = htmlspecialchars($_SERVER['PHP_SELF']);
-
 
27
$homepage = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')) ? 'https' : 'http').'://'.trim($conf['HOSTNAME']).'.'.trim($conf['DOMAIN']);
9
 
28
 
10
# Choice of language
29
# Choice of language
11
$Language = 'en';
30
$Language = 'en';
12
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
31
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
32
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
Line 182... Line 201...
182
								<td><input type=\"password\" name=\"newpasswd2\" value=\"\"></td>
201
								<td><input type=\"password\" name=\"newpasswd2\" value=\"\"></td>
183
							</tr>
202
							</tr>
184
							<tr>
203
							<tr>
185
								<td colspan=\"2\" id=\"lien_pass\">
204
								<td colspan=\"2\" id=\"lien_pass\">
186
								<input type=\"submit\" class=\"btn_form\" id=\"btn_pass\" value=\"$R_form_button_valid\">
205
								<input type=\"submit\" class=\"btn_form\" id=\"btn_pass\" value=\"$R_form_button_valid\">
187
								<input type=\"button\" class=\"btn_form\" id=\"btn_retour\" value=\"$R_form_button_retour\" onclick=\"location.replace('http://alcasar');\">
206
								<input type=\"button\" class=\"btn_form\" id=\"btn_retour\" value=\"$R_form_button_retour\" onclick=\"location.replace('$homepage');\">
188
								</td>
207
								</td>
189
							</tr>
208
							</tr>
190
						</table>
209
						</table>
191
				</div>
210
				</div>
192
			</div>
211
			</div>