Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Quick Account Switch v1.2 Details »»
Quick Account Switch v1.2
Version: 1.2., by Ianomed Ianomed is offline
Developer Last Online: Dec 2005 Show Printable Version Email this Page

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:
  1. Adding of 1 field to user table (installer will try to do this)
  2. Adding of 18 phrases (installer does this)
  3. An addition to admincp/user.php
  4. An addition to global.php
  5. An addition to login.php
  6. 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)
  • vB 3.0.3. - With vBindex v3.0.0 RC5 (Instructions by bondjetta)
  • vB 3.0.3. - Nexialys - ACP cookie hack. <- Recommended combination
  • vB 3.0.1. - Nexialys - ACP cookie hack. <- Recommended combination
  • vB 3.0.3. - Assorted mods

Future plans:
  • 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):
  • A 'let users link accounts themselves' mode.

Thanks to Oblivion Knight for the updated dropdown look.

Enjoy

--- History ---
v1.2 - 17th November 2004
  • 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.

Comments
  #132  
Old 03-05-2005, 09:55 PM
Ianomed's Avatar
Ianomed Ianomed is offline
 
Join Date: Oct 2004
Location: The Netherlands
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I meant the vBindex addition of $account_master, as bondjetta (a.k.a. botanist) posted up when this had had just been published.

Good to see you've got QAS to work with vBa again.
Reply With Quote
  #133  
Old 03-05-2005, 10:19 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, you are doing great hacks. I just installed the embedded poll. I've always been annoyed to display it at top. Sometimes you don't even see it since it goes straight to the post.
Reply With Quote
  #134  
Old 04-03-2005, 07:47 PM
Alasse Alasse is offline
 
Join Date: Mar 2005
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wonderful Hack just one little thing wrong with it. If a user has an " ' " in their name (i.e Leo O'Connor, Hannah O'Brien etc.) that name won't be able to be linked to another users name.

That sounds a little confusing doesn't it? :nervous: so I'll give an tiny example.
Master: Jane
Slave: Mike O'Brien <~ won't work and brings up this error:

Code:
Database error in vBulletin 3.0.7:

Invalid SQL: 
		SELECT userid, username, qas
		FROM user
		WHERE username LIKE 'Mike O'Brien%'
	
mysql error: 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 'Brien%'' at line 3

mysql error number: 1064
The hack works for all my other users that don't have an " ' " in their name so I know I installed everything right and it's working perfect except for that one thing. I was hoping someone could tell me how to fix this? Thanks in advance.
Reply With Quote
  #135  
Old 04-03-2005, 08:12 PM
Azhrialilu's Avatar
Azhrialilu Azhrialilu is offline
 
Join Date: Aug 2003
Location: Stretton, Derbyshire
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All you need to do is use the user id number instead of the name... at least that works for me
Reply With Quote
  #136  
Old 04-04-2005, 12:41 AM
Alasse Alasse is offline
 
Join Date: Mar 2005
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Azhrialilu
All you need to do is use the user id number instead of the name... at least that works for me
Ah, I'll try that. Thanks

EDIT: Works like a Charm, Thanks again ^_^
Reply With Quote
  #137  
Old 04-04-2005, 01:40 AM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this fine for me to use on v 3.0.7 and set up a test account for each usergroup that only i know the password for (for test purposes).
Reply With Quote
  #138  
Old 04-04-2005, 08:27 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Alasse
Wonderful Hack just one little thing wrong with it. If a user has an " ' " in their name (i.e Leo O'Connor, Hannah O'Brien etc.) that name won't be able to be linked to another users name.

That sounds a little confusing doesn't it? :nervous: so I'll give an tiny example.
Master: Jane
Slave: Mike O'Brien <~ won't work and brings up this error:

Code:
Database error in vBulletin 3.0.7:
 
Invalid SQL: 
		SELECT userid, username, qas
		FROM user
		WHERE username LIKE 'Mike O'Brien%'
 
mysql error: 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 'Brien%'' at line 3
 
mysql error number: 1064
The hack works for all my other users that don't have an " ' " in their name so I know I installed everything right and it's working perfect except for that one thing. I was hoping someone could tell me how to fix this? Thanks in advance.
This means there is a potential SQL insertion vulnerability in this hack. To avoid problems everybody should edit their qas.php file and change the line:
PHP Code:
$condition "username LIKE '$u2%'"// search for usernames starting with 
into:
PHP Code:
$condition "username LIKE '" addslashes($u2) . "%'"// search for usernames starting with 
PS Don't have this installed, so above modification is not tested.
Reply With Quote
  #139  
Old 04-30-2005, 12:31 AM
Alasse Alasse is offline
 
Join Date: Mar 2005
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Find:
HTML Code:
	<if condition="$bbuserinfo['userid']">
Near this, find:
HTML Code:
	<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong>
After this (yes, before the <br />), add:
HTML Code:
                 	<!-- Quick Account Switch v1.2 -->
			<if condition="$account_master">
				<span id="switchacc"><a href="#switchacc"><strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong></a> <script type="text/javascript"> vbmenu_register("switchacc"); </script></span><br />
			<else />
				<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
			</if>
                 	<!-- Quick Account Switch v1.2 -->
That should say:

Quote:
Find:
HTML Code:
	<if condition="$bbuserinfo['userid']">
Near this, find:
HTML Code:
	<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong>
Replace With:
HTML Code:
                 	<!-- Quick Account Switch v1.2 -->
			<if condition="$account_master">
				<span id="switchacc"><a href="#switchacc"><strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong></a> <script type="text/javascript"> vbmenu_register("switchacc"); </script></span><br />
			<else />
				<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
			</if>
                 	<!-- Quick Account Switch v1.2 -->
The way it is now it'll show "Welcome User" twice one as a link one not as a link, just thought you should know ^^
Reply With Quote
  #140  
Old 04-30-2005, 12:57 AM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow I always thought of something like this since we allow aliases on our board.

Is anyone allowing thier regular member base to use this and how are you doing that?
Reply With Quote
  #141  
Old 06-10-2005, 08:07 PM
dsboyce8624 dsboyce8624 is offline
 
Join Date: May 2005
Location: New Jersey
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just so it's clear, because I didn't see actually stated, you need to add the account_master global variable to your vBa CMPS Default Settings page.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06369 seconds
  • Memory Usage 2,342KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (6)bbcode_html
  • (2)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete