Account Switch Primer

Users should come to the Embassy to make all suggestions, bug reports, complaints, and anything else relating to the forum itself. The Embassy Control staff will take all issues seriously. Or kill you. One of the two. Possibly both.
Post Reply
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Account Switch Primer

Post by Wildfire »

The purpose of this mod is for people to be able to link several account together, and easily switch between them all. Here's the super-quick primer on what you need to do to get started:

Pick an account

There isn't really a primary account with this setup, but you have to start somewhere. Go into the profile for the account. Scroll down a bit and you'll see a new section that says Account Link. Off to the side, there is a little text that says 'Click here to obtain a PID'. Click there :) You'll be on a page caled PID Request. Enter the usename and password for the account you are in, and then a 5 digit Personal ID. Its a stupid script, if your PID is taken, all it will do is say sorry, that's in use, try again. If its not taken, the script will say your profile has been updated, and set your PID in the database. Remember that PID :)

Link an account

Log out of the account you just set your PID in. Login to an account you'd like to link to the first. Go into your profile, and scroll down to Account Link, but instead of clicking to get a PID, you will enter the Username and Password of that first account, and the PID you just set. Submit the profile, and now when you go to the Index, the Switch jumpbox in the upper left should have the two account names listed in it. You can now link any number of accounts with your PID and a username/password pair of an account that you have already linked.

Switching Accounts

Go up to the dropbox in the upper left, choose which linked account you want to switch to, and hit Switch. That's it. The account you were in is logged out, and the one you picked logged in.
_
"Are you alright?"
"I'm a little fucked up in general so its hard to tell."
User avatar
JohnnyRico
Wuffle Student
Posts: 1254
Joined: Mon Mar 18, 2002 1:11 pm
Location: Hell on Earth, in the Greatest state of the Union
Contact:

Post by JohnnyRico »

Wildfire, you Rock!
"I have a conundrum for you. A riddle if you will. What's the difference between you, and malard with a cold? I don't remember how it ends, but your mothers a whore." -"Sean Connery" Celebrity Jeopardy- SNL
User avatar
DV8
Evil Incarnate
Posts: 5986
Joined: Mon Mar 18, 2002 6:49 am
Location: .nl
Contact:

Post by DV8 »

If I ever have a baby girl, it will be named Sara.
User avatar
Sorrow
Wuffle Trainer
Posts: 1465
Joined: Fri Apr 05, 2002 10:00 pm
Location: This scepter'd isle

Post by Sorrow »

All over the PHP burnout, are we? You rule.
<hr size=1 color=#5c7898><font face=font face="Verdana, Arial, Helvetica" color=#6600FF>The more I overcome, the stronger I become
- Angel of Ruin<a href=http:\/www.chaosengine.com>.</a></font>
Ryan Murphy
Wuffle Grand Master
Posts: 1848
Joined: Fri Apr 12, 2002 3:16 am

Post by Ryan Murphy »

Sweet Jesus, I love you Wildfire :)
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

Thanks guys :D Actually, this was the cause of PHP burnout for a while, coding it and trying to keep it simple so that it can go into the phpBB Community Mods. (Which, hopefully will go through soon). Got a few other web projects I'm behind in, and some non-coding projects to finish, and I'll be back working on the Suggestion list.
_
"Are you alright?"
"I'm a little fucked up in general so its hard to tell."
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

Thanks guys :aww :D Actually this was the cause of earlier PHP burnout, tweaking it and documenting it for submission to the phpBB Community. Got a few projects both coding and not I've been neglecting, but I'll be back working on the Suggestions list soon.
_
"Are you alright?"
"I'm a little fucked up in general so its hard to tell."
User avatar
Thorn
Wuffle Student
Posts: 1390
Joined: Mon Mar 11, 2002 11:10 pm
Location: The Cave, Cheeseland, USA

Post by Thorn »

So, uh, that was an order for buckeyes at the Gathering, right?

*Thorn goes to start buying ingredients for 8 kabillion buckeyes.* :D
_<font color=red size=2>Just wait until I finish knitting this row.</font>
User avatar
Memory
Wuffle Trainer
Posts: 1498
Joined: Mon Mar 18, 2002 9:19 am
Location: U.K.

Post by Memory »

Two Questions:

1) What is a 'Buckeye'? Dare I ask?

