Project

General

Profile

Actions

Bug #6314

closed

pfsense 2.3 Captive Portal - no file loaded

Added by Paolo Brunetti over 9 years ago. Updated over 9 years ago.

Status:
Not a Bug
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
05/04/2016
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:

Description

Hi everybody,

I just made a brand new installation of pfsense-2.3-amd64.
I configured and enabled the Captive Portal as usual on the second interface (I'm using pfsense as CP since version 2.0.2 without problems).

My (very basic) html page for the CP is:

<html>
<head>
<script src="captiveportal-lib.js"></script>
</head>
<body>
<img src="captiveportal-WiFi_Zone.png" width="40px"></img>
<form method="post" action="$PORTAL_ACTION$">
<input name="auth_user" type="text">
<input name="auth_pass" type="password">
<input name="auth_voucher" type="text">
<input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
<input name="accept" type="submit" value="Continue">
</form>
</body>
</html>

and captiveportal-lib.js contains only a trivial test function:

test = function(){
alert("test ok")
}

Despite the files captiveportal-lib.js and captiveportal-WiFi_Zone.png were loaded successfully using the CP File Manager, I cannot load them accessing the CP on any browser (Chrome, Firefox or whatever) on port new default port 8002.
The browser's debug console says "Uncaught SyntaxError: Unexpected token < captiveportal-lib.js:1", and no file (*.js, *.png) is loaded by the browser.

Obviously I can open the same html locally on my PC for test purpose without any error and with all the included files in place.

I tried the same html and files on a fresh pfsense-2.2.6-amd64, and everything is working as expected.


Files

debug-local.png (74.8 KB) debug-local.png debug-local Paolo Brunetti, 05/05/2016 04:56 AM
debug-CP.png (110 KB) debug-CP.png debug-CP Paolo Brunetti, 05/05/2016 05:04 AM
Actions #1

Updated by Paolo Brunetti over 9 years ago

Hi everybody,

I just made a brand new installation of pfsense-2.3-amd64.
I configured and enabled the Captive Portal as usual on the second interface (I'm using pfsense as CP since version 2.0.2 without problems).

My (very basic) html page for the CP is:

<html>
<head>
<script src="captiveportal-lib.js"></script>
</head>
<body>
<img src="captiveportal-WiFi_Zone.png" width="40px"></img>
<form method="post" action="$PORTAL_ACTION$">
<input name="auth_user" type="text">
<input name="auth_pass" type="password">
<input name="auth_voucher" type="text">
<input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
<input name="accept" type="submit" value="Continue">
</form>
</body>
</html>

and captiveportal-lib.js contains only a trivial test function:

test = function(){
alert("test ok")
}

Despite the files captiveportal-lib.js and captiveportal-WiFi_Zone.png were loaded successfully using the CP File Manager, I cannot load them accessing the CP on any browser (Chrome, Firefox or whatever) on the new default port 8002.
The browser's debug console says "Uncaught SyntaxError: Unexpected token < captiveportal-lib.js:1", and no file (*.js, *.png) is loaded by the browser.

Obviously I can open the same html locally on my PC for test purpose without any error and with all the included files in place.

I tried the same html and files on a fresh pfsense-2.2.6-amd64, and everything is working as expected.

Actions #2

Updated by Chris Buechler over 9 years ago

  • Project changed from pfSense Packages to pfSense
  • Status changed from New to Not a Bug
  • Affected Version deleted (2.3)

same portal page works for me in Firefox on Ubuntu and Windows. Changing the js to just one line, "alert("test ok")", so it does something, it alerts on page load. The syntax error is coming from the contents of your js file

Actions #3

Updated by Paolo Brunetti over 9 years ago

Hi Chris,

I tried to simplify the .js lib according to your suggestion, but the problem still persist to me.
I don't believe the problem comes from a javascript error (too trivial to be wrong, I hope).
To clarify my problem, I attached a couple of debug image, from the browser perspective.

As you can see in the first images attached (debug-local), opening the html in the browser (Chrome) from local filesystem, all the needed resources (js and png) are loaded (the little icon on the upper left corner and the popup appear as expected). Debug console confirms the resources are in place.

When the same page is accessed throw the CP (in my case http://10.0.0.16:8002/?zone=wifi_test) the resources are not loaded by the browser, so no image or popup appear. Checking the browser console confirms the resources are non retrieved from nginx on pfsense at all (see debug-CP).
I double checked the resources are in the right place inside pfsense, in the /var/db/cpelements folder.

The same page and resources loaded on a very basic pfsense-2.2.6-amd64 show what it is expected to do (icon + alert popup).

Can you please tell me if more detail about my setup may help to find out the problem?
Thanks in advance,

Paolo

Actions #4

Updated by Jim Pingle over 9 years ago

Note the differences in your zone name in the URL and in the form tag. Is your zone name actually all lower case or all upper case? You may just be hitting a variation of #6278

Actions #5

Updated by Paolo Brunetti over 9 years ago

Hi Jim,

thanks a lot for your hint.
As you notice, it seems the same bug as #6278.
My zone was defined all uppercase (WIFI_ZONE) and the "View" button seems to point to lowercase.

I tried to delete and recreate the zone with all lowercase ("wifi_zone") with no luck.
Also the suggested workaround, manually editing the xml did not work.
Still no luck trying to type the url directly (http://10.0.0.16:8002/?zone=wifi_test)

Do you have any other suggestion?

Thanks in advance,

Paolo

Actions #6

Updated by Paolo Brunetti over 9 years ago

my previous post had a typo: I meant uppercase WIFI_TEST and non WIFI_ZONE, as everyone may have noticed.
The tests I did were performed using the right zone name.

Thanks,

P.

Actions

Also available in: Atom PDF