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

    Logout Option with captive portal + free radius

    Scheduled Pinned Locked Moved Captive Portal
    11 Posts 4 Posters 3.3k 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
      last edited by

      Hi,
      @ashima:

      …
      Some time back there was a discussion in the forum... but it's all confusing me.

      I'm probably talking about the same subject (forum tread) here : https://forum.pfsense.org/index.php?topic=122406.msg677921#msg677921 - right ?
      The solution proposed over there works, but not (at the time) for iDevices (Apple).

      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
      • A
        ashima LAYER 8
        last edited by

        Thanks Gretjan for your reply. I am sorry for the late reply.

        I have gone through the forum to find a solution.

        https://forum.pfsense.org/index.php?topic=77143.75

        I have read through the 6 pages. I am left with all confusion. ( I am not a php programmer).

        I tried the option of redirecting to logout.html after logging in. I have copied logout.html in /usr/local/www and in the captive portal redirection after authentication I have give http://my_pfsense_boxIP/logout.html

        This take me to logout.html but when I click logout button I get 404 Not Found  and on the tiltle bar I get

        https://192.168.4.1/

        and I am not logged out of the CP.

        Can you please point out where am I going wrong. My logout.html is same as provided by you.

        <title>Logout</title>

        Click the button below to disconnect

        Regards,
        Ashims

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

          This subject:
          @ashima:

          https://forum.pfsense.org/index.php?topic=77143.75

          implies that you know how to modify certain PHP "pfSense" files - and what the interaction will be.
          You need to know what happens, and why.

          The subject was aborted because the cookie storage didn't works well (some browsers did not keep the cookie, making that solution quit worthless).

          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
          • A
            ashima LAYER 8
            last edited by

            Thank you Gertjan for your reply.  It is working for me now… this is what I have done.

            Enable logout pop-up window in Captive portal. Create logout.html as suggested by Gertjan. Change the default logout page to new logout.html in Captive Portal.

            I have tested it in a test environment... with android, mac, windows...couldn't test on iphone.

            Also I am able to display client-ip, clientmacid on the logout page.

            I was just wondering If I can display the username too....it'll be perfect. I tried with $user in logout page but I guess that info is not passed on to logout.html. How do I enable that ? Any Pointers ?

            Thanks
            Ashima

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

              Well …
              If you have the IP and the MAC of the device (client) visiting the logout page,
              according to https://github.com/pfsense/pfsense/blob/master/src/etc/inc/captiveportal.inc#L1546 - where you can see what's in the internal 'pfsense' database you could write your own function, something like http://pastebin.com/CFatytZ9 - function is being used here (at the bottom) already_connected - to extract the session ID, the user login name, whatever.
              Put it (them) in a variable(s), and use it like some here https://github.com/pfsense/pfsense/blob/master/src/etc/inc/captiveportal.inc#L2002

              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
              • A
                ashima LAYER 8
                last edited by

                Hello,

                Its working for me. I just inserted

                Hello , Welcome to MYCOMPANY NAME, Click the button below to disconnect. Your Ip Address is . Your Mac Id is

                in the logout.html and the username, clientip and client mac is displayed.

                Thank you for your support.

                Ashima

                1 Reply Last reply Reply Quote 0
                • M
                  mafiosa
                  last edited by

                  here you go… its my modified code.feel free to use (displays cliet ip address for easier fault diagonosis):

                  <title>Logout</title>


                             

                  Login Successful,To log outclick here:

                  Change password: click here

                  For college website click here

                  Your Local IP is: <h21 id="list">-</h21>

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

                    its greate i also created using your code but i need a separate ipv6 address.. not both together could you help me with the code seprate for ip address as well as ipv6

                    Untitled.jpg
                    Untitled.jpg_thumb

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

                      The "Captive portal" isn't "IPv6" ready.
                      It can't handle any communication based on IPv6.

                      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
                        dalepothen
                        last edited by

                        Ohh i am a new to it soo i need some help. it would be great if some can help ok i need my log out page to display some things one is username of the logined in account second is the mac address third how much data the user used
                        im am doing in a vmware soo till now no issue i dont know coding so hope you guys can help me out i modified a templet so dont think i designed it .. i have a issue in firefox also i need it to display it not like a pop up in firefox showing this network  requires you to login can any one help me out whit this too will test with chrome also hope it show without any issue

                        Untitledq.jpg
                        Untitledq.jpg_thumb

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