Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with $force_update in shibboleth_update_user_data #28

Open
ghost opened this issue Aug 30, 2016 · 2 comments
Open

Problem with $force_update in shibboleth_update_user_data #28

ghost opened this issue Aug 30, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 30, 2016

I was asked to generate a semi-random (need to be unique) nickname on initial account creation and the implementation of Shibboleth seems to conflict with user_register hook.

I was able to work around this by using shibboleth_user_nickname but I was actually surprised to discover the $force_update flag in the fonction shibboleth_update_user_data.

2 observations :

  1. You absolutely need to set a filed mapping value (in admin option) even if "managed" is check to false (otherwise it generate index error visible in debug).

  2. wp_update_user($user_data) write over the value that is set by my user_register hook (not surprisingly as it's called after). Considering the value is not checked "managed" I would have assumed that it would have been handled as such even in account creation.

I would consider this as a bug but I dont see the use case of $force_update? Maybe it's just a missing check to skip over undefined mapping?

@ghost
Copy link
Author

ghost commented Oct 6, 2016

I stumbled on another problem that is more or less related. In our system, we have case where the email data would not be available at mapping time (the value is not empty, it simply doesnt exist and it crash).

I will probably patch it with something like this :

            if ( $force_update || $managed ) {
                    if (isset($_SERVER[$shib_headers[$header]['name']])) {
                            $filter = 'shibboleth_' . ( strpos($field, 'user_') === 0 ? '' : 'user_' ) . $field;
                            $user_data[$field] = apply_filters($filter, $_SERVER[$shib_headers[$header]['name']]);
                    }
            }

@michaelryanmcneill
Copy link

Hello, thank you for reporting this. I released version 1.8 today to resolve issue 1 above, as well as other issues. I am the new maintainer of the plugin and all further work on the plugin will be done in a new GitHub repository. Please review the latest updated and let me know if it resolves your issue. If it doesn't, please open up a issue in the new repository and reference this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant