Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 11-06-2002, 05:03 PM
rochen rochen is offline
 
Join Date: Apr 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hack like the vB members area forum access section?

In the vB members area to get customer level access to here and vb.com you need to enter your user. I presume when this is done it simply moves your user from one forum group to another?

Does anyone know of a hack to do this? I want to have a page like in the vb members area where customers can enter their forum user name and it will move them from the "Registered" group to a "Customer" group. Thus granting them access to a customer only forum.

At the moment we have to do these changes manually via the vB admin cp, which consumes time. If we had the same system setup as in the vB members area, this would be resolved.

Thanks
Reply With Quote
  #2  
Old 11-06-2002, 09:01 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually I didnt get the goal?

If I didnt get you wrong, you ask a link in User CP which is visible to ALL users and your users' usergroup will change automatically when they enter their "forum user names" there. It seems that everyforum member will be able to do it as everyone has a "forum user name" so what's the aim to do in the first place? You can just put all users in that special usergroup when they registered, or better, make your registered usergroup "special" by assigning the relevant permissions.

The hack would make sense if you wanted *some* of the registered users change their usergroup automatically. Eg. some are provided a password and by entering this password their usergroup would change. (like in vb.com). If this is what you want this algorithm here can help while you are building yours:
https://vborg.vbsupport.ru/showthrea...179#post301179
Reply With Quote
  #3  
Old 11-07-2002, 04:51 PM
rochen rochen is offline
 
Join Date: Apr 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No the form for them to enter their username would be in a hosting control panel, which only customers would have access to anyway. Any customer who needs access at the moment needs to submit a support ticket to us, then we change the group. With this system, they could just login to their hosting control panel, enter the username and get access to the customer only area of our forums.
Reply With Quote
  #4  
Old 11-07-2002, 05:10 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by rochen
No the form for them to enter their username would be in a hosting control panel, which only customers would have access to anyway. Any customer who needs access at the moment needs to submit a support ticket to us, then we change the group. With this system, they could just login to their hosting control panel, enter the username and get access to the customer only area of our forums.
Edit misc.php (the one in forum dir not the misc.php in the admin dir!), find:

PHP Code:
if ($HTTP_POST_VARS['action']) {
    
$action $HTTP_POST_VARS['action'];
} else if (
$HTTP_GET_VARS['action']) {
    
$action $HTTP_GET_VARS['action'];

After that add:
PHP Code:

// ############################### start change usergroup ###############################
if ($action=="iamacustomer") {
include(
"./global.php");
if (
$bbuserinfo[userid]<1) {show_nopermission();}


if (
$bbuserinfo[usergroupid]==2)
{
$u=$bbuserinfo[userid];
$DB_site->query("UPDATE user SET usergroupid=Z WHERE userid='$u'");
eval(
"standarderror(\"".gettemplate("usergroup_changed")."\");");
}
exit;

Now you can put the link http://yoursite.com/forum/misc.php?action=iamacustomer somewhere hidden where only your customers can access. By following the link their usergroup will change to Z (edit it)..

Dont forget to create a new template called "usergroup_changed". It will be displayed when their usergroup changes successfully.

Enjoy..
Reply With Quote
  #5  
Old 11-07-2002, 05:19 PM
rochen rochen is offline
 
Join Date: Apr 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks

Is there anyway I can set it like.... http://yoursite.com/forum/misc.php?action=iamacustomer&user=username ? So they don't need to login or whatever after... also is there anyway I can check the refer of the "iamacustomer" to stop anyone just putting the link in their browser? For example if refer = xyz.com OK if not then NOT OK... ?
Reply With Quote
  #6  
Old 11-07-2002, 05:25 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats a freaking awesome idea Logician....

I've been thinking about using my extremely basic coding skills to have an advanced members section on my site

Thanks for the tips

Regards

- miSt
Reply With Quote
  #7  
Old 11-07-2002, 10:27 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by rochen
http://yoursite.com/forum/misc.php?action=iamacustomer&user=username ? So they don't need to login or whatever after...
it wouldnt be a good idea since you can put others username there..

Most people has already set cookies on in the forum settings and if this is the case, they wont need to login when they visit that page. (I assume the username you refer is vb username?)

Quote:
also is there anyway I can check the refer of the "iamacustomer" to stop anyone just putting the link in their browser? For example if refer = xyz.com OK if not then NOT OK... ?
I was expecting this question.. :glasses:

Referrer is not a secure enough mainstay as it can easily be manipulated. If you want to secure the dir you have to check another criteria of the visitor which you can count more. I dont know what this would be for your site.

But if you still want the referrer check anyway, here is how:
edit global.php (in forum dir, not admin dir)

right after <?php add:
PHP Code:
$log_referrer=getenv('HTTP_REFERER'); 
Then in the hack code you can check it like:
PHP Code:
if ($log_referrer!="your url here") {show_nopermission();} 
This is not tested and I dont know how good it will work but this is the general algorithm for referer page check..

Regard my suggestion above..

Enjoy..

@mist: yw but IMO following an URL for usergroup change is not the best solution for you.. Check this solution for making it password/special user profile field based.. Should fit better to your needs..
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:13 PM.


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.05157 seconds
  • Memory Usage 2,231KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete