Version: 1.2., by Ianomed
Developer Last Online: Dec 2005
Version: 3.0.3
Rating:
Released: 10-24-2004
Last Update: 11-16-2004
Installs: 23
DB Changes
No support by the author.
Quick Account Switch v1.2.
by Ianomed
Uses of this hack:
This account will let you string together several accounts owned by the same person. Of course it will also let you string together accounts owned by different people, but that's a dangerous thing to do.
What then is the use of stringing accounts together? Well, this hack will let you switch from one to the other account without having to log out, then log in again. Those interested in the technical aspect I refer to the addition made to login.php, it's all quite simple. You'll see now why it's dangerous to string together your account with someone else's, they'd be able to switch to your account.
I wrote this for two play-by-board RPGs that I frequent, at each of which I have several accounts, an account for each character. This lets me assume another account in moments.
It's also used by admins to switch between test accounts quickly.
Maybe you'll find other uses, eh?
Changes required:
Adding of 1 field to user table (installer will try to do this)
Adding of 18 phrases (installer does this)
An addition to admincp/user.php
An addition to global.php
An addition to login.php
A modification to the navbar template (for each style)
Time needed: 20-30 minutes Difficulty rating: moderate
Known issues with v1.2:
Changing the username of an account that's either a slave or master, it does not update these cached usernames. This will be taken care of in v1.3.
Work-around: If you rename a user, unlink it first, and relink after the renaming.
Since I don't see this happening very often on any board I'm releasing v1.2 with this caveat.
Item of note:
For some obscure reason vBportal does NOT play nice with this hack. It'll introduce cookie/header errors. Either do not install this hack if vBportal is installed, or vice versa. Since I don't plan on spending $20 to buy software I'll never use, there's no intention on my part to work out that problem. You're good to go with vbadvanced CPMS, however, this has been tested.
Warranties:
None, in the instructions you'll notice I tell you to backup before applying the hack. I've tested it on 4 boards, each of which have additional hacks installed, and it runs on many more. If it doesn't for you then, well... roll back the changes you've just made and blame yourself.
Tested (and works) on:
vB 3.0.3. - vanilla
vB 3.0.1. - vanilla
vB 3.0.3. - With vbAdvanced Homepage / CPMS (out of the box)
vB 3.0.1. - With vbAdvanced Homepage / CPMS (out of the box)
v 1.3 - Optionally displaying the linked accounts on the public profile. (i.e. 'I am also ....')
v 1.3 - Fix user rename issue (see known issues, above).
v 1.3 - Under Users in the ACP add a Manage Linked Accounts option, listing all linked accounts and their slaves.
v x.x - Very maybe: allow sharing of a secondary account between two users. This is the trickiest of all, since when on that account, who should you allow switching back to in a way that can't be circumvented.
Future non-plans (I will probably never implement these):
Removed username colouring, it's not really necessary and only adds extra queries.
No longer uses a custom profile field, instead an extra field in the usertable is made
Fully phrased, installer written to add phrases
The usernames for the linked accounts are cached, this means that running the hack now takes no extra queries at all for those logged on as master, or who have no linked accounts. Being logged on as a slave account adds only 1 query per page view, this used to be more too.
v1.1.1 - 27th October
Fixes session expiration problem occuring after switch. Users are encouraged to upgrade. To upgrade follow the instructions in switch_11_to_111.txt. For new installs the corrected code is in switch_111.txt, the installation instructions.
v1.1 - 26th October
Fixes a flaw where on some MySQL versions IDs were matched improperly, also the new session is now permanent. Users are encouraged to upgrade.
To upgrade roll back and redo the changes to global.php and login.php, no changes were made to the template or custom field.
v1.0 - 25th October 2004
initial release
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
that part in the php I just quoted (with the license replaced)... it should give you the same number as the header of the file:
Code:
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.0.3 - Licence Number Lxxxxxxx
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000–2004 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
Now I do acknowledge that what you may find in both places may not start with an L, as I said I've only worked with leased boards <g>.
But that number, which appears several times in login.php (including the preceding letter), is what we're after to put in the cookie code for the switch section. It needs after all create a compatible cookie to work
that part in the php I just quoted (with the license replaced)... it should give you the same number as the header of the file:
Code:
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.0.3 - Licence Number Lxxxxxxx
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000–2004 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
Now I do acknowledge that what you may find in both places may not start with an L, as I said I've only worked with leased boards <g>.
But that number, which appears several times in login.php (including the preceding letter), is what we're after to put in the cookie code for the switch section. It needs after all create a compatible cookie to work
*sigh*
ok...i know where that location of Lxxxxxxx is (and FWIW my license number also starts w/ L and it's an owned license )...i'm just going to have to do a find and replace of the old lic.# vs. new lic.#
ok, i got the login.php file updated...my code did look slightly different but I found the old Lxxxxxx value and replaced it w/ my new one that's good news. we'll see if the problem repeats itself (shouldn't)
and fyi i have to update every .php file w/ my new license number yay