Subversion Repositories ALCASAR

Rev

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

Rev 2370 Rev 2377
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: status.php 2370 2017-08-09 23:20:58Z tom.houdayer $
2
# $Id: status.php 2377 2017-08-16 18:51:18Z tom.houdayer $
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 317... Line 317...
317
		if (file_exists($filename)) {
317
		if (file_exists($filename)) {
318
			$current_users_file = fopen($filename, 'r');
318
			$current_users_file = fopen($filename, 'r');
319
			$content = file($filename);
319
			$content = file($filename);
320
			fclose($current_users_file);
320
			fclose($current_users_file);
321
			if (empty($content)) {
321
			if (empty($content)) {
322
				file_put_contents($filename, $_SERVER['REMOTE_ADDR']);
322
				file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL);
323
			} else {
323
			} else {
324
				$change_me = 1; // avoid duplicate user @IP
324
				$change_me = 1; // avoid duplicate user @IP
325
				// if we found duplicate IP, we will not write user @IP (just set change_me = 0)
325
				// if we found duplicate IP, we will not write user @IP (just set change_me = 0)
326
				foreach ($content as $line) {
326
				foreach ($content as $line) {
327
				        $line = preg_replace('/\s+/', '', $line);
327
				        $line = preg_replace('/\s+/', '', $line);