2) Why won't the board let me enter the same email address for multiple accounts? Is it used as a primary key? Or just a security feature, so I can't enter someone else's email by mistake?
_<font color="#5C7898">"You know, Memory?
I'd have to say that you are one cool, fucked-up guy.
Just like the rest of us.
It's a pleasure reading your posts in the morning over a cup of coffee. “ – JetPlane</font>
User avatar
3278
No-Life Loser
Posts: 10224
Joined: Thu Feb 14, 2002 8:51 pm

Post by 3278 »

Memory wrote:2) Why won't the board let me enter the same email address for multiple accounts? Is it used as a primary key? Or just a security feature, so I can't enter someone else's email by mistake?
Shit. I knew there was something else.
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

Buckeyes! ^_^ Loverly concoctions of chocolate coated peanut butter with extra sugar...yummy

Email addresses, er, all my accounts have the same email address, possibly a 2.0 and higher feature that got turned on by default on upgrade?
_
"Are you alright?"
"I'm a little fucked up in general so its hard to tell."
User avatar
DV8
Evil Incarnate
Posts: 5986
Joined: Mon Mar 18, 2002 6:49 am
Location: .nl
Contact:

Post by DV8 »

Question: Is there any way where the account switcher can be expanded so as to have the option of an autologin switch? Now if I use it, I am always logged out at the end of a visit to bulldrek.
User avatar
Memory
Wuffle Trainer
Posts: 1498
Joined: Mon Mar 18, 2002 9:19 am
Location: U.K.

Post by Memory »

Wildfire wrote: Email addresses, er, all my accounts have the same email address, possibly a 2.0 and higher feature that got turned on by default on upgrade?
Noting 3-2's reaction I'm guessing it's going to be turned off again. :)

Any chance you can let me know when this has happened?
Last edited by Memory on Thu May 23, 2002 1:39 pm, edited 1 time in total.
_<font color="#5C7898">"You know, Memory?
I'd have to say that you are one cool, fucked-up guy.
Just like the rest of us.
It's a pleasure reading your posts in the morning over a cup of coffee. “ – JetPlane</font>
User avatar
3278
No-Life Loser
Posts: 10224
Joined: Thu Feb 14, 2002 8:51 pm

Post by 3278 »

I've been thinking about that, too. It'd be nice if it would detect the state of the checkbox initially, and save that across accounts, but if not, it'd be nice to just default to autologin. Of course, people on shared machines would want to make sure they log out...
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

Actually, wouldn't be too terribly hard, have to move autologin to a profile field, and if its set to "On", the switch will set that flag when it starts the new session. Will require you set autologin to "On" for every account, but should work. I'll get back to that sometime soon.
_
"Are you alright?"
"I'm a little fucked up in general so its hard to tell."
User avatar
Bethyaga
Knight of the Crimson Assfro
Posts: 2777
Joined: Mon Mar 11, 2002 10:39 pm
Location: Nebraska, USA
Contact:

Post by Bethyaga »

Thank you, Wildfire.
_Whoever invented that brush that goes next to the toilet is an idiot, cuz that thing hurts.
User avatar
3278
No-Life Loser
Posts: 10224
Joined: Thu Feb 14, 2002 8:51 pm

Post by 3278 »

As far as I'm concerned, we could leave it on permanently for everyone, like v0.2. Then people just need to log out if they're leaving the machine. But that's just me. Maybe we could vote, if I'm not the only person who feels that way.
Mike Jones
Tasty Human
Posts: 1
Joined: Wed Mar 13, 2002 1:37 pm

Post by Mike Jones »

3278 wrote:As far as I'm concerned, we could leave it on permanently for everyone, like v0.2. Then people just need to log out if they're leaving the machine. But that's just me. Maybe we could vote, if I'm not the only person who feels that way.
I agree.

[PS--I love account switching.]
User avatar
Sorrow
Wuffle Trainer
Posts: 1465
Joined: Fri Apr 05, 2002 10:00 pm
Location: This scepter'd isle

Post by Sorrow »

So what you're saying, 32, is that if I just close the browser window, I'd still be logged in when I open a new window later and head over here?

Hmmm ... not sure about that. When I'm at work I don't always remember to log out; I may just ALT+F4, lock the workstation and go.
<hr size=1 color=#5c7898><font face=font face="Verdana, Arial, Helvetica" color=#6600FF>The more I overcome, the stronger I become
- Angel of Ruin<a href=http:\/www.chaosengine.com>.</a></font>
User avatar
3278
No-Life Loser
Posts: 10224
Joined: Thu Feb 14, 2002 8:51 pm

Post by 3278 »

Sorrow wrote:So what you're saying, 32, is that if I just close the browser window, I'd still be logged in when I open a new window later and head over here?

