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.
WordPress 2.5 Bridge
Hey, I've been using the WordPress integration method described here which worked wonderfully. However, as of 2.5, WordPress now uses phpass and salts the hashes, as well as encrypts cookies (Described here towards the bottom). I've already tried to figure out how to modify the implementation but I just can't figure it out. I believe I have to use either wp_hash_password or wp_check_password. I don't care if the auto-authentication works (It might not because that involved cookies, and WordPress changed the way it does cookies). There is a plugin to revert to the original plain md5 hashing method here here, but I would prefer the extra layer of security. Here are the definitions of wp_check_password() and wp_hash_password().
I would appreciate if anyone has any answers or could help in any way with this, as I would like to keep Vanilla forums. I don't mind doing this myself, I just need some type of guidance. SirNot, please help
I would appreciate if anyone has any answers or could help in any way with this, as I would like to keep Vanilla forums. I don't mind doing this myself, I just need some type of guidance. SirNot, please help
0
Comments
rmccue: If you do write one eventually, please let me know! I'd be glad to help if you need anything, by the way.
Please consider:
In this version as long as I've got this right it uses only one cookie to store a string made by the username, the expiration time (I've set this to one hour) and a hash.
So Vanilla has to verify this hash.
I'm concerned to not weak the security in a way I've not understood, so, please, may you confirm this?
I've set up a gdoc with the source, but tell me if there is a better way to share it (I can send the source to Mark if needed).
The source: http://docs.google.com/View?docid=dhg8h5q9_1dmb7m967
Thanks!
Mic
Our implementation is pretty much the same - cheap and cheerful copy-paste of the auth functions from pluggable.php in wordpress.. I suppose it's somewhat reassuring that two people independently came out with the exact same solution.
Google Doc
I have set up my site using micz script, and installed the md5 hashes plugin in WP.. It won't work though - i can easily share the user database as usual, but cookies won't work. When i have logged in in WP i am not logged in in Vanilla, and as soon as i log in the other place, i am logged out the other.
Any idea what i am doing wrong, or how i can fix it?
Weird enough the secret in wp_options was different from the one in wp-config and vanilla changed to let them all match, and it works!
Thanks alot
Thanks again micz, I really appreciate even this fix. I would definitely appreciate a fix that makes use of the new features though. Like I've said, to be able to use the WordPress functions, you'll want to do what is outlined here.
You can read about the improved cookie handling here and the basic problem with the old cookie implementation is described in this support ticket http://trac.wordpress.org/ticket/5367. This problem is fixed in the WP Bridge provided above. Links courtesy of boren.nu!
Most of every site on the internet written in PHP will use md5 hashed passwords. For future development it makes sense to use phpass - but I wouldnt really worry about it for your WP/Vanilla homepage.
I hope to find soon the time to update the code.
I hope that the solutions soon: D
Hence, I quickly did a (very slightly) modified version of micz's code from above which you should hopefully be able to drop into a default install. Find it here:
http://docs.google.com/Doc?id=dcf7jf9g_1gcjpktgg
If anyone would care to test this, ill have a look if you find any problems. If I had more time i'd do a default install and test myself!
Cheers all
mafro
- I use the wp_users table, with the additional columns for Vanilla.
- I don't use the WP login form. I redirect any requests for wp-login.php onto the Vanilla login page (see some code below). This shouldn't really make any difference however!
I tried the modded code I posted previously, and yes it didn't work. Ill have a look at working out why later - I don't have time now. But, I did drop in my WordpressAuthenticator (posted originally above) and it worked fine.
Try this code as a drop in replacement and let me know how you get on.
http://docs.google.com/View?docid=dcf7jf9g_2dw92g6z8
For reference this is the excerpt from my conf/database.php:
// Map to the wordpress user table $DatabaseTables['User'] = 'wp_users'; // Map existing wordpress columns to Vanilla $DatabaseColumns['User']['UserID'] = 'ID'; $DatabaseColumns['User']['UserLogin'] = 'user_login'; $DatabaseColumns['User']['Name'] = 'display_name'; $DatabaseColumns['User']['Password'] = 'user_pass'; $DatabaseColumns['User']['Email'] = 'user_email'; $DatabaseColumns['User']['DateFirstVisit'] = 'user_registered';
And here's the little bit of redirect code I added to wp-login.php. If you use this, set ROOT_URL to the location of your wordpress install (prob just / on live server).
define("ROOT_URL", "/wordpress251/"); if(($_GET['action'] == "logout") || ($_GET['loggedout'] == "true")) { //redirect Wordpress logout requests to home $return_url = ROOT_URL; }else if(strlen($_SERVER['QUERY_STRING']) == 0) { //redirect Wordpress login with no return_url to home $return_url = ROOT_URL; }else if(strpos($_SERVER['REQUEST_URI'], "wp-login.php?redirect_to=") > 0) { //crop off the Wordpress wp-login redirect $return_url = str_replace(ROOT_URL."wp-login.php?redirect_to=", "", $_SERVER['REQUEST_URI']); $return_url = urldecode($return_url); }else{ $return_url = $_SERVER['REQUEST_URI']; } //dont use Wordpress login header("location: forum/people.php?PageAction=SignOutNow&ReturnUrl=".$return_url); exit;
mafro