Subversion Repositories ALCASAR

Rev

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

Rev 1345 Rev 1426
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 1345 2014-05-10 10:24:39Z richard $
2
# $Id: index.php 1426 2014-09-11 20:11:25Z 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 280... Line 280...
280
			<div id="box_url">
280
			<div id="box_url">
281
<?php 
281
<?php 
282
//search in the blacklist categories
282
//search in the blacklist categories
283
if ((! $direct_access) && (! $network_pb)){
283
if ((! $direct_access) && (! $network_pb)){
284
	$pattern = preg_replace('/www./','',$_SERVER['HTTP_HOST']);
284
	$pattern = preg_replace('/www./','',$_SERVER['HTTP_HOST']);
-
 
285
 	$pattern = filter_var($pattern, FILTER_VALIDATE_URL) == false ? "" : $pattern;
285
	exec("grep -Re ^$pattern$ /etc/dansguardian/lists/blacklists/*/domains|cut -d'/' -f6", $output);
286
	exec("grep -Re ^$pattern$ /etc/dansguardian/lists/blacklists/*/domains|cut -d'/' -f6", $output);
286
	unset ($line);
287
	unset ($line);
287
	foreach ($output as $row) {
288
	foreach ($output as $row) {
288
		$line=$line.(trim($row)).", ";
289
		$line=$line.(trim($row)).", ";
289
	} 
290
	}