![]() |
Vbulletin Rails integration
Hi all,
we have been using vbulletin for our discussion board for long time now. once we had a very active community we began writing more web apps. Till now since all were written in php we didn't face any problems with authentication. we simple used vbulletin to see if a user is logged in or not and redirected accordingly. all this is possible because i can just simple "include vbulletin file". now we are planning to use ruby on rails for coding an app. how can i still use vbulletin to check whether a user is logged in or not ? i also need his userid and username variables and then use them in my rails app. Any ideas on how to do it ? Cheers, Deepu. |
Looking for this too, any ideas ?
|
What you need to do is check the userid/password combination given in the user's cookies.
|
Thanks, that's what I'm doing but is it safe to authenticate a user by its cookies ? Cookies can be stolen...
|
It's the easiest way... But you're right, totally insecure if someone is on a public wireless network. Otherwise you're going to have to make a prompt for their passwords. Either way, you're going to have to write a custom DB connect in ruby rails that connects to your vBulletin database and checks the user table for authentication.
That shouldn't really be a problem if you are coding your new app yourself. |
I'm keen to write a connector, something that'll pass the view variables from rails to something in php that'll bring up the view, while at the same time being able to pass the core bits and pieces that are needed to preform logic to the rails app.
I've tried to share cookies etc, but it was very hard, and very annoying trying to match the template, especially the header, with the drop downs etc. So I was thinking of creating a connector that'll let me write my apps in rails, and basically pass the information to a vbulletin addon that will let me pass the view (instance) variables to vbulletin for the vb plugin to then work out what template to show, etc. I've written some stuff for VB that'll make things Restful. For instance, after my rails app authenticates itself to vb (using a 256character hash generated based on an algorithm (so it keeps changing)) i can do basic stuff right now, like grab a user, or a list of users, or a list of posts, etc. So rails is using activeresource for now to do that.. If anyone is interested in helping shoot me a pm on here and we can co-ordinate how we can do this. |
Everyones needs are different. I'm building a members area that hooks into vb on the user and usergroup (vb subscription changes users primary group)
So for now I'm happy to prompt for a login and keep a separate cookie for the rails app. Not ideal but it works for my scenario. Achieving this is quite straight forward, I've established a second connection in database.yml then created a user model.rb file. Within this we do: Code:
class User < ActiveRecord::Base So using the mot basic parts from acts as authenticated I rolled my own sessions / login pages and then I used this Code:
Digest::MD5.hexdigest(Digest::MD5.hexdigest(password)+salt) I would at some point like to logout of the member app when you logout of vb... But as it's a separate app on a separate sub-domain, I'm happy to leave them separate for the moment and focus on getting a working functional site out. Of course the established connection makes it quite easy to lift out information from vb, which I think is easier than writing and calling api wrappers on vb code. More so as I've got so dam rusty on php... We used active resource for a few projects before dropping it in favor of establishing connections and masking remote tables this way. Everyone's needs are different... HTH |
All times are GMT. The time now is 03:39 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|