Switch Accounts issues
5 posters
Page 1 of 1
Switch Accounts issues
So, a friend recently showed me a switch Accounts code to use. Which is fine and dandy but it doesn't appear to work. Of course I'm using the latest version (AwesomeBB) which I know/from what I can tell is still in beta mode but, if there's any chance to get a switch account coding for AwesomeBB that would be helpful. And my friend and I tried several different ones too but none seemed to work.
Last edited by RinRose7 on Sun Jan 24, 2021 4:48 pm; edited 1 time in total
Re: Switch Accounts issues
- Code:
<script type="text/javascript">
function switch_accounts() {
jQuery.get(document.getElementById('logout').href, 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();" />
This was one of the many we tried. It seems to work on Phpbb but it doesn't seem to work on AwesomeBB. Another we've tried was for Invision only. One I found completely broke the site and didn't work.
Re: Switch Accounts issues
yes i have also the same code
this code works for all versions besides Awesome
this code works for all versions besides Awesome
Re: 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:
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
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
skouliki and SarkZKalie like this post
Re: 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.
Re: Switch Accounts issues
@RinRose7 try to replace the first part of the code with this:
if it still doesn't work, I need to see it live and test it myself to understand the possible causes and problems occurring
- Code:
$(function() {
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();
});
});
}
});
if it still doesn't work, I need to see it live and test it myself to understand the possible causes and problems occurring
TonnyKamper likes this post
Re: Switch Accounts issues
Still having the same issues as I did beforehand. Won't let me click the 'Switch Account' and change users
Re: Switch Accounts issues
I also tested and i have the same issue as RinRose7
TonnyKamper likes this post
Re: Switch Accounts issues
Can you guys provide me an example? Because I need to see it live to understand what happens
and strangely it works for me, so I can't test it on my own
and strangely it works for me, so I can't test it on my own
Re: Switch Accounts issues
I'm not very good at explaining it but, the button part for the "Switch Accounts" doesn't appear and even when I pressed the 'viewing' part for the code to show the login thing for switch accounts and click the button nothing happens. It's like a useless button that won't work. If you want I can even send a screen shot of how it looks on my screen with the code in and send a url of my own forum so you can try and click the switch user button.
Re: Switch Accounts issues
@RinRose7 sorry, maybe I didn't explain myself... I need to see it on my own!
I need to register on your website and test it personally - because of that I need to know where i will be able to find it
I need to register on your website and test it personally - because of that I need to know where i will be able to find it
Yes please, for both of themIf you want I can even send a screen shot of how it looks on my screen with the code in and send a url of my own forum so you can try and click the switch user button.
Re: Switch Accounts issues
Sent the DM. Sorry for the late response to this. Hopefully, we can figure it out ;u;
Re: Switch Accounts issues
Dear @RinRose7
sorry for the late reply. Based on what I see from the screenshot you sent me - the code is not the same. You have
instead of
Please re-check the code you copy/paste, the one I shared with you was correct
sorry for the late reply. Based on what I see from the screenshot you sent me - the code is not the same. You have
|
|
Please re-check the code you copy/paste, the one I shared with you was correct
Re: Switch Accounts issues
So I did do the right copy and paste link, but it keeps changing it to the $, how do I stop it from doing that?
Re: Switch Accounts issues
did you try to click the button "switch editor mode " when you paste the code ?
Re: Switch Accounts issues
skouliki wrote:you are right i just tested it... its change automatically to me also
About this specific issue I do not know how to relate, because it is ACP side - maybe it is a bug?
Even if it's weird because the character
|
edit: I tried, and it happens for me as well.. it may be a problem to report
In the meantime you can:
- Add the script code in Module > HTML & Javascript > Javascript management
- Code:
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();
});
});
}
- Add only the second part in the widget
- Code:
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();" />
But in any case @skouliki I think this is something that should be reported to the Pro Admins
skouliki, TonnyKamper and RinRose7 like this post
Re: Switch Accounts issues
Okay so it seems to be clickable now but when I try to switch users it's not switching the users
Re: Switch Accounts issues
Hello,
I tried that way
Working but cannot see clearly where to put username and password. Maybe just a css issue on my side
Works and switch is ok
For the $ changed into $ its long known issue (same on the welcome message on index). Just change $ with jQuery and it's fine.
I tried that way
Working but cannot see clearly where to put username and password. Maybe just a css issue on my side
Works and switch is ok
- Code:
<script type="text/javascript">
function switch_accounts() {
jQuery('#main-user-menu li:last a').attr('id','logout');
jQuery.get(document.getElementById('logout').href, 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();" />
For the $ changed into $ its long known issue (same on the welcome message on index). Just change $ with jQuery and it's fine.
skouliki, TonnyKamper and RinRose7 like this post
Re: Switch Accounts issues
@Neptune- as the switch accounts system is not a Forumotion fetcher We would not report it to our tech team.
Re: Switch Accounts issues
That worked :O Thank you so much for everyone's work!! I really appreciate it. Marking it as solved now!
Niko and TonnyKamper like this post
Re: Switch Accounts issues
Problem solved & topic archived.
|
Similar topics
» Switch Accounts Widget
» Switch Accounts isn't working
» Switch accounts widget doesn't work
» Recent Forum Issues (Notifications, Slow Loading, Chatbox, Servimg and Tagging Issues)
» Account Switch
» Switch Accounts isn't working
» Switch accounts widget doesn't work
» Recent Forum Issues (Notifications, Slow Loading, Chatbox, Servimg and Tagging Issues)
» Account Switch
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum