Feature #1810

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

Added by Davy Moedbeck over 1 year ago. Updated over 1 year ago.

Status:New Start date:08/19/2011
Priority:Normal Due date:08/20/2011
Assignee:Davy Moedbeck % Done:

100%

Category:-
Target version:- Estimated time:0.10 hour
Affected version:All Affected Architecture:All

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.

services_captiveportal.php Magnifier (44.5 kB) Davy Moedbeck, 08/20/2011 08:13 am

History

#1 Updated by Chris Buechler over 1 year ago

  • Tracker changed from Bug to Feature
  • Project changed from pfSense Packages to pfSense

Also available in: Atom PDF