Current date/time is December 8th 2022, 5:02 am

Search found 2 matches for logout

Switch Accounts issues

Thanks for the coding! It's popping up but, the issue I am having is, it not letting me click the 'switch user' button. Do I need to change the &logout to #logout? if that is what you mean? Sorry for the late response I just woke up and tested the code you sent.
by RinRose7
on January 14th 2021, 4:05 pm
 
Search in: Scripts Problems Archives
Topic: Switch Accounts issues
Replies: 26
Views: 782

Switch Accounts issues

Dear @RinRose7

the code is fine, the only problem is that in AwesomeBB the logout element does not have the ID #logout to which the code refers. You only need to update the code with the following:

Code:
<script type="text/javascript">
var logout = $('#main-user-menu ul:last li a:last').attr('href');
        function switch_accounts() {
        jQuery.get(logout, function() {
        jQuery.post('/login', 'login=1&username='+document.getElementById('switch_uname').value+'&password='+document.getElementById('switch_pass').value, function () {
        window.location.reload();
        });
        });
        }
        </script>
        Switch user:<hr />
        <input id="switch_uname" type="text" /><br />
        <input id="switch_pass" type="password" /><br />
        <input type="button" value="Switch user" onclick="switch_accounts();" />


The code works for me, but it may not for you. In any case, could you share the resource where you found the code (a tutorial or something)?

Thanks in advance :rose:
by Niko
on January 14th 2021, 10:22 am
 
Search in: Scripts Problems Archives
Topic: Switch Accounts issues
Replies: 26
Views: 782

Back to top

Jump to: