Current date/time is May 19th 2024, 2:45 pm
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.- on January 14th 2021, 4:05 pm
- Search in: Scripts Problems Archives
- Topic: Switch Accounts issues
- Replies: 26
- Views: 1084
Switch Accounts issues
Dear @RinRose7the 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
- on January 14th 2021, 10:22 am
- Search in: Scripts Problems Archives
- Topic: Switch Accounts issues
- Replies: 26
- Views: 1084