Project

General

Profile

Actions

Feature #1810

closed

Captive portal - Portal page contents - View current page url is incorrect.

Added by Davy Moedbeck almost 14 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
08/19/2011
Due date:
% Done:

100%

Estimated time:
0.10 h
Plus Target Version:
Release Notes:

Description

In the /usr/local/www/services_captiveportal.php file the link to the uploaded html can not be accessed from a network other than one connected to the captive-portal.

The link is pointing to the portal url itself instead of the raw html page.

So my sollution for this problem:
To do it just like its done for the error html page: by using sommething like "act=viewhtml".

So, look for these lines:

        <?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld file" id="htmlfile"><br>
        <?php
            list($host) = explode(":", $_SERVER['HTTP_HOST']);
            if(isset($config['captiveportal']['httpslogin'])) {
                $href = "https://$host:8001";
            } else {
                $href = "http://$host:8000";
            }
        ?>
        <?php if ($config['captiveportal']['page']['htmltext']): ?>
        <a href="<?=$href?>" target="_new"><?=gettext("View current page"); ?></a>

And replace them by these lines:

        <?=$mandfldhtml;?><input type="file" name="htmlfile" class="formfld file" id="htmlfile"><br>
        <?php if ($config['captiveportal']['page']['htmltext']): ?>
        <a href="?act=viewhtml" target="_blank"><?=gettext("View current page"); ?></a>

This allows one to configure/view the portal page, even when connected from another network.

I have verified this and its the same in todays snapchot "2.0-RC3 (i386) built on Sat Aug 20 03:37:54 EDT 2011" as on the development snapshot of yesterday "2.1-DEVELOPMENT (i386) built on Thu Aug 18 18:44:11 EDT 2011".

Included is a fixed file for the problem.


Files

services_captiveportal.php (44.5 KB) services_captiveportal.php Davy Moedbeck, 08/20/2011 08:13 AM
Actions #1

Updated by Chris Buechler almost 14 years ago

  • Tracker changed from Bug to Feature
  • Project changed from pfSense Packages to pfSense
Actions #2

Updated by Chris Buechler over 10 years ago

  • Status changed from New to Resolved

fixed long ago

Actions #3

Updated by Chris Buechler over 10 years ago

  • Due date deleted (08/20/2011)
Actions

Also available in: Atom PDF