BellevueCollege/wordpress-cas-client

Implement structure to configure mapping of LDAP attributes

Opened this issue · 5 comments

Child task of #8

We need a flexible structure which will allow

  • Specifying the name of the required LDAP attributes in their directory.
  • Specifying which Wordpress profile fields they map to.
  • Composite values - such as part LDAP attribute content and part static text.

This is sounding to me like a Key/Value pair collection, where the end-user can edit both the Key and Value.

Status update (e.g. talking to myself):

Renamed & moved wpCASLDAP class into its own file (casManager) and refactored to be more self-contained.

It appears that Wordpress is not treating it as a class, however. I haven't confirmed this yet, but I suspect the constructor is not executing because I'm getting errors complaining about things not being initialized, etc.

At this point, I'm thinking a better approach might be to provide wrapper functions in the main plugin file, which in turn call the casManager class - that way we can have more control over how the class is being called.

Tried a few more things - namely automatically loading classes w/ spl-autoload-register. Still having the same issue, which includes the following message after logging in:

Coming hereSHAWN-DEV
Fatal error: Using $this when not in object context in WP_ROOT/wp-content/plugins/wordpress-cas-client/casManager.php on line 104

Proceeding with creating wrapper functions in the main file.

Fixed a variety of bugs and finally got everything running. Here's a list of the major code & architectural changes to date:

  • added ldapUser class.
  • moved cas-related code into its own file & renamed to casManager.
    • created wrapper functions in wordpress-cas-client.php so we can have more control over how casManager is instantiated, etc.
  • moved defines into new cas-client-constants file.

Next steps:

  1. Now that I've got this code branch working, merge with the main dev branch.
  2. Merge all pending pull requests.
  3. Submit pull request.

@shawn-bellevuecollege it looks like you may have completed this in b745fbe but I'm not seeing any reference to this issue in the commit.

Am I correct in this assumption and should this task be closed once b745fbe is merged to mainline dev?

Yes, this task is complete, but the work was done over several different commits - the one you reference is just the last (I think).