The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Switch Accounts issues

5 posters

Go down

Solved Switch Accounts issues

Post by RinRose7 Wed 13 Jan - 20:29

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 24 Jan - 16:48; edited 1 time in total
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Wed 13 Jan - 20:32

Hello
Can you post the code please
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Wed 13 Jan - 20:35

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.
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Thu 14 Jan - 8:21

yes i have also the same code 
this code works for all versions besides Awesome
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Switch Accounts issues

Post by Niko Thu 14 Jan - 9:22

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:
Niko
Niko
Helper
Helper

Male Posts : 2722
Reputation : 186
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

skouliki and SarkZKalie like this post

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Thu 14 Jan - 10:50

i think the code is posted on ESF here by Ange if I am not mistaken
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Thu 14 Jan - 15:05

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.
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by Niko Thu 14 Jan - 15:15

@RinRose7 try to replace the first part of the code with this:
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 :rose:
Niko
Niko
Helper
Helper

Male Posts : 2722
Reputation : 186
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

TonnyKamper likes this post

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Thu 14 Jan - 15:26

Still having the same issues as I did beforehand. Won't let me click the 'Switch Account' and change users
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Thu 14 Jan - 16:18

I also tested and i have the same issue as RinRose7
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

TonnyKamper likes this post

Back to top Go down

Solved Re: Switch Accounts issues

Post by Niko Thu 14 Jan - 18:53

Can you guys provide me an example? Because I need to see it live to understand what happens thumright

and strangely it works for me, so I can't test it on my own Embarassed
Niko
Niko
Helper
Helper

Male Posts : 2722
Reputation : 186
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Thu 14 Jan - 18:59

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.
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by Niko Thu 14 Jan - 19:36

@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 :rose:

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.
Yes please, for both of them Glasses
Niko
Niko
Helper
Helper

Male Posts : 2722
Reputation : 186
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Thu 14 Jan - 19:44

Sent the DM. Sorry for the late response to this. Hopefully, we can figure it out ;u;
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Tue 19 Jan - 1:09

bumping this-
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by Niko Thu 21 Jan - 10:24

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
Code:
&#36
instead of
Code:
$

Please re-check the code you copy/paste, the one I shared with you was correct :rose:

Niko
Niko
Helper
Helper

Male Posts : 2722
Reputation : 186
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Fri 22 Jan - 15:37

So I did do the right copy and paste link, but it keeps changing it to the &#36, how do I stop it from doing that?
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Fri 22 Jan - 15:39

did you try to click the button "switch editor mode " when you paste the code ?
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Fri 22 Jan - 16:32

No, I did not but even then it's still doing the same thing
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Fri 22 Jan - 16:50

you are right i just tested it... its change automatically to me also
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Fri 22 Jan - 17:50

I wonder why its doing that shfjksd
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by Niko Sat 23 Jan - 19:09

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
Code:
$
is the most used in jquery and javascript codes, so it's strange.

edit: I tried, and it happens for me as well.. it may be a problem to report Embarassed
In the meantime you can:
  1. 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();
            });
            });
            }

  2. 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 Neutral
Niko
Niko
Helper
Helper

Male Posts : 2722
Reputation : 186
Language : English, Italian, French
Location : Italy

https://www.fmcodes.net/

skouliki, TonnyKamper and RinRose7 like this post

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Sun 24 Jan - 3:39

Okay so it seems to be clickable now but when I try to switch users it's not switching the users
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Back to top Go down

Solved Re: Switch Accounts issues

Post by Neptune- Sun 24 Jan - 14:02

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

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 &#36 its long known issue (same on the welcome message on index). Just change $ with jQuery and it's fine.
Neptune-
Neptune-
Forumember

Female Posts : 496
Reputation : 104
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : Scotland, UK

https://www.galaxie-series.net/

skouliki, TonnyKamper and RinRose7 like this post

Back to top Go down

Solved Re: Switch Accounts issues

Post by Ape Sun 24 Jan - 16:31

@Neptune- as the switch accounts system is not a Forumotion fetcher We would not report it to our tech team.


Switch Accounts issues Left1212Switch Accounts issues Center11Switch Accounts issues Right112
Switch Accounts issues Ape_b110
Switch Accounts issues Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 18708
Reputation : 1960
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Switch Accounts issues

Post by RinRose7 Sun 24 Jan - 16:48

That worked :O Thank you so much for everyone's work!! I really appreciate it. Marking it as solved now!
RinRose7
RinRose7
New Member

Other / Decline to state Posts : 13
Reputation : 2
Language : English

https://talesofioshora.forumotion.com/

Niko and TonnyKamper like this post

Back to top Go down

Solved Re: Switch Accounts issues

Post by skouliki Sun 24 Jan - 18:06

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 14237
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum