Last edited by RinRose7 on 24/1/2021, 10:48; edited 1 time in total
5 posters
Switch Accounts issues
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°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 24/1/2021, 10:48; edited 1 time in total
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°2
Re: Switch Accounts issues
Hello
Can you post the code please
Can you post the code please
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°3
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.
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°4
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
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests
Niko- Helper
- Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy
- Post n°5
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
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°6
Re: Switch Accounts issues
i think the code is posted on ESF here by Ange if I am not mistaken
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°7
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.
Niko- Helper
- Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy
- Post n°8
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
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°9
Re: Switch Accounts issues
Still having the same issues as I did beforehand. Won't let me click the 'Switch Account' and change users
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°10
Re: Switch Accounts issues
I also tested and i have the same issue as RinRose7
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests
TonnyKamper likes this post
Niko- Helper
- Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy
- Post n°11
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
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°12
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.
Niko- Helper
- Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy
- Post n°13
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.
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°14
Re: Switch Accounts issues
Sent the DM. Sorry for the late response to this. Hopefully, we can figure it out ;u;
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°15
Re: Switch Accounts issues
bumping this-
Niko- Helper
- Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy
- Post n°16
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
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°17
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?
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°18
Re: Switch Accounts issues
did you try to click the button "switch editor mode " when you paste the code ?
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°19
Re: Switch Accounts issues
No, I did not but even then it's still doing the same thing
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°20
Re: Switch Accounts issues
you are right i just tested it... its change automatically to me also
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°21
Re: Switch Accounts issues
I wonder why its doing that shfjksd
Niko- Helper
- Posts : 3285
Reputation : 254
Language : English, Italian, French
Location : Italy
- Post n°22
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
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°23
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
Neptune-- Forumember
- Posts : 496
Reputation : 104
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : Scotland, UK
- Post n°24
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
Ape- Administrator
- Posts : 19435
Reputation : 2010
Language : fluent in dork / mumbojumbo & English haha
- Post n°25
Re: Switch Accounts issues
@Neptune- as the switch accounts system is not a Forumotion fetcher We would not report it to our tech team.
RinRose7- New Member
- Posts : 13
Reputation : 2
Language : English
- Post n°26
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
skouliki- Manager
- Posts : 15391
Reputation : 1709
Language : English,Greek
Location : Greece
- Post n°27
Re: Switch Accounts issues
Problem solved & topic archived.
|
    General Rules | Tips & Tricks | Lost Founder Password?Â
   Rules of the Graphic Design Section | Sticker Points |  Graphic Requests