Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Time remaining popup window

    Scheduled Pinned Locked Moved Captive Portal
    8 Posts 3 Posters 4.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      islandwifibill
      last edited by

      I've found several topics in here that touch on this, but none that actually tell how to do it.

      I'd like to have my customers know how much time they have remaining before they must renew their subscription.  I'm sure it's php code, but I'm danged if I even have a clue how to do this.  I'm using mysql with pfsense 2.x .  Anyone here feel generous enough to throw this old dog a bone?

      1 Reply Last reply Reply Quote 0
      • R
        Rampage
        last edited by

        i was also interested in this sort of hack, but first of all i need to figure out what's the software used as NAS for the captive portal, is it chillispot? covachilli? or something internally developed?

        the NAS might be able to provide the information with proper query.

        1 Reply Last reply Reply Quote 0
        • I
          islandwifibill
          last edited by

          As I said, I'm using pfSense.  That is the NAS.

          Stay away from Coova.  It's like crack.  Looks good at first, but then your teeth go bad and someone turns the light and…  well, you get the picture. ;D

          1 Reply Last reply Reply Quote 0
          • R
            Rampage
            last edited by

            yep, but i thought pfsense was running some sort of daemon for the captive portal functionality

            what i mean is that i don't know how it is implemented enaugh in details to think of a way to accomplish the task

            1 Reply Last reply Reply Quote 0
            • I
              islandwifibill
              last edited by

              pfSense is both the NAS and the captive portal, among many other things.

              1 Reply Last reply Reply Quote 0
              • I
                islandwifibill
                last edited by

                All right, I finally finally got this working.

                First things first; during this process I somehow "broke" the redirurl/popup aspect of the login success page.  Don't know what I did, but when ever I load the simplest html via "services -> captive portal", the whole thing shows up as the next page.  redirurl is not working.  I'm sure this is something I've done, and I don't actually care that the window isn't a popup – I rather like it the way it is, but I would like the redirurl working again.

                At any rate, what I have now is a page that shows up on log in success that greets the user, informs the user their log in was successful, tells them how may days they have left to use the service, and presents them with a clickable link to wherever it was they were going in the first place.  I like it.

                I banged my head against the wall for days trying to figure out how to implement this using a script that invokes radclient and pops up via a javascript (thereby obviating the need to have popup enabled).  At my low skill level with coding, it simply turned out to be too much trouble to get it to work -- inevitably, the form would send its variables to the popup but NOT to the captive portal (even though the javascript was supposed to send it to both at once).  So I finally took the easy route and discarded the javascript.  I rewrote the functions in php to simply query the database for the proper information and then perform any housekeeping chores on it before presenting it to the user -- no radclient.  "After all",  I reasoned, "why bother?  The page shouldn't show up at all unless the user successfully authenticates in the first place, right?"  Plus this gives me many more options with page design, and lots more room to fiddle with putting additonal information into the page -- calling gd bells and whistles, for instance.

                I'd be glad to help anyone else going through this issue, just drop a reply into here.

                EDIT:  In case it isn't clear from my rambling here, the process is very straightforward -- build your php code (whatever that might be) and when it's debugged, upload it via Services -> Captive Portal -> Logout page contents.  Debug your code thoroughly from the command line in pfSense before doing this!

                1 Reply Last reply Reply Quote 1
                • B
                  basewireless
                  last edited by

                  Hi Thanks for your post
                  Cab you tell me were you querying your mysql database directly from the pfsense box or from a server?
                  We are trying to avoid opening MySQl access to more than one host and we have multiple pfsense captive portals..

                  Is there a way to pass variables from a hosted server page back to the portal popup logout page (such as overwriting the $PORTAL_REDIRURL$ on a successful connection based on interaction on the portal?

                  hopefully this makes sense. Just trying to know what variables are available on the portal logout page

                  thanks

                  1 Reply Last reply Reply Quote 0
                  • I
                    islandwifibill
                    last edited by

                    I am querying a mysql server that is NOT running on the pfsense machine.  Pretty straightforward stuff.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.