Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-09-2008, 04:24 PM
mytown.ie mytown.ie is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default maintaining 2 logins and databases with vBulletin

Hi There,

I have purchased and installed vBulletin on http://www.mytown.ie/forums.
You will see that the main version of my site http://www.mytown.ie already has a login area, this allows users to login to access certain features on the site.

When a new user registers with mytown.ie, they will also be registered on vBulletin (my programmer can change the mytown.ie registration script to create entries in both DB tables). The problem is when a user registers on mytown.ie/forums - I also want them to be registered on the main area of mytown.ie - creating a DB entry here. Similarly when a user logs-in to mytown.ie/forums, they should be logged-in to the main area of the site.

I am sure that other sites that have added vBulletin will have had a similar problem, and would therefore appreciate your feedback.

Thanks,

Garry
Reply With Quote
  #2  
Old 07-09-2008, 04:29 PM
nexialys
Guest
 
Posts: n/a
Default

if you have a custom main page, i would suggest you request a custom bridge ... bridge would be used to connect both systems and work seemlessly...

as you say, others have their vBulletin plugged-in some other software are using 3rd party bridges... usually released by the company that create the other softwares... rare are the bridges created by Jelsoft for other softwares... i know none actually.. the only bridges created here for Wordpress and some other chat scripts are custom from coders on this site.
Reply With Quote
  #3  
Old 07-10-2008, 06:19 AM
mytown.ie mytown.ie is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the feedback.

My system is custom built and my programmer would be able to build something that connects from vBulletin into my system. I would like to give him some guidance regarding the vBulletin code though. I have been advised by vBulletin me that I should be able to use a plugin that executes some code when a user registers, they advised me to look on this forum for further help.

Any advice is greatly appreciated.
Reply With Quote
  #4  
Old 07-10-2008, 06:03 PM
jj's Avatar
jj jj is offline
 
Join Date: Sep 2005
Location: Viernheim, Germany
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With the fact you are using a custom built page, there should be no problems on dropping your site user table and base the page onto the vbulletin user table.

I wrote a custom "cms" for our page as well, and I'm hooking into the vbulletin user table for authentication on site (the login is handled by vbulletin completely).

Here's a snippet of my custom security/user class
PHP Code:
    function auth_phpbb($data$passwd) {
        return 
false;
    }
    function 
auth_vbulletin($data$passwd) {
        
/*
         * Passwortchecks
         */
        
if ($data['salt'] != "") {
            
$passwdMD5 md5md5$passwd ) . $data['salt'] );
        } else {
            
$passwdMD5 md5$passwd );
        }

        if (
$passwdMD5 == $data['password']) {
            
$_SESSION['oSession']['userinfo'] = array (
                
'userid' => $data['userid'],
                
'username' => $data['username']
            );
            
session_regenerate_id();
            return 
true;
        } else {
            unset( 
$_SESSION['oSession']['userinfo'] );
            return 
false;
        }
    }
    function 
authenticate($system 'DEFAULT') {
        if ( 
$system=='DEFAULT' ) {
            
$system='auth_'.$this->config["main"]["authsystem"];
        } else {
            
$system='auth_'.$system;
        }
        if (!
method_exists($this,$system)) {
            return 
false;
        }
        if (
            isset(
$_POST['login']) &&
            
is_array($_POST['login']) &&
            !empty(
$_POST['login']['username']) &&
            !empty(
$_POST['login']['password'])
        ) {
            
$data $this->getUser(htmlentities(strip_tags($_POST['login']['username']),ENT_QUOTES));
            if (
                
$data &&
                (
                    
$this->isMemberOfGroup($data['userid'],4) ||     // Mitglieder
                    
$this->isMemberOfGroup($data['userid'],6) ||     // Trials
                    
$this->isMemberOfGroup($data['userid'],1) ||     // Administratoren
                    
$this->isSuperAdmin($data['userid'])            // SuperAdmins
                
)
            ) {
                return 
call_user_method($system$this$data$_POST['login']['password']);
            }
        }
        return 
false;
    } 
Maybe it's helpfull.

Cheers
Jens
Reply With Quote
  #5  
Old 07-10-2008, 09:18 PM
mytown.ie mytown.ie is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for that Jens.
So you are suggesting using the vBulletin user table and stop using my existing user DB table?
I have got some fields in my current user DB table which are not catered for in the vBulletin table, do you think it will cause problems adding new fields to the vBulletin table?

I know it is a better solution to have one user table, than have to worry about replicating users from one table to another.

Any further advise is more than welcome.

Cheers,

Garry
Reply With Quote
  #6  
Old 07-11-2008, 04:58 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can just port your fields over into the vBulletin user table. They will then be able to be accessed globally in vBulletin (if you need to).
Reply With Quote
  #7  
Old 07-11-2008, 08:09 AM
mytown.ie mytown.ie is offline
 
Join Date: Jul 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, i just want to make sure I understand this correctly.

You guys think that they best solution is to add all the required fields to the vBulletin db user table. Then drop my current user db table and move all my sites current login/register/user_account code to look at the vBulletin user db table.

Another question then. If a user logs in to vBulletin forum on my site, I also want them to be logged in to the main area of my site. What changes to code will I have to make to achieve this? Can you advise me of what code/files need to be edited?

Thanks,
Garry
Reply With Quote
  #8  
Old 07-11-2008, 09:28 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just include global.php - it will handle all session keeping, if there is a session.
Reply With Quote
  #9  
Old 07-11-2008, 10:16 AM
ArbuZz ArbuZz is offline
 
Join Date: Jun 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is logical, that if you use vBulletin user table to store your website user account, it'd better if you managed to use vBulletin's auth system also. I wish it was an option for me. In case if that is not possible, have look in this thread: https://vborg.vbsupport.ru/showthrea...t=82836&page=7 and especially at my last experience. I've just accomplished the similar task, although I wish it was somehow more elegant or something. So if you can use vBulletin's auth and db system, then use it.
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 05:14 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.03982 seconds
  • Memory Usage 2,260KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (8)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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