May 23

External DB plugin

Charlene @ 6:01 am

This *was* contact info for Mongolia, but now that I’ve finished service this page is less useful except for the comments for my WordPress plugin. Better for people to reply to posts, but ah, well…

Looking for previous posts/announcements/comments on this plugin? Try looking at my ext_db_auth-tagged posts.

Looking for the plugin itself? See here.

Looking for other past support q’s? I have a perpetual backlog here.

35 Responses to “External DB plugin”

  1. Roz says:

    I love the plugin for external databases. Thank you for updating it. I came across a problem though. I had to escape out all the MDB2 part to get it to work.

  2. Charlene says:

    Hmm. Do you run PHP4 or PHP5? It may be also due to using a separate PEAR package…let me know and I’ll try testing for other random things.

  3. Dustin says:

    Hello,
    I’m trying to get your external database plugin to work but am having some problems.
    It’s not showing any errors.

    I have a WordPress MU installation at http://beta.wannanetwork.com and a vbulletin install at http://beta.wannanetwork.com/discussion

    I’m trying to authenticate the users from vbulletin into the WordPress so it can share the same user accounts.

    I believe I’ve entered all the information correctly but it’s failing to bridge the gap between MU and vBulletin.

    Do you know I can accomplish this?
    Thanks for your time.
    Dustin

  4. Cenji says:

    Hello. New to WP and came across your external DB plugin – the only one I could find that should do as I need. Thanks!
    Unfortunately, I tried it on WP 2.7 and it doesn’t seem to work (and you only advertise it to work upto 2.6.3). When I click the ‘Save Changes’ form button from the plugin options settings page, I’m presented with a WordPress Failure page that reads “Are you sure you want to do this?” without any button/option/link and a “Please try again” link leading back to the options page.
    So – just wondering if you’ve struck that, heard of anyone that has, or have any ideas about possible causes / compatibility with 2.7 etc.
    Thanks!

  5. Charlene says:

    Hey Cenji, I’ll check it out sometime in the next week or two to see what’s causing that error. I haven’t tried it on 2.7 yet, so maybe something weird is happening. I do remember seeing this error from a previous version while I was working on it.

  6. Ryan says:

    I am also having the same problem as Cenji where I get a WordPress failure message when trying to save the settings. Thanks for this awesome plugin and hope you can make it compatible with version 2.7.

  7. Charlene says:

    I’ve been stumped with the upgrade/migration process, but I’m hoping to get some advice eventually…see here: http://wordpress.org/support/topic/230231

    If someone (anyone) gets back to me I can get this fixed up pronto. Sorry for the delay so far…

  8. Charlene says:

    Ok it’s fixed now. Version 3.1 works with WP 2.7 and as far as I’ve tested all functionality is still there. Just updated to repository so it should get pushed out soon.

  9. Elena Coen says:

    I would like to use your external DB plugin to work with WordPress and Moodle. I am planning on having a pay site (online courses), perhaps with a free trial period or overrides for those I wish to give a free trial for. Can you give me any advice before starting?

    Thank you very much, Elena

  10. Charlene says:

    Hi Elena,

    Not sure what advice to give, but the way authentication would work is from Moodle DB –> WP DB. It’s pretty straightforward, but I’m not sure if you are authenticating in that direction or from WP –> Moodle.

  11. Stephen Coley says:

    Charlene,

    I’m working on a site right now that uses an external database, not for authentication, but just for user info. I’m trying to connect to this database in the header of my site, but as you may know this causes troubles and breaks the WordPress database connection.

    I saw your External DB Authentication plugin, and it seems to have a solution for me somewhere in there, but I just can’t put my finger on it. How do you make the connection to the external db without breaking WP?

    If you could please advise on this, I would be very appreciative. I’m quite interested to see how this can be done.

    Stephen

  12. Charlene says:

    Stephen,

    There’s a hook I use which, if I recall correctly, starts right before wordpress’ authentication method. I believe what I do is authenticate then pass/set those variables so that when it goes to wordpress’ authentication it skips onward as it seems to be set.

    My guess is that you’re going to want to hook in a similar spot, or right after wordpress’ authentication (the latter makes more sense to me, as you’d need to make sure it’s a valid user before pulling data).

    If you’re not using a hook, you could try setting the database connection to a resource handler (see http://www.php.net/manual/en/function.mysql-connect.php) and the $link variable. Perhaps that will keep from breaking the basic WP database connection.

    Let me know how that turns out…

  13. Jon says:

    I am integrating your plugin into a site that uses SHA384 and stored salts. Unfortunately, I am a Coldfusion guy, not a PHP guy, so I need a bit of guidance. I will be replacing

    $password2 = $password1;

    with

    $password2 = hash_hmac(sha384,$password,$salt);

    but I need to figure out how to stick a new query into your plugin to grab the salt out of the db according to the username before it checks the password value. Any guidance would be appreciated.

  14. Jon says:

    This is it, in case anyone else needs to do something like this:

    case “Other” :
    //right now defaulting to plaintext. People can change code here for their own special hash
    // first get the salt out of the TR db according to the userName
    $query = “SELECT salt FROM ” . get_option(‘ext_db_table’) . ” WHERE “.get_option(‘ext_db_namefield’).” = ‘$username’”;
    $result = db_functions($driver,”query”,$resource,$query);
    $salt = db_functions($driver,”fetch”,$result,”");
    $password2 = hash_hmac(sha384,’$password’,'$salt’);
    eval(get_option(‘ext_db_other_enc’));
    break;

  15. Charlene says:

    Hey Jon,

    Thanks for the code – I’m in transit (literally) back to the US so haven’t gotten a chance to reply. I’m thinking maybe of adding a salt field to pull from too, so in that case all you’d need to do is use

    $password2 = hash_hmac(sha384,’$password’,’$salt’);

    in the “other” code. Am I correct?

  16. brad says:

    Hello. Thanks for the plugin! I was just wondering if this plugin would work for authenticating to WP with a Drupal DB as the source? Do you know of anybody who has tried? I’m going to try setting it up but I thought I’d just ask the question while I am here at your site (in case you know already that it doesn’t work).

  17. Paragon says:

    I, too, would love to get this working to authenticate my existing users from my Drupal DB gaming site to my new WP site I use for my game world. I installed the module but get a blank white screen when trying to login to WP.

  18. Charlene says:

    @brad and @paragon: updated the plugin but mostly replied to your issue via WP forums. Please check it out there…not much lead-wise, I think, unless you figure out how to do the hash the way Drupal does it…

  19. mknjhill says:

    I’d like to request a modifacation as i dont think it will work with my database.

    i have a table for admins, and a table for clients, how can i get this to work for me? please email me @ mknjhill [at] gmail . com
    thanks

  20. Oais says:

    Hi All,

    Can anyone send me their example PEAR script to connect/authenticate wordpress to postgresql. It would save me 10000′s of hours of research for a noob programme like me.

    Thanks !
    oais
    oais1@hotmail.com

  21. Oais says:

    Sorry, I meant “Share” with me their PEAR and Postgresql connecting script

  22. Chris says:

    I have a question. I am trying to use this with IPB forums. They use a hash and salt which I am not sure what it means but think it is an encrypted password with a salt or string? right?

    I am trying to figure out how to enter that information in the plugin admin page.

    If the password is encrypted with a salt… what kind of work do I need to do to make this work? thanks in advance

  23. Chris says:

    if this helps there are two fields in the external database:

    members_pass_hash and members_pass_salt

    Now I am really a noob with php but would the Hash Code to input be:

    $password2 = md5(md5($results['members_pass_salt']).md5($password));

    thanks in advance

  24. rasoul_h says:

    Hi, i want to integrate wordpress 3.01 with mybb 1.4.13 but i can’t do it. Can you make me a guide on how to do it. I think i put wrong hash code for password. Please send it to me rasoul.hamidian@gmail.com

  25. AlecS says:

    Hi,

    I can’t get your plugin to work correctly. I am trying to authenticate against a phpBB3 database, and I know the hashcode function, but cannot figure out where and how to include the reference.

    I wish phpBB just used MD5 still…

    Is there any way you can help me???

    thanks,
    Alec

  26. AlecS says:

    Ok, so instead of doing that, I’ve just converted the phpBBHash back to MD5.

    I’ve confirmed that the conversion was correct.

    I’ve put the new MD5 password into a new row, and specified that as the password column. I enabled MD5 in the settings, but still nothing happens. Just says invalid password.

    I want SO MUCH for this thing to work, but I fear it’s just not gonna.

    Help mmeeeee….

    -Alec

  27. Joe says:

    Why was my comment removed?

    I’m using the latest version of wordpress and although at the time things seemed fine, upon a member testing the system he was unable to login into wordpress and since I’ve found that it has only allowed my account to be ported to wordpress. I’m not exactly sure, although I would love to make the most of this plugin and would appreciate any help.

    Kind regards

  28. Maheshwar says:

    I like the plugin but confused about implementation.
    I am using phpgedview and want to auth my users against phpgedview – mysql db. Server is on godaddy. Can you please guide? Many thanks for your time & help.

  29. John McLear says:

    I’m not sure this plugin works in WordPress v3+. I had it working great before I upgraded.

    Any idea?

  30. John S says:

    Unfortunately I think John McLear is correct, this plugin seems to be broken as of WordPress 3.0.

  31. Hylson says:

    Put this:

    $password2 = md5($password.’salt_phrase_in_your_config’);

    in the hash code of your client login. I used this with integration Moodle x WordPress, and works!

  32. David Rajah says:

    @Hylson: May I Knew what is ‘salt_phrase_in_your_config’ where it is located ? Please give some Examples I would like t integrate Moodle and WordPress

  33. Jonathan Goldford says:

    I am about to start using this plugin for WordPress version 3.1.3 and want to make sure it still works. Can you confirm that it does?

  34. nanopark says:

    Hello
    not work by mybb and error is:
    ERROR: Invalid password.

    please help me.
    thankyou for plugin

  35. arky says:

    I needed to integrate WP MultiSite and Moodle and wanted to use the Moodle database as the master login database as it’s more complete than WP. Your plugin was a great start for this. I did have problems getting it to work with MultiSite initially, You do warn about it so not your fault.

    I made some modifications to version 3.15 which gets it working nicely with WP MultiSite. The problem was that on retrieving options from the WP database it changes for each blog id to a different blog specific table. The modification I made insure that the base table for blog id=1 is always referenced when pulling option for the plugin.

    I also disable the editing form on sites other than the base blog except for a checkbox that I added which enables or disables the external login for that particular blog. It can also disable the plugin for the base blog while letting the child blogs continue to use external login. So you can have a mix of blogs running the local WP database or the external database.

    I you’re interested in the mods drop me a line.

Leave a Reply