• Resolved Chandra M

    (@nhuja)


    I was able to connect to external database and at the first setting, I was able to login with the username/password hosting externally. Then, I tried to add roles which is 1 and 2 in the db and tried to map them to admin and subscriber. Then, I cannot login after that. I have reverted to the before settings but I can’t login now too. Check the debug log I see these lines

    [15-May-2021 07:08:27 UTC] PHP Notice:  Undefined index:  in ..../wp-content/plugins/external-login/login/db.php on line 100
    [15-May-2021 07:08:28 UTC] PHP Notice:  Undefined index:  in ..../wp-content/plugins/external-login/login/db.php on line 101
    [15-May-2021 07:08:28 UTC] PHP Notice:  Undefined index:  in ..../wp-content/plugins/external-login/login/db.php on line 102
    [15-May-2021 07:08:28 UTC] PHP Notice:  Undefined index:  in ..../wp-content/plugins/external-login/login/db.php on line 103
    [15-May-2021 07:08:28 UTC] PHP Notice:  Undefined property: WP_Error::$ID in ..../wp-includes/class-wp-user.php on line 171

    The first 4 lines seems to be because the values are blank.. but not sure what the last line of error is. I just cannot login, its not showing any errors on the login page, just refresh with the login form.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Chandra M

    (@nhuja)

    Saw your other thread like this: https://ww.wp.xz.cn/support/topic/cant-login-and-undefined-index/ and figured that I was running PHP 7.2 before so, not sure if it worked then. I think I had updated PHP version to 7.4 before trying the settings as 7.2 was not connecting to external database. Does PHP 7.4 require anything special for this to be working?

    Thread Starter Chandra M

    (@nhuja)

    Ah, found out that it actually imported the data from external database (only that user I was testing) so somehow it wouldn’t login.. I removed that entry and I could login. will need to do more tests now. Thanks.

    EDIT: Yes, so when I first login, it seems to work but it imports the data into the wp table and from 2nd time, it wouldn’t login. I have set not to check local login but still seems to check that. I see the password is saved in a different format.. its already md5 but seems to do it again? not sure.. I don’t see invalid login but it just doesn’t go inside wp-admin. When I remove the data, it works but imports again as soon as I login. I tested with password hashing set to none but doesn’t work.

    Is it possible to disable any imports to wp database? I just want to use the external db to login.

    • This reply was modified 5 years ago by Chandra M.
    • This reply was modified 5 years ago by Chandra M.
    Thread Starter Chandra M

    (@nhuja)

    On second thought, I think we will need the wp database as users should be able to comment on posts. I had to make a workaround to fix the issue. I had an encrypted database and usernames in WP only seems to take lowercase so I had to add some code. I didn’t see hooks in there so most probably I will just rewrite the whole authentication.php file in my theme with that whole authenticate hook.. I hope that will work.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Not logging in’ is closed to new replies.