vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Quick Account Switch v1.2 (https://vborg.vbsupport.ru/showthread.php?t=70971)

Ianomed 10-24-2004 10:00 PM

Quick Account Switch v1.2
 
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

Polo 10-25-2004 03:29 PM

Interesting :)

Azhrialilu 10-25-2004 03:30 PM

I can confirm the working of this :D

Ianomed 10-25-2004 03:33 PM

Ah yes, my first beta tester. Hi Azh. :D

Hopefully it'll be useful to you as well, Polo.

Red Blaze 10-25-2004 03:52 PM

Nice, I could use this for easy switching testing different usergroups. Thanks alot. :)

Ianomed 10-25-2004 03:57 PM

My pleasure Sonikku, please remember to click Install if you end up using it. That way if I release an update you'll be notified of this as well.

At one of the RPG boards this is now in use allowing 6 people to switch between their various accounts with success. It's a hit there. :)

Lionel 10-25-2004 04:11 PM

How long have you been testing or using this?

Ianomed 10-25-2004 04:28 PM

Hi Lionel,

It's a dead simple hack that I wrote it in a manner of hours. A friend and I have tested it on 4 different boards for a couple of hours as well, on which it's officially live as of today to the members' joy.

If you're worried about security, there's nothing in the hack that makes the board more insecure/secure than it was before. The user's current session is checked against on switching.

If you're logged on as a master account you can switch to your slave accounts, and if you're currently logged on to a slave account you can switch to your master account (or possible additional slave account).

Simply trying someone else's userID in the URL parameter will fail to achieve anything :)

Feel free to take it apart on a test installation if you care to examine this for yourself. As a matter of speaking this is a good thing to do for any hack whatsoever by anyone. Tinkering with productions boards should be approached with caution, as always.

nexialys 10-25-2004 04:45 PM

simple hack ?!.. wrote in hours ?!... damn, welcome home, join the coders club... this is a quite good piece of work !!

it's even better than what i've played with lately (different cookie for admincp) ... and it's acting exactly like the "Fast User Switching" on my OS-X !!! http://images.apple.com/macosx/featu...nu10082003.jpg

Ianomed 10-25-2004 05:03 PM

I'm glad you like it so much, Nexialys :D

It's my first publicly released hack for vB. Before this I did a couple of custom ones, mainly also RPG related in some way or another: a Warp Speed calculator, Stardate Calendar.

Then there's another small hack which will make the referrer a mandatory field on registration, and will send the sponsor a PM from the administrator, to confirm they did indeed refer the person.

It's quite fun to write hacks for vB :)

Lionel 10-25-2004 05:08 PM

that does not work for me with 3.01 and vbadvanced. In advanced page (I harcoded the link to login in global.php) it displays the toggle, but when I select a username, it takes me to a blank page.

On forumhome, the toggle does not display at all.

And yes, I have a valid licence :-)

nexialys 10-25-2004 05:11 PM

Quote:

Originally Posted by Lionel
And yes, I have a valid licence :-)

fiou... i hope for you... with 590 posts already done, no license would be futile.. lol..

btw, do you have anyother hack related to login or identification install on your board ?!...

Lionel 10-25-2004 05:14 PM

Haha... I do not remember. The board has so many hacks. But I do have a problem for four weeks now with who's online.

Ianomed 10-25-2004 05:22 PM

Lionel, within the forum itself does it switch proper?

Secondly: do you have the forum in /forum, and the site in /, or something similar? or are the forum and portal both in the same directory?

Thirdly (and lastly): vbadvanced or vbadvanced CPMS, and which version?

My beta tester, AzhriaLilu, ran this hack succesfully on a modded 3.0.3. with vbadvanced CPMS, perhaps it's a 3.0.1. specific issue, or doesn't work with the standard portal out of the box. I'll have a look either way.

It's been tested solely on 3.0.3. (with various previous modifications on 3 of the boards), which is why I listed it as a requirement in the instructions.

I'll get back to you on this, with some changes perhaps it can be made tick for 3.0.1. and vbA as well. *goes and finds the 3.01 installer* :)

Lionel 10-25-2004 05:23 PM

I think I am going to do a beyond compare to see what is messed up with my who's online. Maybe that will solve the problem. I went to every single function line by line, every relevant php, except login.php

Lionel 10-25-2004 05:33 PM

Ianomed, the condition does not applies at all in the forum. I does not display at all. I logged off, log back on, nothing, nada.

I have vbadvanced regular installed at root and forum on a directory under.

That hack was like God sent for me. It's a shame what is happening to me.

The board has been behaving erratically. I installed the mod management hack last week, no template will display. I placed an echo "hello"; at the top, it started displaying. The next day, it gave me an error message about header, then I removed the echo, and by accident I clicked on the link, and voila, like by magic, it worked.

Who's online? Sometimes I see no one, but I know they are online. Some other times, I see 2 of myself. :speechless:

Ianomed 10-25-2004 05:45 PM

Hmmm, it sure does sound something else was messed up good before you installed this hack. I'll still install vbadvanced regular on 3.0.1. here to see what it does, but I can't guarantee anything.

If there's something specific to vbA and 3.0.1. in accordance with this hack I'll find it, if not then it appears your board's prior state is likely the culprit somehow. :(

Sadly you have a looooooottt of hacks installed, as you say, or I would suggest upgrading to vB 3.0.3. and reapply vbA and this hack. With a board that start working like magic, who knows what can happen? ;)

Speaking of which, we know it works on CPMS, since this we tested. The 'diet' version as yet goes untested, so this I'll take along with it on my todo list.

Ianomed 10-25-2004 07:39 PM

I've just tested this hack on a vanilla (clean) install of vB 3.0.1., and it works perfectly.

Now to test with vBAdvanced homepage as well... *rolls drums*

HiDeo 10-25-2004 07:59 PM

Really interesting hack !

Thanks

Oblivion Knight 10-25-2004 08:12 PM

Quote:

Originally Posted by nexialys
it's even better than what i've played with lately (different cookie for admincp)

Does this hack work ok in conjunction with your hack then? That is currently the only concern I have before installing this, sounds like a great idea and would enable me to quickly switch between my test account..

Ianomed 10-25-2004 08:16 PM

Lionel,

vBadvanced homepage on 3.0.1. works as well in conjunction with this hack. No problems. It lets you switch from within the portal and forums.

Sadly, for you that is, this brings me to the conclusion your previous hacks are incompatible. Your saying the board sometimes work, sometimes didn't strengthens that belief.

The good news is that I can now ratify this hack for 3.0.1. as well.

bondjetta 10-25-2004 08:30 PM

i have this problem daily on my forums (going between my admin account and my personal account) :( so thank you for this hack! :D I'll try it out tonight :)

Ianomed 10-25-2004 08:39 PM

Quote:

Originally Posted by Oblivion Knight
Does this hack work ok in conjunction with your hack then? That is currently the only concern I have before installing this, sounds like a great idea and would enable me to quickly switch between my test account..

I have no reason to believe it won't, but have downloaded the hack in question to make sure. I'll report my findings at both nexialys's forum and this thread. :)

Ianomed 10-25-2004 08:56 PM

Verdict: not only does it work, it rocks!
It's probably the best thing since sliced bread, the combination of these two hacks, lol.

Now it allows you to be logged on as an admin in the ACP while simultaneously you change between all measure of different test accounts to see your changes. :D

Nexialys' hack giving the ACP a seperate session means you won't be logged out of the ACP while you switch around in the forum.

Oblivion Knight 10-25-2004 10:26 PM

Excellent, thanks for testing that for me Ianomed.! :D

Ianomed 10-25-2004 10:36 PM

My pleasure, Oblivion Knight, I'm glad I did test it. :)
I've linked to Nexialys's hack now in the this thread's first post, because the combo just works so well.

Lionel 10-26-2004 12:26 AM

Ianomed thank you. I am going to troubleshoot, cause I am determined to have it work. It's like butter near my mouth and I can't grab it.

bondjetta 10-26-2004 12:42 AM

Ok, it's running well for me :) but no integration to VBindex. :(

vBulletin Version 3.0.3 & vBindex Version 3.0.0 RC5

oh wait, i don't care :D this is fantastic :D Thank you

Lionel 10-26-2004 12:51 AM

Good news. I put up a clean login.php, and it works on homepage. I still have to troubleshoot the forums.

Lionel 10-26-2004 03:08 AM

I am on the verge of committing vbsuicide.

I found the typo in login.php that was causing the blank page and it works now perfect on vbadvanced homepage. Still not in forums. I tried a clean copy of global.php, of online.php, of functions_online.php. I tried removing the condition, the image shows but the click is empty.

I do not know where to look anymore. What could cause the main forum to be blocked? Which major script in there that vbadvanced do not use? It's like the forums do not know it's me.

:tired:

Lionel 10-26-2004 03:37 AM

:banana: I found my problem.
Somehow, someday I woke up to find out that navbar for vbadvanced and forum got all messed up with the headers. Since that day, I have been carrying 2 navbars one for vbadvanced and one for vbulletin, both placed in their respective $header, that's for the loggedin bits. And used the normal navbar just for the links.

I just removed the condition in forum header (where the loggedin things are) and placed it anywhere in real navbar. That worked! :banana:

That is going to be some job to restore that navbar

Forgot to say thank you, for the hack, for the help, and maybe for that discovery that could finally fix my online problem

Lionel 10-26-2004 05:03 AM

All Fixed!

I dumped both $header and $index_header in the navbar. While doing so, I found out that there was a miscontructed conditional. Navbar template would not accept it, but both index did. It had to do with the hivenail hack. The conditional if bbuserinfo[userid] was not properly closed. I am leeping my fingers closed, maybe this is why the board was not recognizing me. Hehehe!

bendigo-tech 10-26-2004 06:01 AM

That could come in very handy. Thanks a lot! :)

