<?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 $JQ7cs) { goto U6_2P; RDY35: return $JQ7cs->pageTitle(L('Change Password'))->row(function (Row $PBpDU) use($u4AHU) { $PBpDU->column(6, new Box($u4AHU, L('Change Password'))); }); goto xxcki; IEKQu: if (Request::isPost()) { AdminPermission::demoCheck(); return $u4AHU->formRequest(function (Form $u4AHU) { $EdQjV = $u4AHU->dataForming(); ResultException::throwsIf(L('New Password Not Match'), $EdQjV['passwordNew'] != $EdQjV['passwordRepeat']); $JOw_A = Admin::changePassword(Admin::id(), $EdQjV['password'], $EdQjV['passwordNew']); ResultException::throwsIfFail($JOw_A); Admin::addInfoLog(Admin::id(), L('Change password')); return Response::json(0, L('Password change correct, please relogin'), null, action('\\ModStart\\Admin\\Controller\\AuthController@logout')); }); } goto RDY35; UMVCJ: $u4AHU->password('passwordNew', L('New Password'))->rules('required'); goto sFS_2; U6_2P: $u4AHU = new Form(DynamicModel::class); goto YXYtU; YXYtU: $u4AHU->password('password', L('Password'))->rules('required'); goto UMVCJ; sFS_2: $u4AHU->password('passwordRepeat', L('Repeat Password'))->rules('required'); goto IEKQu; xxcki: } }