Subversion Repositories ALCASAR

Rev

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

Rev 2134 Rev 2137
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: status.php 2134 2017-03-12 19:53:15Z richard $
2
# $Id: status.php 2137 2017-03-18 13:18:02Z richard $
3
#
3
#
4
# status.php for Alcasar captive portal
4
# status.php for Alcasar captive portal
5
# by steweb57 & Rexy
5
# by steweb57 & Rexy
6
# 
6
# 
7
/****************************************************************
7
/****************************************************************
Line 287... Line 287...
287
				if ($a_connected > 1){
287
				if ($a_connected > 1){
288
					$a_connection = $l_a_connection." ".$a_connected." ".$l_a_connection_time; }
288
					$a_connection = $l_a_connection." ".$a_connected." ".$l_a_connection_time; }
289
			}
289
			}
290
		}
290
		}
291
// Retrieve first name & last name
291
// Retrieve first name & last name
292
//		$search = $login; $search_IN = 'username'; // is user in database ?
292
		$sql = "SELECT Name FROM userinfo WHERE UserName='$user[5]'";
293
//		if (is_file("../lib/sql/find.php"))
293
		$link = @da_sql_pconnect($config);
294
//			include("../lib/sql/find.php");
294
		if ($link){
295
//		if (isset ($found_users)) // user is in database
295
			$res = @da_sql_query($link,$config,$sql);
296
//		{
296
			if ($res){
297
//			if (is_file("../lib/sql/user_info.php")) //retrieve user info (especialy $cn)
297
				$row = @da_sql_fetch_array($res,$config);
298
//				include("../lib/sql/user_info.php");
298
				$cn = ($row['name'] != '') ? $row['name'] : $user[5];
299
//		}
299
			}
300
//		if (! isset ($cn)){ $cn='-';}
300
		}
301
//store the user @IP in a file (to test if he is still active).
301
//store the user @IP in a file (to test if he is still active).
302
		$filename='/var/tmp/havp/current_users.txt';
302
		$filename='/var/tmp/havp/current_users.txt';
303
		$change_me = 1; //avoid duplicate user @IP
303
		$change_me = 1; //avoid duplicate user @IP
304
		if(file_exists($filename)){
304
		if(file_exists($filename)){
305
			$fichier = fopen($filename, "r");
305
			$fichier = fopen($filename, "r");
306
			$content = file($filename);
306
			$content = file($filename);
307
			if(empty($content))
307
			if (empty($content))
308
			{
308
			{
309
				file_put_contents($filename, $_SERVER['REMOTE_ADDR']);
309
				file_put_contents($filename, $_SERVER['REMOTE_ADDR']);
310
			}
310
			}
311
			else
311
			else
312
			{
312
			{
Line 332... Line 332...
332
		}
332
		}
333
	}
333
	}
334
}
334
}
335
?>
335
?>
336
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
336
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
337
<html lang="fr">
337
<html>
338
<!-- written by steweb57 -->
338
<!-- written by steweb57 & Rexy -->
339
	<head>
339
	<head>
340
		<title>Alcasar - <?php echo $organisme; ?></title>
340
		<title>Alcasar - <?php echo $organisme; ?></title>
341
		<meta http-equiv="Cache-control" content="no-cache">
341
		<meta http-equiv="Cache-control" content="no-cache">
342
		<meta http-equiv="Pragma" content="no-cache">
342
		<meta http-equiv="Pragma" content="no-cache">
343
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
343
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Line 370... Line 370...
370
									<?php echo $l_login1; ?>
370
									<?php echo $l_login1; ?>
371
								</td>
371
								</td>
372
							</tr>
372
							</tr>
373
							<tr>
373
							<tr>
374
								<td class="text_auth">
374
								<td class="text_auth">
375
									<?php echo $l_welcome; ?>
375
									<?php echo "$l_welcome <br> $cn";?>
376
									<br><span id="userName"></span>
-
 
377
								</td>
376
								</td>
378
							</tr>
377
							</tr>
379
							<tr>
378
							<tr>
380
								<td class="alert">
379
								<td class="alert">
381
									<?php if(isset($a_connection))echo $a_connection; ?>
380
									<?php if(isset($a_connection))echo $a_connection; ?>