PfSense 2.2.1 - Captive portal bug?
-
heh… seems I am able to break 12 lines of HTML code?
prffftttt....<title>Bring Trucking Internet Cafe - Login</title> <form method="post" action="$PORTAL_ACTION$"> Voucher: </form>
OK, I have removed this CP, and recreated it, without custom pages, yet the issue remains!
The initial login page:
The page with incorrect voucher code:
The page when the voucher code is in already in use:
-
Where does the issue remain? I can see no double voucher inputs.
-
Where does the issue remain? I can see no double voucher inputs.
sigh…
ok scrolled down the last screenshot a bit... (working with virtual machines, couldnt get it all in 1 screenshot)
-
https://redmine.pfsense.org/issues/3124
-
https://redmine.pfsense.org/issues/3124
I can confirm this was the solution to the double forms.
However, the other issues still stand: the wrong error message: Invalid credentials specified. -
With the patch proposed above, this:
@XanderVR:However, the other issues still stand: the wrong error message: Invalid credentials specified.
(which is the second instance of error-login-page)
shouldn't show up any more ….I deducted this from reading the code.
-
With the patch proposed above, this:
@XanderVR:However, the other issues still stand: the wrong error message: Invalid credentials specified.
(which is the second instance of error-login-page)
shouldn't show up any more ….I deducted this from reading the code.
Unfortunately this is not the case.
I changed the lines as was specified in the bug report.
This solved the case of the second form showing up.When I now enter a voucher code that has been used by someone esle, AND is currently active, I get the message that the voucher is already activated by someone else.
When I enter an invalid voucher code, I get the error message: "Invalid credentials specified" and not "Invalid voucher"
When I enter a voucher code that has already expired, I get the error message: "Invalid credentials specified", and not "Voucher expired"So where does it go wrong?
This is just a plain install of pfSense 2.2.1
No plugins/addons/etc, the only change is the one mentioned in the bugreport. -
-
So what?
Captive portal needs a complete rewrite. Looks like it'll be in python.
Until then, it's working generally correctly. I'm sure patches making the messages saner would be graciously accepted.
-
It's a simple one.
Use the "System Patches" package to to apply it (or do it by hand):
https://github.com/Gertjanpfsense/pfsense/commit/4828d672b1fbb06e45c272b329aafcfa9b9a8e20.patchhttps://github.com/Gertjanpfsense/pfsense/commit/4828d672b1fbb06e45c272b329aafcfa9b9a8e20
The trouble was: $config['voucher'][$cpzone]['msgexpired'] (and $config['voucher'][$cpzone]['msgnoaccess']) do not exist - the default error message $errormsg ( = "Invalid credentials specified."; ) is always shown.
I applied the parch on my own copy of pfSense. Looking good so far.
Expired vouchers are signaled as should be.
The more general error 'msgnoaccess' also. -
That made sense :)
Just changed the code and indeed it works now :)
Thank you very much -
I did some research about side-effect. Found none.
Pull request against 'master' posted : https://github.com/pfsense/pfsense/pull/1587
(twisting my fingers for that my SLA agreement is still valid, etc)
edit: Pull accepted. Thanks XanderVR for bringing this up :)
-
I did some research about side-effect. Found none.
Pull request against 'master' posted : https://github.com/pfsense/pfsense/pull/1587
(twisting my fingers for that my SLA agreement is still valid, etc)
edit: Pull accepted. Thanks XanderVR for bringing this up :)
It seems these prefixes are present in 2.3.2, but I'm still experiencing the same issue as OP; the double login boxes with double errors. Any ideas?
-