<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Auth\Admin; use ModStart\Admin\Auth\AdminPermission; use ModStart\Admin\Layout\AdminPage; use ModStart\Core\Dao\DynamicModel; use ModStart\Core\Exception\ResultException; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Form\Form; use ModStart\Layout\Row; use ModStart\Widget\Box; class ProfileController extends Controller { public function changePassword(AdminPage $s4BqE) { goto gsT0w; zGFzL: $LEyIF->password('passwordRepeat', L('Repeat Password'))->rules('required'); goto xJy81; XA9Dj: $LEyIF->password('passwordNew', L('New Password'))->rules('required'); goto zGFzL; pjGq3: $LEyIF->password('password', L('Password'))->rules('required'); goto XA9Dj; F69xT: return $s4BqE->pageTitle(L('Change Password'))->row(function (Row $Bhp8r) use($LEyIF) { $Bhp8r->column(6, new Box($LEyIF, L('Change Password'))); }); goto d5iI9; gsT0w: $LEyIF = new Form(DynamicModel::class); goto pjGq3; xJy81: if (Request::isPost()) { AdminPermission::demoCheck(); return $LEyIF->formRequest(function (Form $LEyIF) { $SjN8A = $LEyIF->dataForming(); ResultException::throwsIf(L('New Password Not Match'), $SjN8A['passwordNew'] != $SjN8A['passwordRepeat']); $pTwJr = Admin::changePassword(Admin::id(), $SjN8A['password'], $SjN8A['passwordNew']); ResultException::throwsIfFail($pTwJr); Admin::addInfoLog(Admin::id(), L('Change password')); return Response::json(0, L('Password change correct, please relogin'), null, modstart_admin_url('logout')); }); } goto F69xT; d5iI9: } }