예제 #1
0
 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');
 }
예제 #2
0
파일: Gadget.php 프로젝트: vincium/resa
 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');
 }
예제 #3
0
 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');
 }