Navigation

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

    Local info on logout popup

    Captive Portal
    4
    6
    3702
    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.
    • P
      praetor last edited by

      I don't know if this has been asked before, if true please post a link to that thread. My search attempts gave me nothing.

      I want to embed some local content in that popup (weather information, traffic details, etc.). This should not be too difficult as I've locate the captive portal php file and modified it already (a small translation here and there). The difficult part is "moving" the logout script from on-click to on-popup-close. Can this be done? If true, can someone point me in the right direction?

      In laymen's terms I want the logout popup to contain local information and to disconnect the user when he clicks the close button.

      Sorry for my bad speling, English is not my native tongue.

      1 Reply Last reply Reply Quote 0
      • A
        aneip last edited by

        you need to use onUnload javascript which will trigger when user close the windows. inside the javascript you need to post the form to logout the user.

        1 Reply Last reply Reply Quote 0
        • P
          praetor last edited by

          Thank you very much, I'll try it and post the code if anyone is interested.

          1 Reply Last reply Reply Quote 0
          • X
            xhark last edited by

            @praetor:

            Thank you very much, I'll try it and post the code if anyone is interested.

            yes I'm interested

            1 Reply Last reply Reply Quote 0
            • P
              praetor last edited by

              ok, it seems I am not doing this right.

              I created a .js file and added the following to it

              
              function doIt() {
                               window.document.getElementById('form').submit();
                               alert('Ati fost deconectati de la Internet');
                              }
              
              

              then I modified the /usr/local/captiveportal/index.php file with:

              
                  LogoutWin.document.write('');
                  LogoutWin.document.write(' ');
                  LogoutWin.document.write('  <title>WiFi Network :: Logout</title>');
                  LogoutWin.document.write('  ');
                  LogoutWin.document.write(' ');
                  LogoutWin.document.write(' ');
                  LogoutWin.document.write('  ');
                  LogoutWin.document.write('   
              
              <form name="form" method="POST" action="{$logouturl}">');
                  LogoutWin.document.write('    ');
                  LogoutWin.document.write('    ');
                  LogoutWin.document.write('   </form>
              
              ');
                  LogoutWin.document.write('  ');
                  LogoutWin.document.write(' ');
                  LogoutWin.document.write('');
              
              

              The problem? I can close the window without it submitting anything (i.e. ctrl+alt+del -> kill process).

              1 Reply Last reply Reply Quote 0
              • P
                ppp60 last edited by

                then I modified the /usr/local/captiveportal/index.php file with:

                LogoutWin.document.write('');
                    LogoutWin.document.write('') ;
                    LogoutWin.document.write('<title>Logout</title>') ;
                    LogoutWin.document.write(' ');
                    LogoutWin.document.write('') ;
                    LogoutWin.document.write(' ');
                    LogoutWin.document.write('') ;
                    LogoutWin.document.write('Click the button below to disconnect

                ');
                    LogoutWin.document.write('

                <form id="dologout" name="dologout" method="POST" action="{$logouturl}">');
                    LogoutWin.document.write('');
                    LogoutWin.document.write('');
                    LogoutWin.document.write('</form>

                ');
                    LogoutWin.document.write('');
                    LogoutWin.document.write('');
                    LogoutWin.document.close();

                /********************/
                I am sure 100%

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                Products

                • Platform Overview
                • TNSR
                • pfSense
                • Appliances

                Services

                • Training
                • Professional Services

                Support

                • Subscription Plans
                • Contact Support
                • Product Lifecycle
                • Documentation

                News

                • Media Coverage
                • Press
                • Events

                Resources

                • Blog
                • FAQ
                • Find a Partner
                • Resource Library
                • Security Information

                Company

                • About Us
                • Careers
                • Partners
                • Contact Us
                • Legal
                Our Mission

                We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                Subscribe to our Newsletter

                Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                © 2021 Rubicon Communications, LLC | Privacy Policy