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

member_process_reset_password and cp_member_reset_password hooks pass different information when firing ... why? #4305

Open
jcogs-design opened this issue May 10, 2024 · 0 comments

Comments

@jcogs-design
Copy link
Contributor

jcogs-design commented May 10, 2024

There are two EE hooks that relate to users changing their password:
cp_member_reset_password in ee/legacy/controllers/cp/login.php and
member_process_reset_password in ee/ExpressionEngine/Addons/member/mod.member_auth.php

The first passes no information to the hook when it fires


        /* -------------------------------------------
        /* 'cp_member_reset_password' hook.
        /*  - Additional processing after user resets password
        /*  - Added EE 2.9.3
        */
        $this->extensions->call('cp_member_reset_password');
        if ($this->extensions->end_script === true) {
            return;
        }
        /*
        /* -------------------------------------------*/

The second passes the member_id of the user whose password has changed.


        /* -------------------------------------------
        /* 'member_process_reset_password' hook.
        /*  - Additional processing after user resets password
        /*  - Added EE 2.9.3
        /*  - Member ID parameter added 4.0.0
        */
        if (ee()->extensions->active_hook('member_process_reset_password') === true) {
            $data = ee()->extensions->call('member_process_reset_password', $data, $member_id_query->row('member_id'));
            if (ee()->extensions->end_script === true) {
                return;
            }
        }
        /*
        /* -------------------------------------------*/

It would seem that anything that wants to do something after the user changes their password would need to respond to both these hooks ... but the absence of $member_id from the first hook makes this more complex - as the affected $member_id needs to be deduced some other way.

Am I missing something about why one hook includes $member_id and the other doesn't?

EE 7.4.9
php 8.3

@jcogs-design jcogs-design changed the title CP/Sidebar AddItem() method adds URL to link even if none specified Ignore this one ... 🐾 May 10, 2024
@jcogs-design jcogs-design changed the title Ignore this one ... 🐾 member_process_reset_password and cp_member_reset_password hooks pass different information when firing ... why? May 10, 2024
@jcogs-design jcogs-design reopened this May 10, 2024
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