Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2019-08-06 20:17:59

KZKG^Gaara
New member
Registered: 2018-04-28
Posts: 3

Changing login system to works with another DB

Hello

FluxBB Version: 1.5.11
Clean installation... no pluggins/addons, no theme, 100% pure.

Im changing the login system because I need to use another DB:

1. Usually FluxBB will use their own DB, table users
2. I need to use another DB, with another table... and of course, another structure

I already make some steps...

In login.php already changed the line #34 from:

$result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());

to:

$result = $db->query('SELECT * FROM auth_database.accounts_table WHERE account_username="'.$form_username.'"') or error('Unable to fetch user info1', __FILE__, __LINE__, $db->error());

Also changing the hash generating function its not a big deal...

After made this changes I get that:


  • If I put some inexistent account, or wrong password ... FluxBB works just fine: "Wrong Username or Password" error... cool

  • If I put the correct login data the "Login Successfully" message appears:
    Redirecting
    Logged in successfully. Redirecting ...
    Click here if you do not want to wait any longer (or if your browser does not automatically forward you)

  • Then redirects me to index.php ... but Im still not logged ...

Im assuming that of course, Im missing something... maybe the $authorize variable (echo $authorize; print 1 ... so I think its ok) ... or cookie? ...

I dont know, thats why Im here

Could anyone please help me?

Thanks, best regards

Offline

#2 2019-08-08 18:54:36

KZKG^Gaara
New member
Registered: 2018-04-28
Posts: 3

Re: Changing login system to works with another DB

Nevermind... Already did it...
The account ID from my own Auth db must have the same name as the fluxbb account ID field (ID), also the value from that field must be the same in both dbs.

Offline

#3 2019-08-08 21:11:14

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,661
Website

Re: Changing login system to works with another DB

Glad you found a solution!


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

Board footer

Powered by FluxBB