<?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 $dB877) { goto HBjpZ; F5ZQN: $SKFwZ->password('password', L('Password'))->rules('required'); goto A2hy6; DKm8T: if (Request::isPost()) { AdminPermission::demoCheck(); return $SKFwZ->formRequest(function (Form $SKFwZ) { $zvN10 = $SKFwZ->dataForming(); ResultException::throwsIf(L('New Password Not Match'), $zvN10['passwordNew'] != $zvN10['passwordRepeat']); $ZIe4d = Admin::changePassword(Admin::id(), $zvN10['password'], $zvN10['passwordNew']); ResultException::throwsIfFail($ZIe4d); Admin::addInfoLog(Admin::id(), L('Change password')); return Response::json(0, L('Password change correct, please relogin'), null, modstart_admin_url('logout')); }); } goto S9ghg; HBjpZ: $SKFwZ = new Form(DynamicModel::class); goto F5ZQN; A2hy6: $SKFwZ->password('passwordNew', L('New Password'))->rules('required'); goto pB3J3; S9ghg: return $dB877->pageTitle(L('Change Password'))->row(function (Row $hcOFW) use($SKFwZ) { $hcOFW->column(6, new Box($SKFwZ, L('Change Password'))); }); goto zoqpx; pB3J3: $SKFwZ->password('passwordRepeat', L('Repeat Password'))->rules('required'); goto DKm8T; zoqpx: } }