Hmmm ... not sure about that. When I'm at work I don't always remember to log out; I may just ALT+F4, lock the workstation and go.
Well, that's the problem. Same as it was on v0.2, if you recall. If for no other reason than I'm used to it, I don't mind. But I generally only login from secure locations, so...
User avatar
Sorrow
Wuffle Trainer
Posts: 1465
Joined: Fri Apr 05, 2002 10:00 pm
Location: This scepter'd isle

Post by Sorrow »

Been a while since I've logged into v0.2 ;) Actually, it's probably not a problem, since the workstation's generally locked if I'm not there.
<hr size=1 color=#5c7898><font face=font face="Verdana, Arial, Helvetica" color=#6600FF>The more I overcome, the stronger I become
- Angel of Ruin<a href=http:\/www.chaosengine.com>.</a></font>
User avatar
Thorn
Wuffle Student
Posts: 1390
Joined: Mon Mar 11, 2002 11:10 pm
Location: The Cave, Cheeseland, USA

Post by Thorn »

I like the all autologin all the time option too. For those of us who share computers with people we can trust, it's all fine. grin!
_<font color=red size=2>Just wait until I finish knitting this row.</font>
User avatar
Wildfire
Wuffle Trainer
Posts: 1597
Joined: Mon Mar 18, 2002 10:13 am

Post by Wildfire »

a 5 digit Personal ID
Just a reminder, your PID MUST be 5 digits, as in the 0 through 9 variety. Also '0' is no longer a valid PID, its being used as an error check condition. I believe those affected by the verification code change have already been notified.
_
"Are you alright?"
"I'm a little fucked up in general so its hard to tell."
User avatar
Kai
Wuffle Master
Posts: 1627
Joined: Fri Dec 13, 2002 8:22 pm
Contact:

Post by Kai »

Front page bump

10:41 Kai: Ohayou minna
10:42 Adam: ENGLISH MOTHERFUCKER! :)
10:44 Kai: Fuck off, how's that? ;P
10:45 Adam: Much better.
User avatar
Daki
No-Life Loser
Posts: 10211
Joined: Mon Mar 25, 2002 6:36 pm
Location: Chicago
Contact:

Post by Daki »

Missed this the first time through but appreciate the bump. Now Gunny and I can switch accounts easier. Arigato Gozaimasu WF. *bow*
User avatar
Bishop
Grand Marshall of the Imperium
Posts: 3661
Joined: Mon Mar 18, 2002 7:54 pm
Location: Sheridan, Michigan.

Post by Bishop »

Thank you thank you thank you
Pax Romana, Motherfucker.
Breaker of unbreakable things.
User avatar
DV8
Evil Incarnate
Posts: 5986
Joined: Mon Mar 18, 2002 6:49 am
Location: .nl
Contact:

Post by DV8 »

Could the account-switch combo-box be sorted by something that makes sense?
User avatar
3278
No-Life Loser
Posts: 10224
Joined: Thu Feb 14, 2002 8:51 pm

Post by 3278 »

What the devil is it sorted by now? It's neither alphabetical nor chronological, but it's always in the same order.
User avatar
DV8
Evil Incarnate
Posts: 5986
Joined: Mon Mar 18, 2002 6:49 am
Location: .nl
Contact:

Post by DV8 »

Exactly my bafflement. :)
User avatar
Kai
Wuffle Master
Posts: 1627
Joined: Fri Dec 13, 2002 8:22 pm
Contact:

Post by Kai »

Its a very stupid query that simply says give me accounts with the PID, so however they are sorted in the user table (generally, but not always, by user_id) is however it gets displayed. Did you want it sorted by something in particular?

10:41 Kai: Ohayou minna
10:42 Adam: ENGLISH MOTHERFUCKER! :)
10:44 Kai: Fuck off, how's that? ;P
10:45 Adam: Much better.
User avatar
DV8
Evil Incarnate
Posts: 5986
Joined: Mon Mar 18, 2002 6:49 am
Location: .nl
Contact:

Post by DV8 »

Preferably...

[current username]
-----------------------
[username1]
[username2]
[username3]
[username4]

...but I'll settle for alphabetically. :)
User avatar
Kai
Wuffle Master
Posts: 1627
Joined: Fri Dec 13, 2002 8:22 pm
Contact:

Post by Kai »

Alright :) Its due for a rewrite anyways with some better redirecting, I'll make it sort intellegently, at minimum display current username first and the rest alphabetically.

