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

    Is logout without popup possible?

    Captive Portal
    4
    15
    1.4k
    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.
    • N
      nemesisdev
      last edited by nemesisdev

      Hi everyone,

      I maintain a captive page open source app which knows the session ID of the user and has a logout button the user can use if they want.

      This makes the logout popup redundant, so I want to ask if is it possible to configure PfSense to keep the logout functionality enabled but without triggering the pop up in the browser of the user?

      Thanks in advance!

      DerelictD 1 Reply Last reply Reply Quote 0
      • DerelictD
        Derelict LAYER 8 Netgate @nemesisdev
        last edited by

        @nemesisdev Uncheck this?

        Screen Shot 2021-05-06 at 7.18.35 PM.png

        Chattanooga, Tennessee, USA
        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
        Do Not Chat For Help! NO_WAN_EGRESS(TM)

        N 1 Reply Last reply Reply Quote 0
        • N
          nemesisdev @Derelict
          last edited by

          @derelict Sorry for my late reply, I wanted to find the time to double check this.

          If I disable that checkbox, logout stops working completely.

          The version I am currently running is 2.4.5.

          At the moment I am assuming it is not possible to log out without enabling this popup, but I believe it would be useful to decouple the two things: one could disable the popup but keep the logout enabled, because the logout would be performed by a webpage residing on an external server, calling the logout URL with a post.

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

            @nemesisdev said in Is logout without popup possible?:

            At the moment I am assuming it is not possible to log out without enabling this popup, but I believe it would be useful to decouple the two things: ......

            This solution is a "copy some files and done" solution ?
            I guess not.
            So, why stop half way ?

            The popup windows text can be provided by pfSense, see the script here or you can define you own php/java/html/whatever page.

            It should call against the same index.php page providing a 'logout_id' parameter with the user's session ID.

            Here here logout page is prepared.
            I guess you can leave that part of the scrip 'as is'.

            In de main 'index' file ( /usr/local/captiveportal/index.php ) of the captive portal :

            This line
            Conditions :
            When there is a session, and
            When the "logout_id" isn't set, and
            When there is a logout page text defined
            Then show the build in popup - logout - page.

            I guess you could comment out (or delete) the entire function body except the ending

            return;
            

            Btw : take note : The lines shown are from the actual pfSense "2.5.1" version.
            Yours could be different, as you use older "2.4.5" code.

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

            N 1 Reply Last reply Reply Quote 0
            • N
              nemesisdev @Gertjan
              last edited by

              @gertjan the problem is not the customization of the logout page.
              I don't understand what is the code which triggers the logout popup after logging in.
              I think that's the part which should be changed to allow the logout action without the popup.

              But for the moment I will live with the pop up blocked message in the browser.

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

                @nemesisdev

                Using version 2.5.2 :

                6128d1f7-ce3a-4cb1-887b-59d0fb6c4af9-image.png

                with this unchecked, there is no pupup.

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

                N 1 Reply Last reply Reply Quote 0
                • N
                  nemesisdev @Gertjan
                  last edited by

                  @gertjan said in Is logout without popup possible?:

                  @nemesisdev

                  Using version 2.5.2 :

                  6128d1f7-ce3a-4cb1-887b-59d0fb6c4af9-image.png

                  with this unchecked, there is no pupup.

                  As I already wrote previously, if that checkbox is disabled, the possibility of logging out is disabled.

                  So the ideal solution would be a way to disable the logout popup window without disabling the logout HTTP POST.

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

                    @nemesisdev

                    Sorry, you're right, I wasn't looking what I previously wrote.

                    There is no 'click here' solution for your question.
                    You have to edit the code, as I said ... also above : just remove the part of the html that is responsible for the creation of the logout popup box (didn't test this myself).

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

                    N 1 Reply Last reply Reply Quote 0
                    • N
                      nemesisdev @Gertjan
                      last edited by

                      @gertjan Are you involved with the pfsense development?

                      Do you know if the maintainers would be interested in a patch to solve this?

                      DerelictD GertjanG 2 Replies Last reply Reply Quote 0
                      • DerelictD
                        Derelict LAYER 8 Netgate @nemesisdev
                        last edited by

                        @nemesisdev Always. redmine.pfsense.org and github.com/pfsense

                        Chattanooga, Tennessee, USA
                        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                        Do Not Chat For Help! NO_WAN_EGRESS(TM)

                        N 1 Reply Last reply Reply Quote 0
                        • N
                          nemesisdev @Derelict
                          last edited by

                          @derelict thanks, BTW redmine links this page: https://www.netgate.com/docs/pfsense/development/bug-reporting.html which returns 404.

                          I created the issue on redmine: https://redmine.pfsense.org/issues/12138.

                          DerelictD 1 Reply Last reply Reply Quote 0
                          • DerelictD
                            Derelict LAYER 8 Netgate @nemesisdev
                            last edited by

                            @nemesisdev Discussion regarding best ways to accomplish it should be done here on the forum. Redmine is not a platform for discussion.

                            Chattanooga, Tennessee, USA
                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

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

                              @nemesisdev said in Is logout without popup possible?:

                              @gertjan Are you involved with the pfsense development?

                              No way, just a severally addicted consumer.
                              I think I understand how it works, what it does to make things happen. I'm able of tearing it apart, and break things completely.
                              Just ones in a while I find something small that fixes something even smaller.

                              The captive portal is special for me as I need it.
                              It's a marvelous peace of work and a coding nightmare, should probably be rewritten from the ground up (not using PHP I guess).
                              But it works - for me.

                              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
                              • jimpJ
                                jimp Rebel Alliance Developer Netgate
                                last edited by

                                This is actually a bug and not intended. It worked in the past but some recent portal changes may have unintentionally caused the change in behavior.

                                You should always be able to manually go back to the portal page at <http or https>://<ip address or hostname>:<port number>/index.php?zone=<zonename> and click Logout even when the popup is disabled.

                                When the popup is disabled, going back to that URL displays a logout button but clicking it returns a "you are connected" message and does not disconnect the user.

                                It works as expected when the logout popup is enabled.

                                I updated the Redmine issue at https://redmine.pfsense.org/issues/12138 to reflect this.

                                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                Need help fast? Netgate Global Support!

                                Do not Chat/PM for help!

                                N 1 Reply Last reply Reply Quote 0
                                • N
                                  nemesisdev @jimp
                                  last edited by

                                  @jimp thanks for the update, I'm relieved to know that, since the way it works now looked pretty weird.

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