Current date/time is Thu Mar 28 2024, 13:12
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 Thu Jan 14 2021, 17:05
- Search in: Scripts Problems Archives
- Topic: Switch Accounts issues
- Replies: 26
- Views: 1011
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 Thu Jan 14 2021, 11:22
- Search in: Scripts Problems Archives
- Topic: Switch Accounts issues
- Replies: 26
- Views: 1011