Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2005, 12:41 AM
alanpollenz alanpollenz is offline
 
Join Date: Apr 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Another application using vBulletin registration and user modules. How do I do it?

I have a situation that I've not seen addressed elsewhere. Currently, my vBulletin application is open to all, but when a user registers, I validate him against a list of airline pilots from one specific airline and assign them to a custom usergroup. Once they are validated and assigned to this custom usergroup, they have access to the airline specific forums.

Now, I am writing severals applications in php/mysql that I would like to be accessible only by these previously validated members in this custom usergroup. As I see it, the easiest way to do this would be to hook into the vBulletin user database. There are several requirements for the system
  • If a user tries to log in to the new section, the vBulletin database is checked, and, if the username has been added to the custom usergroup, the user is granted access.
  • If the user goes to the new area, is in the custom usergroup, and a vBulletin cookie exists, the user is automatically logged in.
  • If the user logs into the new system, the vBulletin cookie is set, so that he is, in essence. also logged into the forums.
  • If the user registers, it adds him to the vBulletin database and I am sent the sign up email so I know that I need to validate him.
  • Any other vBulletin user signup and registration processes need to be incorporated.
So, what do I need to do to hook into the vBulleting registration system?

Thanks.

Alan Pollenz
Reply With Quote
  #2  
Old 05-08-2005, 08:49 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well the basics for integrating with vB are very simple, just include the following line in your script:
PHP Code:
require_once('./global.php'); 
This will give you access to all the userinformation, including the groups a user belongs to. Just look into the $bbuserinfo array that will be set after you include global.php.

When your script is located outside the vB homedirectory, you will have to chdir to the forumhome dir before calling global.php, and depending on your script chdir back afterwards.

This should get you started. If you have any more specific questions, feel free to ask.
Reply With Quote
  #3  
Old 05-08-2005, 10:03 AM
memobug memobug is offline
 
Join Date: Jun 2002
Posts: 418
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You might also look at vbAdvanced cmps if you want to make your own custom pages, it could be an easy way to do it.

Regards,

Matt
Reply With Quote
  #4  
Old 05-08-2005, 12:58 PM
alanpollenz alanpollenz is offline
 
Join Date: Apr 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Marco,

I think I can make due without actually hooking into the forum code at all. I can simply fork to the current registration process from the new application to register new users and use my current process to validate users for access.

What I will be doing is checking for the existance of the forum cookie for the "Remember me" feature as well as checking that the user actually exists in the database, the password entered matches the password in the database, and the usergroup access is appropriate.

The only problem I see is that the forum cookie for pdpbbuserid, as an example, has a host of forums.apapdp.org, and I'm not sure I'll be able to read this from within the members area, which will probably be members.apapdp.org.

Do you either:
  1. Know a way, using PHP, to access cookies on one subdomain (forums.apapdp.org) from another (members.apapdp.org) or the top level domain (www.apapdp.org)?
  2. Know what changes are required to make the forums output its cookies for sitewide use, such as Host: apapdp.org?
Thanks.

Alan Pollenz


Quote:
Originally Posted by MarcoH64
Well the basics for integrating with vB are very simple, just include the following line in your script:
PHP Code:
require_once('./global.php'); 
This will give you access to all the userinformation, including the groups a user belongs to. Just look into the $bbuserinfo array that will be set after you include global.php.

When your script is located outside the vB homedirectory, you will have to chdir to the forumhome dir before calling global.php, and depending on your script chdir back afterwards.

This should get you started. If you have any more specific questions, feel free to ask.
Reply With Quote
  #5  
Old 05-08-2005, 01:30 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can set the cooki domain in your vB settings. Note that this could be very troublesome to find the correct setting. Not a real cookie monster (ehh Expert) myself.
Reply With Quote
  #6  
Old 05-08-2005, 02:49 PM
alanpollenz alanpollenz is offline
 
Join Date: Apr 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! That accomplished exactly what I wanted to accomplish.

You da man!!

Alan Pollenz
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 01:08 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.04045 seconds
  • Memory Usage 2,212KB
  • 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
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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