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 03-05-2005 09:55 PM

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.

Lionel 03-05-2005 10:19 PM

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.

Alasse 04-03-2005 07:47 PM

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.

Azhrialilu 04-03-2005 08:12 PM

All you need to do is use the user id number instead of the name... at least that works for me ;)

Alasse 04-04-2005 12:41 AM

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 ^_^

lasto 04-04-2005 01:40 AM

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).

Marco van Herwaarden 04-04-2005 08:27 AM

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.

Alasse 04-30-2005 12:31 AM

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 ^^

Reeve of shinra 04-30-2005 12:57 AM

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?

dsboyce8624 06-10-2005 08:07 PM

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.


All times are GMT. The time now is 02:21 PM.

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.01394 seconds
  • Memory Usage 1,764KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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