whereKey($this->user->getKey()); } /** * My Account page */ public function index() { $this->pageTitle = 'backend::lang.myaccount.menu_label'; return $this->asExtension('FormController')->update($this->user->id, 'myaccount'); } /** * Save handler for the My Account form */ public function index_onSave() { $result = $this->asExtension('FormController')->update_onSave($this->user->id, 'myaccount'); /* * If the password or login name has been updated, reauthenticate the user */ $loginChanged = $this->user->login != post('User[login]'); $passwordChanged = strlen(post('User[password]')); if ($loginChanged || $passwordChanged) { BackendAuth::login($this->user->reload(), true); } return $result; } }