redirect('/'); } $this->config = new AauthConfig(); $this->aauth = new Aauth(); $this->request = Services::request(); helper('form'); } /** * Index * * @return void */ public function index() { $userId = $this->aauth->getUserId(); if ($input = $this->request->getPost()) { $email = $password = $username = null; if (! empty($input['email'])) { $email = $input['email']; } if (! empty($input['password'])) { $password = $input['password']; } if (! empty($input['username'])) { $username = $input['username']; } if (! $this->aauth->updateUser($userId, $email, $password, $username)) { $data['errors'] = $this->aauth->printErrors('
', true); } else { $data['infos'] = $this->aauth->printInfos('
', true); } } if ($this->config->socialEnabled) { $data['providers'] = []; foreach ($this->aauth->getProviders() as $provider) { $data['providers'][$provider] = $this->aauth->getSocialIdentifier($provider, $userId); } } $data['useUsername'] = $this->config->loginUseUsername; echo view('Account/Edit', $data); } }