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

    One Voucher Per Device

    Scheduled Pinned Locked Moved Captive Portal
    147 Posts 12 Posters 34.7k 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.
    • GertjanG
      Gertjan @colleytech
      last edited by

      @colleytech said in One Voucher Per Device:

      applying your patch to select
      1.many
      2. only last
      3. only first

      That patch has nothing to do with FreeRadius.

      @colleytech said in One Voucher Per Device:

      her subsequent users disconnects the first user "not what i want"..............

      I have to check things tomorrow, when I'm on site.
      Look at my image = log again.
      See (bottom) the oldest login. Just above (log is reverse) some OTHER 116 user is disconnected ... etc.

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

      C 2 Replies Last reply Reply Quote 0
      • C
        colleytech @Gertjan
        last edited by colleytech

        That patch has nothing to do with FreeRadius.
        @Gertjan maybe u didn't test the patch,, that patch overrides every setting, anything u apply on freeRadius doesnt reflect, as far as the patch is there.. the patch is so powerful 😀

        I have to check things tomorrow, when I'm on site.
        Look at my image = log again.
        See (bottom) the oldest login. Just above (log is reverse) some OTHER 116 user is disconnected ... etc.

        @Gertjan please do,, i wil be so grateful if i accomplish my goal

        1 Reply Last reply Reply Quote 0
        • C
          colleytech @Gertjan
          last edited by

          @Gertjan said in One Voucher Per Device:

          I have to check things tomorrow, when I'm on site.

          @Gertjan , any luck?

          1 Reply Last reply Reply Quote 0
          • R
            rayyanthameem @Gertjan
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • R
              rayyanthameem @Gertjan
              last edited by

              @Gertjan said in One Voucher Per Device:

              Captive portal users get message you are connected but there is no internet

              I was trying to apply this patch and I'm getting below error:

              Patch can NOT be applied cleanly (detail)
              Patch can NOT be reverted cleanly (detail)

              I can apply the patch by editing the below files,

              src/etc/inc/captiveportal.inc
              src/etc/inc/system.inc
              src/usr/local/captiveportal/index.php

              but I'm using your version of 'src/etc/inc/captiveportal.inc'

              What is the solution for this?

              Thanks in advance

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

                @rayyanthameem said in One Voucher Per Device:

                I was trying to apply this patch and I'm getting below error:
                Patch can NOT be applied cleanly (detail)
                Patch can NOT be reverted cleanly (detail)

                So :

                @Gertjan said in One Voucher Per Device:

                See the 'other' thread that handles that subject.
                See also here : https://github.com/pfsense/pfsense/pull/4042 the solution is in feedback stage. The patch can be imported 'official' (again, see other other thread for details how to do so).

                This thread handles an entire other issue.

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

                R 1 Reply Last reply Reply Quote 0
                • R
                  rayyanthameem @Gertjan
                  last edited by

                  @Gertjan Thanks for your help, I hope this is the patch I've to apply: https://patch-diff.githubusercontent.com/raw/pfsense/pfsense/pull/4042.diff

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

                    @rayyanthameem said in One Voucher Per Device:

                    https://patch-diff.githubusercontent.com/raw/pfsense/pfsense/pull/4042.diff

                    That's the one.
                    As you noticed, the patch can't be applied against a 2.4.4-p3 on your device.
                    This is because the actual version of pfSense on github is more recent (like a 2.4.4-p4) then the version you have (2.4.4-p3).
                    So, first, you have to retrieve from github the most recent files for :
                    /etc/inc/captiveportal.inc
                    /usr/local/captiveportal/index.php
                    /etc/inc/system.inc

                    Then the patch can be applied.

                    I using it right now :

                    43a21d06-4afb-4f7f-84d2-e8efcfaded1a-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
                    • R
                      rayyanthameem @Gertjan
                      last edited by

                      @Gertjan said in One Voucher Per Device:

                      Here we go:
                      This is the new /etc/inc/captiveportal.inc file:
                      https://pastebin.com/V6uWHNz5

                      Now I am using your version of 'captiveportal.inc'

                      Are you suggesting except 'captiveportal.inc' use everything els and apply patch?

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

                        @rayyanthameem said in One Voucher Per Device:

                        Now I am using your version of 'captiveportal.inc'

                        That won't (probably) work with the 4042 patch.

                        The issue of this thread, the "One Voucher use" is something different.
                        Because I didn't publish a patch on github (== a pull request) there is only one way to make my patch work : you have to distil yourself the modifications out of the two files mentioned above (the pastbin ones).

                        I made a case-study of the issue because it pops up often : limiting a voucher to ONE device.
                        A fact is : when some one proposes a patch against github, the patch should be supported by the author during the entire implementation time and test phase.
                        I'm not using vouchers myself .... and lack the time to support such an issue.

                        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
                        • R
                          rayyanthameem
                          last edited by

                          Basically, I want to fix both problems, I need to use the One voucher per device and also fix the 4042 issue.

                          by distil you mean to compare two codes and do the changes?

                          I've tried to do it, but there is some extra code in github version(Line 228). Please see the attached screenshot.Screenshot 2019-08-19 at 11.08.16.jpg

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

                            @rayyanthameem said in One Voucher Per Device:

                            by distil you mean to compare two codes and do the changes?

                            Exact.

                            @rayyanthameem said in One Voucher Per Device:

                            I've tried to do it, but there is some extra code in github version(Line 228). Please see the attached screenshot.

                            I advise you to take the latest version from github, include the patch "4042" and then, if you feel up to it, implement the voucher issue.
                            There are two patches :
                            Some updates for the GUI captive portal settings page :
                            https://pastebin.com/QLhNhgAW

                            Several lines have to be taken from
                            https://pastebin.com/V6uWHNz5 ( /etc/inc/captiveportal.inc )

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

                            R 1 Reply Last reply Reply Quote 0
                            • I
                              Iahmad
                              last edited by

                              hi all,
                              i started this thread but now seems alot of people have same problem so i am requesting management to add this function one voucher per device or for two devices in official release.

                              thanks @ajmaltms @Derelict @free4 @Gertjan @wazim4u @colleytech @rayyanthameem

                              1 Reply Last reply Reply Quote 0
                              • R
                                rayyanthameem @Gertjan
                                last edited by

                                @Gertjan Do you have the original captiveportal.inc file? then I can compare to your modification and do that modification in github version.

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

                                  Noop.

                                  The pastebin files are what's left.
                                  I went back to version stock version.

                                  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
                                  • F
                                    free4 Rebel Alliance @rayyanthameem
                                    last edited by free4

                                    @rayyanthameem the stock 2.4.4-p3 file : https://github.com/pfsense/pfsense/blob/RELENG_2_4_4/src/etc/inc/captiveportal.inc

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

                                      @free4 : you're probably right : I based my edits on that file / version 2.4.4-p3.
                                      @rayyanthameem : a diff will tell you ^^

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

                                      R 1 Reply Last reply Reply Quote 0
                                      • R
                                        rayyanthameem @Gertjan
                                        last edited by

                                        @Gertjan Failed!!.

                                        Patch didn't load, the device was able to connect internet without the voucher, CP changes took longer to save.

                                        in short multiple issues, not sure what is the problem.

                                        Here is the modified version: https://pastebin.com/66y1UgZf

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

                                          Tip :

                                          The easiest file to edit / change first the https://pastebin.com/QLhNhgAW : the GUI web config page.

                                          Search for 'noconcurrentlogins' occurrences in that file.

                                          The only thing that changes in that file is that the state of 'noconcurrentlogins', it chances from

                                          //      $newcp['noconcurrentlogins'] = $_POST['noconcurrentlogins'] ? true : false;
                                          

                                          = true or false

                                          to true, false or multiple.

                                          This is handled in several places, and easy to spot.

                                          Test this one first. You can see in the GUI that it works : changing settings in the GUI can be tested using the 'viconfig' command : you should see the state of (noconcurrentlogins) in captive portal settings page.

                                          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
                                          • W
                                            wazim4u @Gertjan
                                            last edited by

                                            @Gertjan said in One Voucher Per Device:

                                            caveat

                                            I would like to know if you have some latest development on your patch ( one voucher per device ) for 2.5.0 version. I have taken risk to use 2.5-Development version for captive portal service up to 2200 user with voucher system. testing service is running for one week and so far there is no issue and all issues i was facing like reboot system or changing setting in 2.4.4-p3 captive portal gone... made life easy for me. i have implemented your patch again to lock user with first login. It is working fine since 1 week. with a little bit of issues so far which i think fixable.

                                            1-when you try to login again with already active voucher it gives error page in two forms field. one is giving notice ( reuse of authentication not allowed ) and second form ( voucher expired ) it should be only first one in this case.
                                            reuse voucher.jpg

                                            2- Secondly it should be MAC based authentication not MAC & IP. if someone add voucher and his lease is changed from 1.1.1.1 to 2.2.2.2 he will not able to login again even MAC ( device ) is same. this is major problem at the moment.
                                            Auth log.jpg

                                            3- Getting some crash error but doesn't effect captive portal operation.

                                            non numeric-value  encountered in etc/inc/captiveportal.inc on line 1955
                                            
                                            GertjanG 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.