Which encryption method are you using?
Yes, if the user already exists in WP, they should be allowed to login.
I am using “other” since password are in clean text in my db, and set hashcode to:
$password2 = $password;
based on what I found here:
https://ww.wp.xz.cn/support/topic/plain-text-password-1?replies=4
Can you link a screenshot of your settings without host and db password info?
Here is a link to the settings.
external database and wordpress site are on same server, so I used localhost.
it’s mysql.
WP 4.2.2 multisite install.
running on Windows 2008 IIS7.
Here is a link to the settings on a subsite of a WP 4.2.2 multisite install
running on Windows 2008 IIS7.
external database and wordpress site are on same server, so I used localhost.
the link
Ok, quick question. So USER_NAME is a colum/field name in the user table located in the knowledgeplace2 database?
yes, and is used as a login credential in another application, so should be the login credential in wordpress too.
Ok, well everything looks correct. Are there any errors pertaining to this plugin located in wp-content/external-db-error…..txt?
I have many errors like these below now. It sounds like the log is updated a certain time after the error occurs.
Do I need to activate another extension for password hashing (sounds the reading of external database is correct, but cannot create the user in WP)?
Or do I need to set a parameter in WP to allow user to be created by your plugin?
Here are the errors:
[04-Jun-2015 17:42:38 UTC] PHP Fatal error: Uncaught exception ‘Exception’ with message ‘SQLSTATE[HY000] [1045] Access denied for user ”@’localhost’ (using password: NO)’ in C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\medoo.php:67
Stack trace:
#0 C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\external_db_auth.php(330): medoo->__construct(Array)
#1 [internal function]: external_db_auth_check_login(NULL, NULL)
#2 C:\inetpub\wordpresslms\wp-includes\plugin.php(571): call_user_func_array(‘external_db_aut…’, Array)
#3 C:\inetpub\wordpresslms\wp-includes\user.php(54): do_action_ref_array(‘wp_authenticate’, Array)
#4 C:\inetpub\wordpresslms\wp-login.php(795): wp_signon(”, ”)
#5 {main}
thrown in C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\medoo.php on line 67
[04-Jun-2015 17:43:02 UTC] PHP Fatal error: Uncaught exception ‘Exception’ with message ‘SQLSTATE[HY000] [1045] Access denied for user ”@’localhost’ (using password: NO)’ in C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\medoo.php:67
Stack trace:
#0 C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\external_db_auth.php(330): medoo->__construct(Array)
#1 [internal function]: external_db_auth_check_login(‘adminWPlms’, ‘adminWPlms’)
#2 C:\inetpub\wordpresslms\wp-includes\plugin.php(571): call_user_func_array(‘external_db_aut…’, Array)
#3 C:\inetpub\wordpresslms\wp-includes\user.php(54): do_action_ref_array(‘wp_authenticate’, Array)
#4 C:\inetpub\wordpresslms\wp-login.php(795): wp_signon(”, ”)
#5 {main}
thrown in C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\medoo.php on line 67
[04-Jun-2015 17:43:08 UTC] PHP Fatal error: Uncaught exception ‘Exception’ with message ‘SQLSTATE[HY000] [1045] Access denied for user ”@’localhost’ (using password: NO)’ in C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\medoo.php:67
Stack trace:
#0 C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\external_db_auth.php(330): medoo->__construct(Array)
#1 [internal function]: external_db_auth_check_login(‘adminWPlms’, ‘adminWPlms’)
#2 C:\inetpub\wordpresslms\wp-includes\plugin.php(571): call_user_func_array(‘external_db_aut…’, Array)
#3 C:\inetpub\wordpresslms\wp-includes\user.php(54): do_action_ref_array(‘wp_authenticate’, Array)
#4 C:\inetpub\wordpresslms\wp-login.php(795): wp_signon(”, ”)
#5 {main}
thrown in C:\inetpub\wordpresslms\wp-content\plugins\external-db-auth-reloaded\medoo.php on line 67
Looks like these errors appear when I log on other sites of my WP network for which I have not yet defined plugin settings.
So not related to current problem.
Any specific setting to add for multisite install configured in directory, not domain?
I’ve got it!
The external database I use has an email column in the user table, but the email column allows null value.
So, on login, if user and password are correct, when your plugin tries to create the user in WP, it fails since the email address is missing.
When there is a valid email address in the database, your plugin works perfectly.
Maybe you should add this information in the plugin settings panel: email column must contain valid emails otherwise user won’t be able to log even with valid credentials.