Jan 08 2009
external db authentication plugin now works with Wordpress 2.7
A quick note – the latest version (3.07) of ext_db_auth now works with Wordpres 2.7. It’s in the same place as usual. This version, however, is NOT compatible with WPMU. You’ll still need to use 2.05 with that.
Once WPMU hits 2.7 it may be broken again for that particular flavor; we’ll see.




January 20th, 2009 at 5:29 am
Great plugin,
I’m in the process of porting over from a old school CMS to a new Wordpress MU with buddypress social network. I’m using your plugin to allow for an easier transition between the two sites, and 2 databases.
My Question is:
I’m trying to decide the best way to modify your plugin so it will not overwrite wp data. I want people to be using the wordpress tools for password recovery, account creation, and such. I understand how your plugin works, just looking for some pointers of places I maybe able to comment out to prevent it overwritting data in WP tables.
Thanks,
Brad
http://gorgeousgamers.com
January 21st, 2009 at 1:58 pm
Hey Brad,
You’re going to want to look around line 325 in the if statement. Essentially, the $userarray fields are grabbed from that parent DB. The thing is, though, is that the direction of this is Foreign DB –> WP DB. To go the other direction, which things like account creation and what-not would use I believe, you need a tool going the other way. Hope that helps/makes sense.
January 27th, 2009 at 9:54 pm
Hi Charlene… awesome plugin.
Can you tell the most recent stable version of the plugin for MU?
Best!
January 28th, 2009 at 11:05 am
Hi Chris,
For MU 2.6.x it should be plugin version 3.05. Link is here
January 28th, 2009 at 11:07 pm
Thanks Charlene…
I am trying to connect to a MySQL DB but the encryption is clear text… I’m not sure what php to enter in the the “other” field for the password2 variable. Can you possibly give me a code template?
Sorry for being a bit dense…
January 29th, 2009 at 9:02 pm
No worries. Most likely it’ll be $password2 = $password;
February 8th, 2009 at 3:56 am
Warning: Cannot modify header information – headers already sent by (output started at
Hi!
I tried to integrate your external database bridge. I always received this error-messages? Nothing is working afterwards! Can you help me please. The external database is a moodle-database!
Thank you!
/www/htdocs/w00a8023/wordpress/wp-content/plugins/ext_db_auth.php:1) in /www/htdocs/w00a8023/wordpress/wp-includes/functions.php on line 698
Warning: Cannot modify header information – headers already sent by (output started at /www/htdocs/w00a8023/wordpress/wp-content/plugins/ext_db_auth.php:1) in /www/htdocs/w00a8023/wordpress/wp-includes/functions.php on line 699
February 8th, 2009 at 1:27 pm
Hmm. Which version of wordpress are you using? and which version of the plugin?
February 10th, 2009 at 7:30 am
Hello Charlene-
FYI – I’m getting EXACTLY the same error as Jorg: two ‘cannot modify header’ errors – lines 698 and 699 that display on admin pages. This is a virgin/new WordPress installation. v2.7 and your plug-in is the first and only plug-in I have activated. I’ll look into it some..I haven’t troubleshot it yet at all.
-Jay
February 10th, 2009 at 8:06 am
Okay..that was easy. Error actually said ‘output started a line 1 of ext_db_auth.php’. So this indicates a white space character (or more specifically.. UTF8 byte order mark) was at beginning of file. This might have happened during preview of code OR upload to my unix server. I deleted the first line of file and manually re-type it & saved. That corrected problem.
Anyhow, plug-in works great (out-of-the-box)! Kudos to Charlene!
February 11th, 2009 at 11:47 pm
Hi Jay,
Thanks for the feedback – I did the same and re-committed the files just in case it was on my end. Glad you like it
March 4th, 2009 at 12:25 pm
This is a fabulous plugin and one that is much needed. Thanks!
My request is that you please make this available for Postgres without requiring all the PEAR crap. Why bundle PG with other nonsense like MSSQL? PHP has fantastic support for PG now, all internal. Just like MySQL.
I cannot use this plugin because I simply refuse to install all the PEAR drivel. Please please release a version for PG that works like MySQL. Even the function names are the same! mysql_connect is pg_connect, mysql_query is pg_query, and so on.
Thanks for considering!
March 4th, 2009 at 12:26 pm
Also, could you please have a “Subscribe to comments” feature on the blog so we can track if you or someone else writes a followup to our comment. Thanks.
March 30th, 2009 at 6:39 pm
Hello Charlene,
I’d like to submit a small code patch for your plugin, which makes things a little neater:
<?php
$roles = array(‘is’,'is not’, ‘greater than’, ‘less than’);
$first=true;
$chosenOption = get_option(‘ext_db_role_bool’);
foreach ($roles as $role)
{
echo ”.$role.”;
$first = false;
}
?>
For the selector. A further development might be to construct the DB search parameters from the same array…
March 30th, 2009 at 6:40 pm
Dang, no HTML allowed and no preview on comments…. try again
-select name=”ext_db_role_bool”-
-?php
$roles = array(‘is’,'is not’, ‘greater than’, ‘less than’);
$first=true;
$chosenOption = get_option(‘ext_db_role_bool’);
foreach ($roles as $role)
{
echo ‘-option’ . (($chosenOption == $role || $first==true && ”==$chosenOption)?’ selected=”selected”‘:”).’-’.$role.’-/option-’;
$first = false;
}
?>
-/select-
I’ve replaced HTML arrows with – symbols.. sorry
April 8th, 2009 at 7:35 pm
Hi,
I am getting this error ( I saw Haas also had the same issue). My WP ver 2.7.1 and plugin version is Version: 3.1.
Any pointers would be great.
Thanks
Warning: Cannot modify header information – headers already sent by (output started at /home/vic/wordpress/wp-content/plugins/ext_db_auth.php:1) in /home/vic/wordpress/wp-login.php on line 255
Warning: Cannot modify header information – headers already sent by (output started at /home/vic/wordpress/wp-content/plugins/ext_db_auth.php:1) in /home/vic/wordpress/wp-login.php on line 267
April 8th, 2009 at 10:34 pm
With WP 2.7.1 and Plugin v. 3.1, the login page throw me a white page, without redirecting me to the dashboard, why? Can you fix it?
April 17th, 2009 at 4:24 pm
Hey,
@Driveros: I was having that empty screen problem (but with Wordpress MU 2.7), and I fixed it by doing what was suggested above:
Delete the first line of ext_db_auth.php and type it in manually again. There are some strange invisible characters at the end that make it not work.
I just did that, and it now lets me login and log out.
April 17th, 2009 at 4:29 pm
@Driveros and everyone else:
Ok, I have done some more checking: Charlene is obviously developing this plugin on Windows (or at least it is in Windows format: CR and LF at the end of every line). This seems to create a problem when you run it on Linux. The best fix is to use an editor that can convert between Windows and Linux for line endings.
In Linux, Geany can do it. Use the menu Document, then Set Line Endings.
With Geany you can also enable the option that displays invisible characters, and you can see what I mean.
In Windows, check Notepad++, it should also be able to do the conversion.
April 19th, 2009 at 6:22 pm
@all: Sorry for delayed response – I’ve been out of the country and busy besides. I’ve since moved to Ubuntu and I ran dos2unix on the plugin file as well as tried deleting the first two lines of the plugin and retyped em in to get rid of the random character in there. I got it back off the server and tried it with no problems on this end – let me know if the issues persist.
April 22nd, 2009 at 5:36 am
I’still having problems with the encoding (wp 2.7 and plugin v 3.1). I cannot figure out why shows an empty login page. did you uploaded a new version? Thanks in advance
April 22nd, 2009 at 11:05 pm
I fixed it!. The problem wasn’t the plugin, but my pear-mdb2 installation. After that it worked ok. Since my settings involve more than one table, i used a view which worked great.
It would be ideal to have a ‘test configuracion button’ to check that the mdb2 directory exists and that db/table/fields are set correctly
May 14th, 2009 at 4:31 pm
Hi! First, thank you for your lifesaver plugin!
There is one missing thing (unless I looked over something) I had to fix: setting the mysql encoding after connecting:
function db_functions($driver,$process,$resource,$query) {
…
mysql_select_db(get_option(‘ext_db’),$resource) or die(mysql_error());
mysql_query(“SET NAMES ‘utf8′”,$resource) or die(mysql_error()); //extra line to fix encoding problems, currently hardcoded utf-8
May 21st, 2009 at 12:27 am
@biziclop: Just to make sure, did it not work until that line was set? What was your database encoding originally? Curious as I tend to have default set as utf8_ci myself…
May 26th, 2009 at 2:23 pm
Thanks for the great plugin – just wondering if now that WPMU 2.7 is out whether it works with that or if you have any plans to make it do so? (Looks like it might from a comment above!)
May 30th, 2009 at 10:18 pm
@25: Yep it works.
June 12th, 2009 at 6:50 am
Hi Charlene,
Thanks for the great plugin. Very elegant. Works like a champ.
I’m am in need of a similar authentication plugin. The authentication would happen based on an HTTP request and the response would be in the form of an XML document.
We’re using WPMU 2.7.1.
If you would be at all interested please contact me soonest and I’ll gladly send you a box of Luna Bars in the flavor of your choice.
All kidding aside, this would be a paying job, and from the looks of the code you wrote already, shouldn’t be too heavy.
Thanks in advance.
June 16th, 2009 at 1:00 pm
Hi. Thanks for this delightful plugin. I’m using 2.7.1MU, and sqlserver. Authentication is working great, but Role field for validation, and other additional fields like name and email are not populating. It is strange but if i set the fields to fields that do not exist, they return errors (which would be expected). When the fields are properly configured, they always just seem to return blank (I am sure there is data in the table). Anyone have a similar problem?
June 20th, 2009 at 4:24 pm
I figured it out. I had db fieldnames in my mssql db with uppercase letters in them(i never got over java naming conventions.) MDB2 would fetch the assoc’s as all lowercase fieldnames(I assume it was mdb2 doing this). All this plugin needs to authenticate is a rowcount, which it was getting. However, since I was configured to look for some uppercase fields, the lookup would fail and all my fields populated blank. Setting field names to all lowercase in the config cleared it right up (still found in mssql which is case insensitive, and now found in the fetched row).
October 20th, 2009 at 3:47 pm
It seems as there is a bug in the authentication, as users are still getting authenticated, if they’ve clicked on “Remember Me”.
This will save the login credentials in a cookie.
But it seems, as ext_db_auth_check_login() isn’t used, if wp_validate_auth_cookie() is returning a user.
Any idea for getting this fixed?
Thanks in advance.
Steffen
December 15th, 2009 at 3:15 am
Hi thanks for this pluging
I install and specify everything but now i can’t login no more. The login page give a empty page. I don’t know if someone know where is the problem? am using worlpress 2.8.6 and the plugin version is 3.1
Thanks
adiallo
December 20th, 2009 at 9:12 pm
Same here…blank login page.
June 27th, 2010 at 6:48 am
Hi Can somebody help to get this working with WordPress 3 and Joomla 1.5?
I tries but with no success.
August 18th, 2010 at 5:32 am
I thought I had everything setup and working, although nobody else manages to login via wordpress. It worked for myself but that’s it, not sure if the config has messed up or something but I’ve tried everything I can think of. (remove plugin, re-type details) etc
Any help please