Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Trying to integrate Vanilla with existing user system??
Hi,
This looks like a great piece of software, and I am interested in using it in future instead of phpbb and other forums which I currently use on my numerous community sites.
Anyway, my current personal project consists of a community site which now needs a forum added. The site already has a user sign up system (my own work - PHP/mysql etc), with user db and session spawning etc...
My question is - can anyone help guide me in the right direction to what I need to add to my registration class, so that it can populate the vanilla user table at the same time (I don't want to have the user re-registering on vanilla if they want to post)...
If I can get this working, I will then try this discussion - http://lussumo.com/community/discussion/4808/ - to integrate the login procedure in one... But if anyone has any better ideas, I will gladly accept them.
Thanks very much,
Alek.
0
This discussion has been closed.
Comments
What I personaly did was:
- remove the login/register thing from my Vanilla templates
- replace Vanilla's header section by mine (navigation + login...)
- remap some Vanilla tables to mine
- create my own auth class (replaces People.Class.Authenticator.php) that doesn't check user pass but only grabs the id of the user (that he got after OUR login procedure
I took inspiration from this article.Hope this helps...
In fact, when you say Do you mean use the Vanilla user table instead of your own one?, it's the exact contrary: use your tables instead of Vanilla ones. But you'll have to complete your tables for them to have all the needed columns (you'll have to know a bit of SQL).
But we can go even further: every time that Vanilla wants to know who browses, it calls the authenticator class, that we can swap for another one too !!!
(flexibility, flexibility, thanks to Mark!!!)
It's not a big big job: basically tell the new auth class what query to use to return the user_id.
Do you already have information in your databases? or do you just need to build a fresh system?
I personnaly don't use the two first since I disabled the buttons in the templates, but I rewrote the third to tell Vanilla if someone is already logged in (return $UserID>0) or not (return $UserID=0), AND to do some session stuff (session_set_cookie_params, session_start, AssignSessionUserID) or tracking stuff (UpdateLastVisit, LogIp).
Maybe GetIdentity is good as is if your personal 'log_user_in' function does exactly the same job, but I guess not.
You could choose to do only this, or to let users try to log with the Vanilla form too. Then you'll have to rewrite Authenticate and DeAuthenticate.
If you choose to rewrite, don't forget to set
$Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.ALEK_Authenticator.php';
My last words: if you've done it in your own auth system, it won't be very hard to do it inside Vanilla.