<?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\Column; use ModStart\Layout\Row; use ModStart\Widget\Box; class ProfileController extends Controller { public function changePassword(AdminPage $HPOov) { goto AdgRF; U_d61: $Pl0Cf->password('password', L('Password'))->rules('required'); goto SEskK; HdJZZ: return $HPOov->pageTitle(L('Change Password'))->body(new Box($Pl0Cf, L('Change Password'))); goto JMK7H; DFaf4: if (Request::isPost()) { AdminPermission::demoCheck(); return $Pl0Cf->formRequest(function (Form $Pl0Cf) { $Y0YxF = $Pl0Cf->dataForming(); ResultException::throwsIf(L('New Password Not Match'), $Y0YxF['passwordNew'] != $Y0YxF['passwordRepeat']); $uotzZ = Admin::changePassword(Admin::id(), $Y0YxF['password'], $Y0YxF['passwordNew']); ResultException::throwsIfFail($uotzZ); 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 HdJZZ; jGC5u: $Pl0Cf->password('passwordRepeat', L('Repeat Password'))->rules('required'); goto DFaf4; SEskK: $Pl0Cf->password('passwordNew', L('New Password'))->rules('required'); goto jGC5u; AdgRF: $Pl0Cf = new Form(DynamicModel::class); goto U_d61; JMK7H: } }