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

    Is voucher in url still available?

    Scheduled Pinned Locked Moved Captive Portal
    4 Posts 2 Posters 586 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.
    • K
      kabeda
      last edited by

      Hi,
      I want to distribute the vouchers by qrcode which will contain a url like this

      http://pfsenseip:8002/index.php?zone=zone_name&redirurl=redir_url&voucher=voucher_code
      

      but it returns me directly to the authentication page. I read on the forum but I did not understand if it's working or if the voucher by GET has been disabled.
      https://redmine.pfsense.org/issues/1984

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

        @kabeda

        I created a QR using
        https://portal.my-portal.tld:8003/index.php?zone=cpzone1&redirurl=https://www.google.com&voucher=wB8C8Usq33Q

        where "portal.my-portal.tld" is of course my real valid captive portal domain name.
        wB8C8Usq33Q was valid.

        32940bac-828e-4ac0-b07a-d36d44d8ac5d-image.png

        The voucher pre filled in as you can see, I had to tap 'Login' to login.

        Btw : I'm using 23.01 - and the latest pfSense System_Patches package version 2.2.2.

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

        K 1 Reply Last reply Reply Quote 0
        • K
          kabeda @Gertjan
          last edited by

          @gertjan
          Hi,
          I'm using 2.6.0-RELEASE (amd64)
          built on Mon Jan 31 19:57:53 UTC 2022
          FreeBSD 12.3-STABLE

          May be it doesn't work with this version.
          I had to change my Portal page contents in order to read the $_GET['voucher'] variable and if there's an error in Auth error page contents I had to read $_POST['auth_voucher'].
          It works with these changes but I still don't know if $_GET['voucher'] is originally read by the authentification default pages.

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

            @kabeda said in Is voucher in url still available?:

            I still don't know

            So you know what you're looking for.

            $_GET['voucher']
            

            Open source ... heard about that one ?
            So, go here : https://github.com/pfsense/pfsense/tree/RELENG_2_6_0

            Then click you way to /src/usr/local/captiveportal/index.php
            Look for, search, Ctrl-f "$_GET['voucher']" on that page.
            It's there 😊

            Next test : on your pfSense, you have the console access.
            Use it.
            Use option 8.

            grep "GET\['voucher'\]" /usr/local/captiveportal/index.php
            

            You'll find the same thing.

            Btw : when you use vouchers, it's important that you have this https://github.com/pfsense/pfsense/blob/master/src/etc/inc/captiveportal.inc#L156 in your own portal (html) page.
            You can add PHP into your html portal page.

            7ddeeee5-e9a5-49bd-ba4e-c955e20eab41-image.png

            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
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.