uhm-coe / authorizer

Authorizer is a WordPress plugin that uses Google, CAS, LDAP, or an OAuth2 provider for logins, and can prevent public access to a WordPress site. It also blocks repeated failed login attempts.
GNU General Public License v3.0
65 stars 38 forks source link

Undefined index: ldap_test_user in class-options.php line 210 #118

Closed aberkow closed 2 years ago

aberkow commented 2 years ago

hey! I've got a strange issue here. I have two multisites both with authorizer 3.4.0. On one, everything is fine. On the other, I get the PHP notice Undefined index: ldap_test_user in /var/www/sites/edu.uconn.devredesign/public_html/content/plugins/authorizer/src/authorizer/class-options.php on line 210.

There are two differences between the installations. On the first, I added authorizer a couple weeks ago. On the second, I added it today. The other difference is that on the first, there's an ldap.php file at /wp-content/ldap.php which is not present on the second.

I looked at the support forum and came across this similar issue. It looks like a date value was changed in fd917d5 in the class-updates.php file. Is something similar needed again? Can you help me understand what this value does?

Thanks very much!

figureone commented 2 years ago

Aloha sorry for the delay, been a busy start to the semester!

The commit you referenced should have caught the missing default value for ldap_test_user, so that's strange you're seeing different behavior. class-updates.php is basically a set of migrations that need to happen to current installs when a new version is released. Authorizer checks its wp_options auth_version value against those YYYYMMDD strings and if it's lower, it will run that specific migration. In this case we were just triggering a set_default_options() call on all subsites to ensure that any missing Authorizer options were set to their default values (ldap_test_user was a recently added option for testing LDAP connections within the Authorizer Settings screen).

I haven't seen this before so we will try to set up a fresh install to see if we can reproduce. You can safely ignore the notice for now, though, it won't harm anything.

Also the wp-content/ldap.php is not related to Authorizer, you may want to check its contents and consider removing it.

aberkow commented 2 years ago

Hi! No problem, I know how the start of the semester goes 🙂

I'll check things out again when I get back to work next week. It's always possible I missed something.

aberkow commented 2 years ago

Well I'm not sure what changed between last week and today, but now all those warning are gone. I certainly didn't do any maintenance over Labor Day, so at the moment it's a mystery. But I'll close this since it doesn't seem to be an issue any more.

figureone commented 2 years ago

Thanks, let us know if you see it happen again!