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

Why some functions are not static but are being called as static #9

Open
AndrewEastwood opened this issue Mar 1, 2016 · 1 comment

Comments

@AndrewEastwood
Copy link

There is the function wp_cas_authentication_hooks with the list of hooked actions. Those actions are linked to logout, authenticate, show_password_fieldsand disable_function which are not static.
Moreover the check_passwords is not even implemented but it's still used add_action('check_passwords', array('UTHSCWPCAS', 'check_passwords'), 10, 3);

Is that okay?

@gpspake
Copy link
Member

gpspake commented Mar 1, 2016

Hey @AndrewEastwood Everything there should be fine. I'll try to explain everything as well as I can but I'll go review the code and see if I can get some additional input as soon as I get a chance. If you have any suggestions or see anything that looks wrong, please let me know or feel free to submit a PR.

If I recall correctly, and I'll check this and try to comment it better in the code, The check_passwords and show_passwords stuff is just there so that changes can be made to user profiles from wp-admin. Once the plugin is activated, WordPress doesn't store or save passwords at all since users are authenticated through CAS; so, when you try to change a users name or email from the dashboard, WordPress won't let you because it doesn't see anything in the password field for that user (the one you would use to enter a new password) - it basically just fails the form validation. Fixing this is simply a matter of turning off that password check and getting rid of the unused password field. If you comment that stuff out, you should notice that the password field re-appears on the user edit screen and you won't be able to make any changes their account because it will fail that validation.

As for the static methods, I believe they were made static is because of some wp_debug warnings that explicitly said they needed to be. I'd like to have a better answer than that, as to why, so I'm going to look in to that further to make sure and possibly get another set of eyes on it. In the meantime though, that should be ok.

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

2 participants