I'm trying to trigger some code in an extension when a new member clicks their activation link in the welcome email e.g domain/?ACT=171&id=oZYXwJfcAx
I can access the authcode
using $id = $this->EE->input->get_post('id');
and I can detect that the current hook is activation using:
if ($this->EE->extensions->active_hook('member_register_validate_members') === TRUE){ ... }
but I can't query the exp_members
table for the member_id
using the auth_code
as it has already expired at this point.
Here's the query I'm trying to run:
$id = $this->EE->input->get_post('id');
$this->EE->db->select('exp_members.member_id');
$this->EE->db->where('exp_members.authcode =', '"' . $this->EE->db->escape_str($id) . '"', FALSE);
$this->EE->db->limit(1);
$query = $this->EE->db->get('exp_members');
if ($query->num_rows() > 0)
{
foreach($query->result() as $row)
{
$member_id = $row->member_id;
}
}
I'm going around in circles on this so any help would be greatly appreciated.
Using EE 2.9.2 with MSM and Solspace User 3.5.0 installed.