My modern Captive Portal/Login template



  • Since i couldn't find a good looking one when i first set up our box, i made my own.
    I do web design/programming on my spare time, so this was my contribution.

    It needs an external file host (or if you like ftp'ing into your box then go for it ), and it has a font from Google's API.
    It's also optimized for modern browsers (HTML5/CSS3), so if your clients are still on XP and <ie8 then="" you="" should="" consider="" moving="" into="" the="" future="" ;)<br="">Our internal version has a squid3 username collector since the pfsense one just makes the network stop working, so i had to cut that out.
    I had to do this without being able to check the final result, so please tell me if it just doesn't work at all.

    Installation
    Copy sg_handle folder to a webpage host
    Upload captive.php to all captive portal upload fields in the pfSense section.

    Features

    • Username+Password login (no vouchers)
    • Logout button (detects if the user is logged in)
    • Some neat animations
    • Responsive design for smaller displays (phone/tablet)
    • Tabs with links to your webmail e.g. (add it to exlusions so users can quickly access it without logging into the portal)
    • base64 encoded reference with user IP and MAC address so you can add them to the exclusions by them providing the string.
    • Footer with support information

    Settings you might want to configure:
    captive.php

    • $site_url
    • $site_title
    • tab links
    • login/logout messages + button text

    action.css

    • website url

    I don't really know anything about licenses, so i put it on the GNU License, since i copied code that had it - i don't really care about my code being modified.

    (the screenshots use our internal version, it looks slightly different with the images/text)




    captive-redist-1.0.0.zip</ie8>



  • Can you help me with the code.

    How to  redirect to the login page instead of  logout message after logging out ?

    Thank you.



  • "Installation
    Copy sg_handle folder to a webpage host"

    I didnt understand where i upload this sg_handle folder to upload?



  • @redeyes:

    How to  redirect to the login page instead of  logout message after logging out ?

    When the "logout" (from the file "captive/php" is fired, it will NOT be handled by 'pfSense'.
    But, checkout out first /usr/local/captiveportal/index.php line 236, this is the line that checks loggins using local Manager and user/password  authentication.
    How to redirect is shown over there.

    Be careful that redirecting from the logout page to the login page - and the you logn again - will/can redirect you to the …. logout page.

    Have also a look at line 73 that handles 'pfSense', own logout page.

    @uv4487:

    I didnt understand where i upload this sg_handle folder to upload?

    You can put that folder on a (read = any) web host.
    I advise you to put it on your pfsense system in /usr/local/captiveportal
    remember to adapt the 'captive.php' line 51 - like
    $site_url = "sg_handle"; // external host with sg_handle folder

    If you put it here :
    $site_url = "http://wwww.your-web-server-on-the.net/sg_handle"; // external host with sg_handle folder
    the add the domain "your-web-server-on-the.net" on the tab
    ServicesCaptive Portalcpzone1Allowed Hostnames
    or add it's Ip on the tab:
    ServicesCaptive Portalcpzone1Allowed IP Addresses



  • mrbrax

    Please post .ZIP file again

    action.js is 0k

    Do not login

    tks



  • @iNCONIX:

    mrbrax

    Please post .ZIP file again

    action.js is 0k

    Do not login

    tks

    How am i supposed to post it if i'm not allowed to log in? ;)

    It is supposed to be empty, yes. Not sure why i provided it at all.


Log in to reply