authLdap icon indicating copy to clipboard operation
authLdap copied to clipboard

Make transition from sitewise LDAP on Multisite easier

Open heiglandreas opened this issue 6 years ago • 10 comments

When old LDAP-Plugin (pre 2.0.0) was used within a multisite environment updating to 2.0 is a PITA as the config is lost.

So it would be great to have the possibility to enable a "legacy"-mechanism that will still allow the plugin to be used like before…

heiglandreas avatar Nov 03 '17 11:11 heiglandreas

A note about this in the changelog or readme would be great as well...

Will the old config be used again if I revert to v1.5.1? edit: nope, i reverted (by hand in wp-content/plugins) and all config is lost

noerw avatar Nov 11 '17 20:11 noerw

I‘m sorry for the inconvenience. Though there is a note in the Changelog: „This new release adds Multi-Site support. It will no longer be possible to use this plugin just in one subsite of a multisite installation!“

Though the revert to 1.5.1 should have re-used the old config... I‘m investigating that!!!

heiglandreas avatar Nov 11 '17 20:11 heiglandreas

Thanks for the quick feedback, much appreciated. What I meant about the changelog: There's no warning that existing installations will inevitably loose their configuration.

But maybe this loss is my fault. Is/was the config stored in the database or in a file local to the plugin?

noerw avatar Nov 11 '17 20:11 noerw

That‘s right. As I wrote the changelog I wasn‘t aware that that might happen. And it should actually not be lost as the config is stored in the database. And the Multisite Plugin just looks at a different place for the config. There is nonroutine to delete the config. That‘s what actually worries me a bit....

I‘ll get back to you as soon as I find a solution!!

heiglandreas avatar Nov 11 '17 20:11 heiglandreas

This is what I have in my authLDAPOptions in the wp_options table:

a:18:{s:7:"Enabled";b:0;s:7:"CachePW";b:0;s:3:"URI";s:0:"";s:12:"URISeparator";s:1:" ";s:6:"Filter";s:0:"";s:8:"NameAttr";s:0:"";s:7:"SecName";s:0:"";s:7:"UidAttr";s:0:"";s:8:"MailAttr";s:0:"";s:7:"WebAttr";s:0:"";s:6:"Groups";a:0:{}s:5:"Debug";b:0;s:9:"GroupAttr";s:0:"";s:11:"GroupFilter";s:0:"";s:11:"DefaultRole";s:0:"";s:11:"GroupEnable";b:1;s:13:"GroupOverUser";b:1;s:7:"Version";i:1;}

Looks like the default.

However I also have a table wp_2_options, in which the row with authLDAPOptions seems to contain the correct configuration.

noerw avatar Nov 11 '17 21:11 noerw

I assume that the wp_2_options-table contains the configuration of the site you included authLDAP into.

There is the PR #141 open, that contains a possible fix. Would you mind checking whether that actually fixes the issue? Or did you already remove the entry from the wp_2_options-table? That fix basically checks whether there is the old config-entry and if so behaves like before the MultiSite was added…

I'd be really thankful for your insights!

heiglandreas avatar Nov 12 '17 09:11 heiglandreas

WIth your patch the configuration page does not show up at all anymore, not in the site-specific settings (as in 1.5.1), nor in the network settings (2.0.0) :/

Originally I installed & enabled the plugin globally for the network, but configured each page separately. Might that cause issues?

noerw avatar Nov 12 '17 19:11 noerw

With the new version 2.0.3 that should work. I tested it on a local setup and I could enable the plugin site-wide and had to edit the config in the single sites…

Can you confirm that?

heiglandreas avatar Jan 19 '18 07:01 heiglandreas

So, there's a bit of an issue in 2.0.3.

When you upgrade to authLdap 2.0.3 in a multisite install that had been previously upgraded to 2.0 and previously from 1.5, the authLdap setting menu disappears completely from the network settings page (/wp-admin/network/settings.php)!

I think this is because you're checking for a whether it's a multi-site install by checking for the existence of an authLDAPOptions option. If it's there, then authLdap_is_multisite() returns false. If the primary site in a multisite install had been previously upgraded from authLdap 1.5 to 2.0, then it will contain that legacy authLDAPOptions entry in the wp_options table.

Deleting that legacy entry from the wp_options table allows the network authLdap settings page to show up again. (The same goes for deleting that entry from wp_*_options for any other sites that you would like to use the network's authLdap config instead of local config.)

I'm not really sure what the code fix for this would be. But I wanted to post here to note the issue.

wunc avatar Jan 22 '18 22:01 wunc

That was the idea! As it's been a sitewise configuration before 2.0 the main idea was to bring back the sitewise configuration for Multisite-installs from the before-2.0 era. When you delete the database-entry for authLDAPOptions in the wordpress-options table you get a network-configuration.

Enabling a network configuration within such a pre-2.0 multisite-intallation via the admin-interface is on the roadmap for the upcoming versions. See #145

heiglandreas avatar Jan 23 '18 07:01 heiglandreas