pfSense Gold Subscription

Author Topic: Captive portal issues  (Read 1717 times)

0 Members and 1 Guest are viewing this topic.

Offline digilink

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Captive portal issues
« on: February 04, 2012, 02:47:32 pm »
I setup a custom portal page and it's not working as intended and I'm struggling to figure out why. The inital redirect happens when I try to access a website (i.e. google) and this the URL that is displayed in the browser bar:

Code: [Select]
192.168.1.1:8000/index.php?rediurl=http%3A%2F%2Fwww.google.com%2F
My custom page is displayed, but if I enter my predefined user or a voucher, I get redirected right back to it (instead of to google.com as my example):

Code: [Select]
192.168.1.1:8000
Here's the relevant form from my custom page, which is named index.php:
Code: [Select]
<div id="login-box">
<form method="post" action="$PORTAL_ACTION$">
<H1>STEPHENNET NETWORKS</H1>
Please authenticate with username/password given
<br />
<br />
<div id="login-box-name" style="margin-top:20px;">username:</div><div id="login-box-field" style="margin-top:20px;"><input name="auth_user" class="form-login" title="Username" value="" size="30" maxlength="2048" /></div>
<div id="login-box-name">password:</div><div id="login-box-field"><input name="auth_pass" type="password" class="form-login" title="Password" value="" size="30" maxlength="2048" /></div>
<div id="login-box-name">voucher code:</div><div id="login-box-field"><input name="auth_voucher" type="text" class="form-login" title="voucher" value="" size="30" maxlength="2048" /></div>
<br />
<br />
<input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
<input name="accept" type="image" src="captiveportal-login-btn.png" width="103" height="42" style="margin-left:90px;" /></a>

My end goal is to be able to use vouchers and username/passwords, and neither are working. Don't know if there's a mistake in my HTML or not, but I can't seem to put a finger on it.....

Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5262
  • Karma: +0/-0
    • View Profile
Re: Captive portal issues
« Reply #1 on: February 04, 2012, 04:13:01 pm »
What browser are you using?

What happens if you give an invalid voucher code?

If you give a valid voucher code is this accepted and registered as "in use"? (See Status -> Captive Portal, click on Active Vouchers tab)

My knowledge of HTML is small. Why are using class="form-login" in the input fields? My captive portal greeting page doesn't include the class element in the input tags.


Offline digilink

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Captive portal issues
« Reply #2 on: February 04, 2012, 07:41:16 pm »
What browser are you using?

What happens if you give an invalid voucher code?

If you give a valid voucher code is this accepted and registered as "in use"? (See Status -> Captive Portal, click on Active Vouchers tab)

My knowledge of HTML is small. Why are using class="form-login" in the input fields? My captive portal greeting page doesn't include the class element in the input tags.



I use Chrome 95% of the time, but Internet Explorer and Firefox also produce the same results. I don't get an error page if I submit an invalid voucher code, nor do I show a voucher code in use if I submit a valid one. The class is just used for styling, it's being referenced from a CSS file....

Offline wallabybob

  • Hero Member
  • *****
  • Posts: 5262
  • Karma: +0/-0
    • View Profile
Re: Captive portal issues
« Reply #3 on: February 04, 2012, 11:16:08 pm »
In Firefox 3.6.24 I connected to my pfSense 2.0.1 Captive Portal. In the Firefox View menu I selected Page Source and it displayed
Quote
<center> <h1>Caleb's Internet Cafe </h1> </center>
<form method="post" action="http://192.168.51.211:8000/">
Please enter your authorisation information:


   Username: <input name="auth_user" type="text"> and
   Password: <input name="auth_pass" type="password">



OR


   Voucher Code: <input name="auth_voucher" type="text">



Then click the Continue button below:


   <input name="redirurl" type="hidden" value="http://www.google.com.au/advanced_search">
   <input name="accept" type="submit" value="Continue">
</form>
in a new window. I went back to the CP home page, entered a valid voucher code and went straight to http://www.google.com.au/advanced_search.

I think the basic CP mechanism works. Maybe some of the "fancy" HTML in your page is getting in the way. Your document appears to have a closing tag ("[/url]") without a matching opening tag ("<a>") and the "
" tags seem an unusual construct.

Offline Nachtfalke

  • Hero Member
  • *****
  • Posts: 2753
  • Karma: +0/-0
    • View Profile
Re: Captive portal issues
« Reply #4 on: February 05, 2012, 05:30:08 am »
I mentioned problems when I enter on CP page as redirection URL jus:
www.google.com

I need to enter:
http://www.google.de

Then the redirection is working - if without http:// I got a loop.

Not sure, if this is related to your problem.