<?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 $cFzSx) { goto xsqg8; cjMo6: if (Request::isPost()) { AdminPermission::demoCheck(); return $tzSkY->formRequest(function (Form $tzSkY) { $OTBPk = $tzSkY->dataForming(); ResultException::throwsIf(L('New Password Not Match'), $OTBPk['passwordNew'] != $OTBPk['passwordRepeat']); $UdQ1p = Admin::changePassword(Admin::id(), $OTBPk['password'], $OTBPk['passwordNew']); ResultException::throwsIfFail($UdQ1p); Admin::addInfoLog(Admin::id(), L('Change password')); return Response::json(0, L('Password change correct, please relogin'), null, modstart_admin_url('logout')); }); } goto DHBEu; fDGFA: $tzSkY->password('passwordRepeat', L('Repeat Password'))->rules('required'); goto cjMo6; jN3qs: $tzSkY->password('password', L('Password'))->rules('required'); goto J0JlM; DHBEu: return $cFzSx->pageTitle(L('Change Password'))->row(function (Row $Ah4uW) use($tzSkY) { $Ah4uW->column(6, new Box($tzSkY, L('Change Password'))); }); goto z_QGS; xsqg8: $tzSkY = new Form(DynamicModel::class); goto jN3qs; J0JlM: $tzSkY->password('passwordNew', L('New Password'))->rules('required'); goto fDGFA; z_QGS: } }