public function password() { // auth Auth::isAdminAuthorized($this->signedUser, null, true, '/profile/sign-in'); $form = new \Rebond\Core\User\Form($this->signedUser); // action $save = Converter::string('save', 'post'); if (isset($save)) { $form->changePassword('/profile'); } // view $this->setTpl(); $tplMain = new Template(Template::MODULE, ['core', 'user']); $tplMain->set('item', $form); // layout $this->tplLayout->set('column1', $tplMain->render('editor-password')); // master $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col')); $this->tplMaster->set('jsLauncher', 'profile'); return $this->tplMaster->render('tpl-default'); }
public function changePassword() { $signedUser = $this->app->user(); // auth if (!Util\Auth::isAuth($signedUser)) { header('Location: /profile'); exit; } $form = new \Rebond\Core\User\Form($signedUser); // action $change = Util\Converter::toString('resetPassword', 'post'); if (isset($change)) { $form->changePassword('/profile'); } $tpl = new Util\Template(Util\Template::MODULE, ['app', 'User']); $tpl->set('item', $form); $tpl->set('checkCurrentPassword', true); return $tpl->render('password-change'); }
public function user_password() { // auth Auth::isAdminAuthorized($this->signedUser, 'admin.user.password', true, '/user'); // check $id = \Rebond\Util\Converter::int('id'); $save = \Rebond\Util\Converter::string('save', 'post'); $user = \Rebond\Core\User\Data::loadById($id); if (!isset($user)) { Session::adminError('itemNotFound', [$id], '/user'); } $form = new \Rebond\Core\User\Form($user); // action if (isset($save)) { $form->changePassword('/user', false); } // view $this->setTpl(); // main $tplMain = new Template(Template::MODULE, ['core', 'user']); $tplMain->set('item', $form); // layout $this->tplLayout->set('column1', $tplMain->render('editor-password-admin')); // master $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col')); $this->tplMaster->set('jsLauncher', 'userPassword'); return $this->tplMaster->render('tpl-default'); }