10:41 Kai: Ohayou minna
10:42 Adam: ENGLISH MOTHERFUCKER! :)
10:44 Kai: Fuck off, how's that? ;P
10:45 Adam: Much better.
~m~
Tasty Human
Posts: 5
Joined: Thu Feb 17, 2005 11:37 pm

Post by ~m~ »

I'm trying to install this switch on my own phpBB - I know this isn't a support forum for this hack, but I'm having lots of problems and don't know where else to go for help!

So far I've dealt with one problem, which was that when I was trying to assign a PID to an account I was getting the following error:

"Sorry, Personnel IDs must be numerical in value. Please go back and try again.
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"

This was fixed using some code suggested on the forums at phpbbhacks.com:

In pid.php, replace:
$pid = (ereg("^[0-9]+$", $pid)) ? $pid : '0';

with:
$pid = (ereg("^[0-9]+$", $HTTP_POST_VARS['pid'])) ? $HTTP_POST_VARS['pid'] : '0';
$username = isset($HTTP_POST_VARS['username']) ? trim(htmlspecialchars($HTTP_POST_VARS['username'])) : '';
$username = substr(str_replace("\\'", "'", $username), 0, 25);
$username = str_replace("'", "\\'", $username);
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';

So now I can assign a pid to an account. However, I still can't manage to link one account to another. There was a suggestion on the same discussion at phpbbhacks.com (which you can see here: http://www.phpbbhacks.com/forums/viewtopic.php?t=34389 ), that this is something to do with an unassigned variable or two.

Can anyone help with this? Please feel free to pm me rather than clogging up this board with technical discussions, if you'd rather.

Many thanks in advance.
~m~
User avatar
DV8
Evil Incarnate
Posts: 5986
Joined: Mon Mar 18, 2002 6:49 am
Location: .nl
Contact:

Post by DV8 »

~m~ wrote:$pid = (ereg("^[0-9]+$", $pid)) ? $pid : '0';
...
$pid = (ereg("^[0-9]+$", $HTTP_POST_VARS['pid'])) ? $HTTP_POST_VARS['pid'] : '0';
Try and taking the quotations from around the 0, otherwise it'll treat it as a string instead of a numeric value.
~m~
Tasty Human
Posts: 5
Joined: Thu Feb 17, 2005 11:37 pm

Post by ~m~ »

Thanks - I tried that, but still no joy :(

Just to clarify, my current situation is that I have 2 accounts, one has a pid assigned (I have checked that it really is assigned, and really is the correct value, by looking at the database directly).

The second account has no pid. When I go in to the profile of the second account and try to link it to the first, it claims it has linked properly (I get the "your profile has been updated" message), but the accounts don't link.

When logged into the first account, which has a pid, that account is visible in the account switch box at the top of each page, but the second account isn't. When logged into the second account, there are no options listed in the account switch box.

:(
~m~
Tasty Human
Posts: 5
Joined: Thu Feb 17, 2005 11:37 pm

Post by ~m~ »

Something has occurred to me, that fits with the comments on phpbbhacks.com that it might be something to do with undefined variables.

When you enter your username, password and pid of the account you want to link on the profile page, the variables are called linkname, linkpass and linkpid, respectively.

The form action is "login.php", but when I look through login.php, none of the Account Switch variables, linkname, linkpass, or linkpid, are mentioned anywhere. I'm guessing they should be? So does login.php need to be altered somehow?

This is just a guess on my part, though - I could be totally wrong!

Thanks again :)
~m~
User avatar
Kai
Wuffle Master
Posts: 1627
Joined: Fri Dec 13, 2002 8:22 pm
Contact:

Post by Kai »

Best guess is that between versions this was tested on, phpBB discontinued the use of register_globals, meaning variables are handled in a completely different manner, which may cause things to not work.

10:41 Kai: Ohayou minna
10:42 Adam: ENGLISH MOTHERFUCKER! :)
10:44 Kai: Fuck off, how's that? ;P
10:45 Adam: Much better.
~m~
Tasty Human
Posts: 5
Joined: Thu Feb 17, 2005 11:37 pm

Post by ~m~ »

:(

That's not good news!

If anyone has any idea how I can fix this I would be so grateful!

Thanks,
~m~
~m~
Tasty Human
Posts: 5
Joined: Thu Feb 17, 2005 11:37 pm

Post by ~m~ »

In case anyone else is interested, I have finally solved this problem, and posted the full solution here:

http://www.phpbbhacks.com/forums/viewtopic.php?p=190591

~m~
Post Reply