Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2004, 09:26 AM
*****Sniper *****Sniper is offline
 
Join Date: Apr 2004
Location: Firenze
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default User Database integration

I dont have to integrate the software, I just have to be able to allow the users in another database to access VB3. This is because there are over 2M users in the Database and cannot be migrated over to the VB3 database.

What I think I have to do is edit the login page so it takes the userid, username & password from the other database. Following is the SQL that does so.

$sql = "SELECT id, username, password FROM anagrafica WHERE username='".addslashes(htmlspecialchars_uni($usern ame))."'";
Also that DB is Oracle, not mysql.

problems: Password is plain text, not md5 encrypted. No "salt" field. different identifying names (eg. $bbuserinfo['id'] and not $bbuserinfo['userid'])
can anybody point me in the right direction?

I've started looking at the login.php file but am not sure what to modify?!?!
Reply With Quote
  #2  
Old 05-17-2004, 12:25 PM
*****Sniper *****Sniper is offline
 
Join Date: Apr 2004
Location: Firenze
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, maybe i'm asking too much....
ok, then can someone explain to me what line 156 of login.php does:

if ($bbuserinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $bbuserinfo['salt']), '') AND $bbuserinfo['password'] != md5($md5password . $bbuserinfo['salt']))

it comes ust after the query that retrieves userid and password etc given a username.
Reply With Quote
  #3  
Old 05-17-2004, 02:54 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In includes/functions.php look for this:

PHP Code:
// ###################### Start getuserinfo #######################
// set $option to load other relevant information
function fetch_userinfo(&$userid$option 0
This is the function that builds $bbuserinfo, it is called like this in /includes/session.php

PHP Code:
$bbuserinfo fetch_userinfo($_COOKIE[COOKIE_PREFIX 'userid'], iif(defined('IN_CONTROL_PANEL'), 16)); 
There are many calls over alot of files to the fetch_userinfo function, for the most part it will handle most of the work once you adapt it to your other user database. There will probbly be more work to be done but this is a good starting point.
Reply With Quote
  #4  
Old 05-17-2004, 03:13 PM
*****Sniper *****Sniper is offline
 
Join Date: Apr 2004
Location: Firenze
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so I should start from functions.php and altering the fetch_userinfo()

I have been changing login.php, line

if ($bbuserinfo = $DB_site->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . addslashes(htmlspecialchars_uni($username)) . "'"))
{

I do have to change this as well correct? even after changing the fetch_userinfo() function!?
if
one last thing... what is "iif" its not in any php manual! is it "if and only if"??
Reply With Quote
  #5  
Old 05-17-2004, 03:17 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by *****Sniper
so I should start from functions.php and altering the fetch_userinfo()

I have been changing login.php, line

if ($bbuserinfo = $DB_site->query_first("SELECT userid, usergroupid, membergroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . addslashes(htmlspecialchars_uni($username)) . "'"))
{

I do have to change this as well correct? even after changing the fetch_userinfo() function!?
if
one last thing... what is "iif" its not in any php manual! is it "if and only if"??
Yes you would have to change that line aswell.

iif basicly allows you to do a if on one line, think of it like this:
PHP Code:
iif($var"$var is true"
would be:

PHP Code:
if($var)
{
     echo(
"$var is true");

Reply With Quote
  #6  
Old 05-18-2004, 11:33 AM
meowmeow's Avatar
meowmeow meowmeow is offline
 
Join Date: May 2004
Location: Florence, Italy
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

that was very helpful, thanks. now I have a place to start.

(oh, yeah, I had to change name cuz i forgot the other password! so now I have two subscriptions. is there a way to fuse them together, or can the admin only do that?)

now just to have things clear.

PHP Code:
$user$DB_site->query_first("..."); 
this is where it gathers all the info from the database. so here I would have to change it to retrieve data from my other database.

but the query ends with
PHP Code:
WHERE user.userid $userid 
the $userid variable, is that taken from the login input or the cookies?

last thing!! The admins and the moderators are not in the old database, they are in VB3's DB. So i want to do this

IF($userid is in the VB3 database) {do the query thats already there.}
else {query the other database.}

I tried doing this
PHP Code:
    if($userid == $DB_site->query_test("SELECT userid FROM user WHERE userid = ".$userid))
do 
originalQuery 
and it logs in fine, is redirected, then when forum shows up its all backwards and the buttons are gone, I have no idea whats causing this!
Reply With Quote
  #7  
Old 05-18-2004, 01:34 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*****Sniper,

You are currently showing up as unlicensed. To be able to download hacks and/or receive support here at vBulletin.org, we ask you to please click here (vB-germany users click here) and enter your email address, to show us that you are licensed.

You will need to use your customer number and password (which will be in the email you got when you paid for your license) to access that page. Please note that your email is case sensitive.

Thank you.
Reply With Quote
  #8  
Old 05-18-2004, 01:48 PM
meowmeow's Avatar
meowmeow meowmeow is offline
 
Join Date: May 2004
Location: Florence, Italy
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah but pussySniper (surely that should be *****sniper) has forgotten his password (is username case-sensitive?) and when i do the "forgotten your password" post with my email, I don't get one! i've done 3 times today, still nothing. so I registered again as a different user!
Reply With Quote
  #9  
Old 05-19-2004, 10:08 AM
meowmeow's Avatar
meowmeow meowmeow is offline
 
Join Date: May 2004
Location: Florence, Italy
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm trying to modify vb3 so that it will get the users (not the moderators) from another database.

so i'm trying to understand the relations between login.php, sessions.php and functions.php

which and where i have to modify it. I've been told I have to modify the fetch_userinfo() function.

but i cant tell where the cookies are set. where bbuserinfo is set.. i'm completely lost and in desperate need of some direction.
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 04:42 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.05054 seconds
  • Memory Usage 2,251KB
  • 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
  • (7)bbcode_php
  • (1)bbcode_quote
  • (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
  • (9)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_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