Subversion Repositories ALCASAR

Rev

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

Rev 1295 Rev 1298
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 1295 2014-01-13 12:31:04Z richard $
2
# $Id: index.php 1298 2014-01-13 22:17:38Z richard $
3
#
3
#
4
# index.php for ALCASAR captive portal
4
# index.php for ALCASAR captive portal
5
# by REXY
5
# by REXY
6
# UI & css style by stephane ERARD
6
# UI & css style by stephane ERARD
7
# The contents of this file may be used under the terms of the GNU
7
# The contents of this file may be used under the terms of the GNU
Line 40... Line 40...
40
	}
40
	}
41
}else{
41
}else{
42
	exit("Error opening the file ".CONF_FILE);
42
	exit("Error opening the file ".CONF_FILE);
43
}
43
}
44
fclose($ouvre);
44
fclose($ouvre);
45
$hostname = alcasar.$conf["DOMAIN"];
45
$hostname = alcasar.".".$conf["DOMAIN"];
46
$network_pb = False;
46
$network_pb = False;
47
$cert_add = "http://$hostname/certs";
47
$cert_add = "http://$hostname/certs";
48
$direct_access = False;
48
$direct_access = False;
49
$diagnostic = "can't contact the default router";
49
$diagnostic = "can't contact the default router";
50
$remote_ip = ($_SERVER['REMOTE_ADDR']);
50
$remote_ip = ($_SERVER['REMOTE_ADDR']);
Line 278... Line 278...
278
			<div id="box_url">
278
			<div id="box_url">
279
<?php 
279
<?php 
280
//search in the blacklist categories
280
//search in the blacklist categories
281
if ((! $direct_access) && (! $network_pb)){
281
if ((! $direct_access) && (! $network_pb)){
282
	$pattern = preg_replace('/www./','',$_SERVER['HTTP_HOST']);
282
	$pattern = preg_replace('/www./','',$_SERVER['HTTP_HOST']);
283
	exec("grep -Re ^$pattern /etc/dansguardian/lists/blacklists/*/domains|cut -d'/' -f6", $output);
283
	exec("grep -Re ^$pattern$ /etc/dansguardian/lists/blacklists/*/domains|cut -d'/' -f6", $output);
284
	unset ($line);
284
	unset ($line);
285
	foreach ($output as $row) {
285
	foreach ($output as $row) {
286
		$line=$line.(trim($row)).", ";
286
		$line=$line.(trim($row)).", ";
287
	} 
287
	} 
288
	echo "$l_required_domain : $_SERVER[HTTP_HOST]";
288
	echo "$l_required_domain : $_SERVER[HTTP_HOST]";