kaotic 10-26-2004 08:17 AM

Genious! I've already thought of a creative method of use for this hack. Many thanks! :)

Oblivion Knight 10-26-2004 09:08 AM

Hmm.. When trying to switch to another account, I get the error:
Quote:

An error occurred while attempting to log you out. Click here to log out.
The only thing I've changed from your original hack is the navbar code because I didn't like the layout..

Lionel 10-26-2004 09:48 AM

Quote:

Originally Posted by Oblivion Knight
Hmm.. When trying to switch to another account, I get the error:

The only thing I've changed from your original hack is the navbar code because I didn't like the layout..

I get the same too. My observation is that this happens when you sstay inactive for a long time. And it will not log you out too sometimes.

Ianomed 10-26-2004 09:54 AM

Quote:

Originally Posted by Oblivion Knight
Hmm.. When trying to switch to another account, I get the error:

The only thing I've changed from your original hack is the navbar code because I didn't like the layout..

This can happen if you put spaces in the IDs linked, Oblivion.
Example, account 1 has secondary accounts 10 and 45, you would enter

10,45

and not:

10, 45

I'm just about to release v1.1, fixing something else. For now please be observant of the IDs as above. In a future version I'll provide an easier way to select the slave accounts.

Ianomed 10-26-2004 09:55 AM

Quote:

Originally Posted by Lionel
I get the same too. My observation is that this happens when you sstay inactive for a long time. And it will not log you out too sometimes.

The new session cookie was set to expire, instead of to last. This has been fixed in v1.1, which I',m about to release. So it could've been either of two things :)

Oblivion Knight 10-26-2004 10:01 AM

Hmm.. The ids were only separated by a commar and not a space.

It appears that the session has to be active before it can be switched. I successfully switched from my account to "Test Account", when trying to switch back I got the error occured while logging out again. I tested this again, this time clicking on a forum and returning to the forum home with Test Account, and switching back worked fine.

It appears that a bit more work is required with the queries or something, hopefully this issue is fixed with 1.1.. :)

Ianomed 10-26-2004 10:08 AM

Quote:

Originally Posted by Lionel
All Fixed!

I dumped both $header and $index_header in the navbar. While doing so, I found out that there was a miscontructed conditional. Navbar template would not accept it, but both index did. It had to do with the hivenail hack. The conditional if bbuserinfo[userid] was not properly closed. I am leeping my fingers closed, maybe this is why the board was not recognizing me. Hehehe!

Good to hear that, Lionel.

By the by, I've just released an important update (v1.1). It only requires to redo the additions to global.php and login.php, so no worries about the tempalte ;)


All times are GMT. The time now is 04:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01446 seconds
  • Memory Usage 1,845KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete