Members Extension Logging Out on Password Update
This is an open discussion with 1 reply, filed under General.
Search
I got it to work with a custom event. Would love a critique if anyone knows of better ways to do things, or sees issues with the way I've accomplished this.
public function load(){ if(isset($_POST['action']['member-edit'])) { //Get the Member ID from param pool $the_member_id = $this->_env['param']['member-id']; //Fetch the Members full entry $member = EntryManager::fetch($the_member_id, 1); if(!isset($_POST['fields']['email'])) { $memberemail = $member[0]->getData(1); // 1 is the ID of the field $_POST['fields']['email'] = $memberemail['value']; } return $this->__trigger(); } } protected function __trigger(){ //This runs the event and saves the new information (including a new password) to the section include(TOOLKIT . '/events/event.section.php'); //This only runs if a new password is present if(isset($_POST['fields']['password']['password'])) { //This basically logs out and logs back in the user $_REQUEST['member-action']['login'] = 'Login'; $_POST['fields']['password'] = $_POST['fields']['password']['password']; $membersExtensionThing = Symphony::ExtensionManager()->create('members'); //This replaces the outdated session with the old password with the new session $member = EntryManager::fetch($_SESSION['sym-members']['id'], 1); $memberpass = $member[0]->getData(2); // 2 is the id of the field $_SESSION['sym-members']['password'] = $memberpass['password']; } return $result; }
Create an account or sign in to comment.
Was bummed to learn tonight that the members extension has a bug in it that logs the member out when they update their password.
It seems to have been confirmed on github:
Though I'm technically still on Sym 2.3.6 and Members 1.3 for this project.
Is there any kind of manual override I can do within the event to prevent this from happening? Or any other suggestions?