<?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 $hf49q) { goto p433_; Ai3OG: $mjvnb->password('passwordRepeat', L('Repeat Password'))->rules('required'); goto gDrdW; IJZ00: return $hf49q->pageTitle(L('Change Password'))->row(function (Row $V0u2z) use($mjvnb) { $V0u2z->column(6, new Box($mjvnb, L('Change Password'))); }); goto Xzc38; K84da: $mjvnb->password('password', L('Password'))->rules('required'); goto NtiP6; gDrdW: if (Request::isPost()) { AdminPermission::demoCheck(); return $mjvnb->formRequest(function (Form $mjvnb) { $IaeCl = $mjvnb->dataForming(); ResultException::throwsIf(L('New Password Not Match'), $IaeCl['passwordNew'] != $IaeCl['passwordRepeat']); $gbVzz = Admin::changePassword(Admin::id(), $IaeCl['password'], $IaeCl['passwordNew']); ResultException::throwsIfFail($gbVzz); Admin::addInfoLog(Admin::id(), L('Change password')); return Response::json(0, L('Password change correct, please relogin'), null, modstart_admin_url('logout')); }); } goto IJZ00; p433_: $mjvnb = new Form(DynamicModel::class); goto K84da; NtiP6: $mjvnb->password('passwordNew', L('New Password'))->rules('required'); goto Ai3OG; Xzc38: } }