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

    Voucher Show time remaining in Logout page contents

    Scheduled Pinned Locked Moved Captive Portal
    9 Posts 3 Posters 913 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.
    • D
      david6464
      last edited by david6464

      Hello,

      I am looking for a solution to add the remaining time of the voucher connect.

      Anyone have an idea?

      GertjanG 1 Reply Last reply Reply Quote 0
      • F
        FSC830
        last edited by FSC830

        My guess, not so easy.
        Just without deep investigating what is in my mind:

        1. You can show all active vouchers and the remaing time, which is may be easier, but not desired.
        2. You need to pick up the individual CP session ID and the voucher code and fiddle this somehow into the logout page.

        The session ID is not a problem (my guess), as the logout page contains this parameter.
        But how does the CP session differs between a login by voucher or by user/password...?
        So you need in addition to check how the session was established.
        No idea, if the voucher code is somewhere linked with the session ID as long as the session exists. Actually, I dont think so. My idea is that after login the session starts with the timer the voucher role allows, but without a link to code but to voucher role.

        Again, I did not a deep investigation how the session is established. May be someone else jumps in with a more detailed answer.

        Regards

        Edit: May another approach is the show the remaining time at login (I know, no one will remember the remaining time later on...)

        1 Reply Last reply Reply Quote 0
        • GertjanG
          Gertjan @david6464
          last edited by

          @david6464

          Very feasible, as all the info is known upfront.
          Some serious scripting (also called 'programming') is needed, though.
          A feature request (can be entered in redmine) ... ?

          But one issue can't be resolved : the logout page is a pop up window. Most browser do not allow pop up pages anymore (they do, but we, the "users" don't and thus most browsers will refuse to show them).

          What about writing a text on the voucher, the paper with the code, that the user should activate pop pages from the host (or IP) = pfSense is way above the vast majority of the portal users ? ( ๐Ÿ˜Š )

          So ; what about this (silly I know) solution :
          Print on the voucher :
          "You obtained a voucher that will last x hours.
          This means that, as soon as you start to use the voucher, it will expire x hours after the moment you start using it."

          When done that, you've transformed the issue.
          "As soon as some one drops in and says : my voucher that lasts x hours stopped working after x hours".
          All you need to do is : smile at him.

          More serious would be : print a QR code on the voucher that should be scanned by the user's phone. It should program an event in the phone that warns the user the voucher is about to be expire.

          And adapt your captive portal login page, and mention that the user should keep in mind that vouchers expire - and that they should take note of that.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          F 1 Reply Last reply Reply Quote 0
          • F
            FSC830 @Gertjan
            last edited by

            @gertjan said in Voucher Show time remaining in Logout page contents:

            More serious would be : print a QR code on the voucher that should be scanned by the user's phone. It should program an event in the phone that warns the user the voucher is about to be expire.

            Very good idea, but...Scanning a QR code only as a reminder for expiring?
            This would make sense if you print a QR code for login and a QR code for expiring.
            Anyhow, the problem I see is you can print only a template which needs to be updated at the mobile phone (date/time of scan) which requires an app or something else.
            Not sure if you can create a QR code which can do all at the same time when scanned: aquire actual date/and time and create an entry in calendar app...?

            Regards

            GertjanG 1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan @FSC830
              last edited by

              @fsc830 said in Voucher Show time remaining in Logout page contents:

              Scanning a QR code only as a reminder for expiring?

              A known scan action is : you scan an URL, so the phone opens up the browser right way with that URL.
              What about : the scan programs an event at a day and hour.
              I admit, I even don't know if that is possible ;)

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 0
              • D
                david6464
                last edited by

                Hello,
                If I understand correctly, it's impossible to create a PHP page to see how much time is left?

                F GertjanG 2 Replies Last reply Reply Quote 0
                • F
                  FSC830 @david6464
                  last edited by

                  @david6464 Yes and no, ๐Ÿ˜Š .
                  Basically its possible with some programming in PHP.
                  But as @Gertjan remarked its a challenge for a pop-up logout page.

                  Regards

                  1 Reply Last reply Reply Quote 0
                  • GertjanG
                    Gertjan @david6464
                    last edited by

                    @david6464 said in Voucher Show time remaining in Logout page contents:

                    If I understand correctly, it's impossible to create a PHP page to see how much time is left?

                    The page already exist ๐Ÿ˜Š

                    Here it is :

                    0def3193-38c4-4ac7-a802-37f1b26bc245-image.png

                    Enter your voucher code and click on Test.

                    You, as an admin, can do so.

                    You could use the (see line 61 in the /status_captiveportal_test.php?zone=YOURZONEID) voucher_auth function code on the logout popup windows that you create yourself.
                    See lines 61 -> 72 how to parse the results.

                    No "help me" PM's please. Use the forum, the community will thank you.
                    Edit : and where are the logs ??

                    1 Reply Last reply Reply Quote 0
                    • D
                      david6464
                      last edited by

                      Hello,
                      Thanks I'll try, I'll let you know

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