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

    Local info on logout popup

    Scheduled Pinned Locked Moved Captive Portal
    6 Posts 4 Posters 3.9k 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.
    • 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

            SysNetAdmin & Blogger on http://blogmotion.fr

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