Log in

View Full Version : Logging in on user database from oter location than forum


Audience
11-05-2004, 02:47 PM
Hi,

i'm coding a website and i want to use the user database of my forum... so the users have to register one to use both...
but i don't get how i have to fix they could login from my website... i don't get how the fix it with the md5 security vBulletin uses...
It would also be great if they could register when they are on the website (not on the forum)...

Can someone help me out?

Andreas
11-05-2004, 03:01 PM
The "password" stored in the user-table is md5(concat(md5('password'), salt)).

So if you want to check if password bar for user foo is correct:

SELECT userid, password=MD5(CONCAT(MD5('bar'), salt)) AS pwdcorrect FROM user WHERE username='foo'


if this does return 0 rows, the username was wrong.
if it does return a row and pwdcorrect is 0 then the password was wrong
if it does return a row and pwdcorrect is 1 then the username/password combination is valid

Audience
11-05-2004, 03:38 PM
you're my angel today :)

Audience
11-05-2004, 03:49 PM
hmm concat is a function of vB?
In which file is it so i can copy it ?

Andreas
11-05-2004, 03:57 PM
CONCAT() is a mySQL function.

To concatenate strings in PHP you can use .


$foobar = 'foo' . 'bar';
echo $foobar;

results in foobar being printed out.