mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 10:52:57 +02:00
Captive-Portal: add web-part
Introduce new Captive-Portal. Here we add the menu, apache configuration (vhost), IPFire configuration website and Captive-Portal Access site. Also the languagefiles are updated. Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
cec16b8242
commit
8b92078917
76
html/html/captive/assets/captive.css
Normal file
76
html/html/captive/assets/captive.css
Normal file
@@ -0,0 +1,76 @@
|
||||
h1{
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
background-image: url("internet.png");
|
||||
background-size: cover; /* <------ */
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
.title{
|
||||
position: relative;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #FFF;
|
||||
width: 40em;
|
||||
height: 6em;
|
||||
left: 1em;
|
||||
top: 2em;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
padding-top: 0,5em;
|
||||
opacity: 0.9;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
box-shadow: 1px 2px 4px rgba(0,0,0,.4);
|
||||
}
|
||||
|
||||
.login{
|
||||
position: relative;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #FFF;
|
||||
width: 40em;
|
||||
left: 1em;
|
||||
top: 2em;
|
||||
margin-top: 0,2em;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
padding-top: 1em;
|
||||
text-align: left;
|
||||
font-family: sans-serif;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
box-shadow: 1px 2px 4px rgba(0,0,0,.4);
|
||||
}
|
||||
|
||||
.agb{
|
||||
position: relative;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #FFF;
|
||||
width: 40em;
|
||||
left: 1em;
|
||||
top: 2em;
|
||||
margin-top: 0,2em;
|
||||
padding-left: 2em;
|
||||
padding-right: 2em;
|
||||
padding-top: 1em;
|
||||
text-align: left;
|
||||
font-family: sans-serif;
|
||||
opacity: 0.9;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
box-shadow: 1px 2px 4px rgba(0,0,0,.4);
|
||||
}
|
||||
|
||||
#agbtext{
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
resize: none;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
BIN
html/html/captive/assets/favicon.ico
Normal file
BIN
html/html/captive/assets/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
BIN
html/html/captive/assets/internet.png
Normal file
BIN
html/html/captive/assets/internet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 MiB |
66
html/html/captive/index.cgi
Executable file
66
html/html/captive/index.cgi
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/perl
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2016 Alexander Marx alexander.marx@ipfire.org #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
use strict;
|
||||
use URI::Escape;
|
||||
use CGI::Carp qw(fatalsToBrowser);
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
|
||||
my $url = "http://$ENV{'SERVER_NAME'}$ENV{'REQUEST_URI'}";
|
||||
my $safe_url = uri_escape($url);
|
||||
my $settings="${General::swroot}/captive/settings";
|
||||
my $ethernet="${General::swroot}/ethernet/settings";
|
||||
my %settingshash=();
|
||||
my %ethernethash=();
|
||||
my $green_ip;
|
||||
my $green_mask;
|
||||
my $blue_ip;
|
||||
my $blue_mask;
|
||||
my $target;
|
||||
#Read settings
|
||||
&General::readhash("$settings", \%settingshash) if(-f $settings);
|
||||
&General::readhash("$ethernet", \%ethernethash) if(-f $ethernet);
|
||||
|
||||
#Get Clients IP-Address
|
||||
my $ip_address = $ENV{X_FORWARDED_FOR} || $ENV{REMOTE_ADDR} ||"";
|
||||
|
||||
if($settingshash{'ENABLE_GREEN'} eq "on" && $ethernethash{'GREEN_ADDRESS'} ne ''){
|
||||
$green_ip=$ethernethash{'GREEN_ADDRESS'};
|
||||
$green_mask=$ethernethash{'GREEN_NETMASK'};
|
||||
|
||||
if (&General::IpInSubnet($ip_address,$ethernethash{'GREEN_ADDRESS'},$ethernethash{'GREEN_NETMASK'})){
|
||||
$target = $green_ip;
|
||||
}
|
||||
}elsif($settingshash{'ENABLE_BLUE'} eq "on" &&$ethernethash{'BLUE_ADDRESS'} ne '' ){
|
||||
$blue_ip=$ethernethash{'BLUE_ADDRESS'};
|
||||
$blue_mask=$ethernethash{'BLUE_NETMASK'};
|
||||
|
||||
if (&General::IpInSubnet($ip_address,$ethernethash{'BLUE_ADDRESS'},$ethernethash{'BLUE_NETMASK'})){
|
||||
$target = $blue_ip;
|
||||
}
|
||||
}else{
|
||||
exit 0;
|
||||
}
|
||||
|
||||
print "Status: 302 Moved Temporarily\n";
|
||||
print "Location: http://$target:1013/cgi-bin/index.cgi?redirect=$safe_url\n";
|
||||
print "Connection: close\n\n";
|
||||
Reference in New Issue
Block a user