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.
Options

WordPress 2.5 Bridge

135

Comments

  • Options
    The plugin would have to automatically do certain things then, like creating database tables or moving them, filling in the configuration variables, etc.
  • Options
    This thread has been incredibly helpful. Thanks to everyone who has had input on resolving various problems. Now I have a quick question that perhaps someone will have some insight on... I have wordpress and vanilla installed on one server, and I'm moving everything over to a second server with fresh installs and an integrated database, then importing the data over... The first hurdle is just about complete (the integration) except for a couple of quirks that I've noticed. (please bear with me, I'm still a bit of a database n00b) I followed all of the instructions I could find for the integration and was able to login to wordpress as Admin and then navigate to the forum and stay logged in as Admin - first success! Then I took a test user account on my old vanilla forum and manually copied/pasted the various fields over to the new wp_users table (tedious, I know - but I only have about a dozen user accounts so I figure it's not too bad and I'll learn something in the process). I realized that there's another table that wordpress needs - the wp_usermeta to set the First/Last name and access type. No biggie. I logged in as Admin and set that information there, and then was able to login as the migration test user and everything was kosher. I could navigate to the forum and post a new topic and everything is working fine. However, I saw some strange behavior. Now, vanilla is using the wp_users table for all of its information. The instructions walk you through creating the extra columns for the info that vanilla uses/needs, but wordpress doesn't have there. However, in this table there are first/last name columns where vanilla gets that information from for the vanilla profile. Yet wordpress gets this information from the wp_usermeta table. That's a bit frustrating. So my users have to go into 2 places to update/set their first/last name? Does anyone know of a way to tell vanilla to just use the wordpress data from the other table? There's gotta be a simpler way than I'm thinking of, because right now the only thing I can think of is to setup a cron job to run and compare the fields and make them match so there's no discrepancies (which is a bit ridiculous).
  • Options
    Ok. I *had* it working, but it's not anymore. I've made a few changes, and I'm not sure what broke it. It was initially working using an IP address because I hadn't moved my domain name over. I think that might have done it, but I'm not positive. When I updated DNS, I updated the config files to reflect the domain name instead of the IP address. I don't recall testing it before the other changes that I made... In addition, I started to secure the wordpress install a bit. I renamed the wordpress admin user and changed the "wp_" prefix for the tables. I updated the corresponding files that I was aware of - wp-config, settings.php, database.php, and the wordpress authenticator file. Does anyone know if there are any others that I would need to update? It's not giving me anymore errors after I updated the authenticator file. It can't be the admin username change because I can login to wordpress with another account fine, and when I go to the forum I'm not logged in. I've even tested from multiple computers and cleared my browser cookies just in case there were lingering cookies assuming that it was still using the IP address or something weird. At this point, I'm just grasping at straws. I went through everything I could find about the secret key, and verified that everything matched in the wp-config, the database.php, as well as the database itself. I tried removing all spaces in it to confirm that wasn't the problem. I even removed the ' in it - in case one of them somewhere was translating that as the end of the string or something. No dice. I thought it was the cookie domain settings and I've tried every setting and every combination that I can think of with no change. Any ideas? Anything you guys can think of for me to try would be greatly appreciated!
  • Options
    I know this isn't any help, but I just wanted to say that I've had similar problems, elorg. I've done probably half a dozen fresh installs, and I get different results every time. Obviously, I'm making small errors along the way, but figuring out where is difficult when there are so many opportunities for small errors.

    I'm about to give up on this altogether. Which sucks, because I love Vanilla.
  • Options
    =/ I just finished up fresh reinstalls without having to worry about a DNS update borking things when I'm done - with no luck. I'll look into this more later. *sigh
  • Options
    Well I'll be damned. It was the wordpress table prefix rename? I just reinstalled ... countless times. If I leave the wordpress table prefix to wp_ it works. If I rename it before I even begin the migration - or anywhere in between - it stops allowing the users' login to pass from wordpress to vanilla. If you rename the tables, where do you need to update in vanilla? database.php People.Class.WordpressAuthentication.php Anywhere else?
  • Options
    I spoke too soon. It works, but it doesn't. I can browse to the forums after authenticating. I can post comments in existing discussions, but I can't do anything else besides browse or search. If I try to create a new topic or update any of the forum settings, or even check for updates to vanilla, I get: There was a problem authenticating your post information. Time to look through the database again...
  • Options
    I realized that last night I was able to post a reply to an existing discussion. Today, I'm no longer able to. That certainly makes things interesting.
  • Options
    I really don't understand. I install wordpress and vanilla clean. I integrate them. I can post back and forth. Everything works. I go to sleep, and when I wake up it no longer works. "There was a problem authenticating your post information." And that's without changing the admin username, without changing the wordpress table prefix, without importing any of my data. It's all new. It works, and then suddenly stops after nothing has changed.
  • Options
    it might have to do with cookie or authentication settings?
  • Options
    hrmm..
  • Options
    edited June 2008
    I believe I found the answer to the cookie problem discussed above. I had the same issue. The solution was actually very simple, (after 2 days of tracking it down). It turns out that the People.Class.WordpressAuthenticator.php module uses its own 'home brew' function for hash_hmac(), while WordPress uses PHP's standard hash_hmac function that ships with PHP. Evidently there are some discrepancies, because changing all references to $this->v_hash_hmac() to simply use hash_hmac(), worked beautifully. Remember to clear your cookies after you change your code so your browser won't cause problems. I also noted while looking at the code differences between WordPress authentication and Vanilla authentication, that the 'persistent login' timeouts are different between Vanilla and WordPress. WordPress loggs you in for 14 days if you check the "remember me" box on the login. Vanilla's is longer... 30 days I think. Not sure if that will cause problems. But it certainly screws with a developer's expectations about how long the cookie will live between applications. In my implementation, I made them the same by updating WordPress wp-includes/pluggable.php, inside the wp_set_auth_cookie() function. WordPress 2.5.1 Vanilla 1.1.4 LAMP (PHP5) Jon
  • Options
    Would you mind specifying exactly what you changed in the WordPress wp-includes/pluggable.php, inside the wp_set_auth_cookie() function?

    A neat little diff file would be great, thanks ;)
  • Options
    edited June 2008
    Hi everyone,

    I have been reading all of your comments as I have been trying to get my WP 2.5.1 and Vanilla 1.1.4 integrated. Unfortunately I have not yet been successful. So I was hoping that if I explain what I have done so far is correct; plus I have a couple of questions.

    I have WP installed in a sub directory called “blog”, and I have Vanilla installed in a subdirectory called “community”. So they are separate and neither resides in the root of the site.

    Here is the approach I have taken so far:

    1. I have followed the integration described here http://lussumo.com/docs/doku.php?id=vanilla:integration:wordpress and I created the vanilla extension called WordpressIntegration used option 2 as described in the New Members section of the integration process.

    2. Edited to conf/settings.php file with:

    // Wordpress Authenticator
    $Configuration['AUTHENTICATION_MODULE'] = 'People/People.Class.WordpressAuthenticator.php';
    $Configuration['DEFAULT_ROLE'] = '3';
    $Configuration['ALLOW_IMMEDIATE_ACCESS'] = '1';
    $Configuration['WP_SECRET_KEY'] = 'secret';

    3. Updated the wp-config.php file with:

    define(‘SECRET_KEY’, ‘secret’)

    4. And updated the wp_option table also with the secret.

    3. I also updated the conf/database.php file with:

    $Configuration['WP_SECRET_KEY'] = 'secret';

    but not sure if this one is necessary?

    6. Installed and activated the MD5 Password Hashes plug-in for WP, and logged in again so it altered the MD5-hash.

    7. I also carried out the additional approach given by http://www.ilfilosofo.com/blog/2006/09/08/integrating-vanilla-forum-and-wordpress-themes/ to:

    (a) include the wp-blog-header.php reference in the conf/database.php

    (b) update the library/Framework/Framework.Class.MySQL.php file

    8. I then tried each of the various People.WordpressAuthenticator.php files given in this discussion, and even tried version given by mafro which included the update to the conf/database.php file, which is a little different to that suggested by http://lussumo.com/docs/doku.php?id=vanilla:integration:wordpress.

    I did not implement the login forwarding to Vanilla yet though…maybe when I get this bit working first.


    Anyway, my issues are:

    A. I can successfully login at WP, but when I move to Vanilla, I am logged out there.

    B. When I try to login to Vanilla directly, I remain logged out, unless I do what Bivak says, i.e. I comment out the $Configuration['AUTHENTICATION_MODULE'] setting and I can login to Vanilla with the credentials from Wordpress.

    C. When I go through the New Application process in Vanilla, its updates the wp_user table, i.e. I can login using the New User credentials at WP, but iafter logging in at WP, it says “You do not have sufficient permissions to access this page.”, i.e. it appears to be not setting up the Role of Subscriber for new users in the wp_usermeta table – well I believe that is the issue…would anyone agree?


    So apart from the last issue, the others make me think that it’s an issue with the Cookies. But I do not know how to resolve it. But anyway, could anyone suggest a way forward to resolve these problems.

    Thanks in advance,

    D.
  • Options
    I was finally able to get it all working! I think there was a lot of little variables that can "break" it in different ways. I'm writing up a summary of what I've done to get it working and what I think breaks it. I'll come back and post a link to it here when I get that all written up and understandable. For now, here's a little summary of what I did NOT do - - Move wordpress into it's own folder - that seemed to break the cookies for me. It works fine if I have /wordpress_root/forum_root/ but not if I have /wordpress_root/ and /forum_root/ - Install the MD5hash plugin - that doesn't seem necessary if I just use the most recent authentication script in this thread. - Update the secret key value in the database. For some reason it works fine if I just update the WP & Vanilla conf files with this value, and when I update the database table it stops working. Does the database auto-update this with what's in the conf file and salt it??
  • Options
    docgecko: The "secret" needs to be defined in the conf/database.php - not the settings.php as you said. Also, your 2nd #3 - yes, that is needed or it will not work.
  • Options
    edited June 2008
    [edit - updated my permalinks so I updated the url] I've posted what I have so far (still needs to be revised and refined) here: http://www.elorg.net/2008/06/integrating-wordpress-vanilla-with-existing-content/ I haven't done anything with the Vanilla login page or registration yet. So far I was able to get the cookies working with micz latest WP authentication file and no md5 has plugin. However, I've reinstalled countless (literally - has to be 40+) times by now - and never have I been able to login using the Vanilla login page. Is this because I don't have the md5 plugin? Or was there a step I was missing?
  • Options
    Ah brilliant stuff. I am going to try having WP in the root instead, as you suggested elorg, and I'll have a read over ur approach. Anyway, I'll let you know how I get on. Thanks for this!!! Cheers, D.
  • Options
    Hey all,

    So I have now had a chance to try out elorg's approach, but I am still unsuccessful in getting this to work.

    I am now finding that this is more and more pointing towards a cookies issue.

    Now, I can quite happily log in to either WP or Vanilla though their own login pages, but when I move from WP to Vanilla, or vice versa, it logs me out of the other. There must be some cookie compatability issue, but this is beyong my current knowledge. What I have done is used the Firefox plugin "Web Developer" to view the cookies after logging into WP and Vanilla, and I found the following:

    Cookie info after logging into WP 2.5.1:

    Name: wordpress_289b836e3a390ded4287d064cf2288ca
    Value: Daren%7C1214477343%7Cd4bbf0df54d36d57aa731e41db43b50f
    Host: www.domain.com
    Path: /
    Secure: No
    Expires: End of Session

    Cookie info after logging into Vanilla 1.1.4:

    Name: wordpress_289b836e3a390ded4287d064cf2288ca
    Value: Daren%7C1214308401%7Cc5987ebbdd3ce9965f017d88892f8ac3
    Host: www.domain.com
    Path: /
    Secure: No
    Expires: Tue, 24 Jun 2008 11:53:28 GMT

    I'm not sure how useful this is, but when compared, the Value and Expires dates are different. Plus they change on each login - logout. But obviously, when I log into WP or Vanilla, it appears to shut-down/delete the previous cookie and create a new one with exactly the same name.

    Does anyone know if this is relevant to solving this integration problem, and maybe know how to solve it?

    Many regards all,


    D.
  • Options
    edited June 2008
    Hey D. That's very strange. When you login to Vanilla, do you login with your Wordpress admin user credentials or your Vanilla admin user credentials that you set during the install? As soon as I updated the vanilla files to point to the wordpress users database, and ran the sql command to add the vanilla-specific columns, I was no longer able to login using the Vanilla login page. Do you have subdomains setup or anything? If I understand correctly how it works, that might break the cookie setup. p.s. I'm still finishing up that post about my approach. It's almost done. :)
Sign In or Register to comment.