From 35691fc6a9e46d568467b14929f3ab31cbb6991e Mon Sep 17 00:00:00 2001 From: Rhilip Date: Mon, 15 Jul 2019 17:06:11 +0800 Subject: [PATCH] style(Auth): Sort Auth Form --- apps/controllers/AuthController.php | 13 +++++-------- apps/models/form/{ => Auth}/UserConfirmForm.php | 2 +- apps/models/form/{ => Auth}/UserLoginForm.php | 2 +- apps/models/form/{ => Auth}/UserRecoverForm.php | 2 +- apps/models/form/{ => Auth}/UserRegisterForm.php | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) rename apps/models/form/{ => Auth}/UserConfirmForm.php (99%) rename apps/models/form/{ => Auth}/UserLoginForm.php (99%) rename apps/models/form/{ => Auth}/UserRecoverForm.php (98%) rename apps/models/form/{ => Auth}/UserRegisterForm.php (99%) diff --git a/apps/controllers/AuthController.php b/apps/controllers/AuthController.php index 5a98143..d78c624 100644 --- a/apps/controllers/AuthController.php +++ b/apps/controllers/AuthController.php @@ -9,10 +9,7 @@ namespace apps\controllers; use apps\models\User; -use apps\models\form\UserLoginForm; -use apps\models\form\UserConfirmForm; -use apps\models\form\UserRecoverForm; -use apps\models\form\UserRegisterForm; +use apps\models\form\Auth; use Rid\Http\Controller; @@ -23,7 +20,7 @@ class AuthController extends Controller public function actionRegister() { if (app()->request->isPost()) { - $user = new UserRegisterForm(); + $user = new Auth\UserRegisterForm(); $user->setData(app()->request->post()); $success = $user->validate(); if (!$success) { @@ -50,7 +47,7 @@ public function actionRegister() public function actionConfirm() { - $confirm = new UserConfirmForm(); + $confirm = new Auth\UserConfirmForm(); $confirm->setData(app()->request->get()); $success = $confirm->validate(); if (!$success) { @@ -67,7 +64,7 @@ public function actionConfirm() public function actionRecover() { if (app()->request->isPost()) { - $form = new UserRecoverForm(); + $form = new Auth\UserRecoverForm(); $form->setData(app()->request->post()); $success = $form->validate(); if (!$success) { @@ -97,7 +94,7 @@ public function actionLogin() $left_attempts = config('security.max_login_attempts') - $test_attempts; if (app()->request->isPost()) { - $login = new UserLoginForm(); + $login = new Auth\UserLoginForm(); $login->setData(app()->request->post()); $success = $login->validate(); diff --git a/apps/models/form/UserConfirmForm.php b/apps/models/form/Auth/UserConfirmForm.php similarity index 99% rename from apps/models/form/UserConfirmForm.php rename to apps/models/form/Auth/UserConfirmForm.php index 2291292..cc10b14 100644 --- a/apps/models/form/UserConfirmForm.php +++ b/apps/models/form/Auth/UserConfirmForm.php @@ -6,7 +6,7 @@ * Time: 18:51 */ -namespace apps\models\form; +namespace apps\models\form\Auth; use apps\components\User\UserInterface; use Rid\Helpers\StringHelper; diff --git a/apps/models/form/UserLoginForm.php b/apps/models/form/Auth/UserLoginForm.php similarity index 99% rename from apps/models/form/UserLoginForm.php rename to apps/models/form/Auth/UserLoginForm.php index ee596cb..149ec0d 100644 --- a/apps/models/form/UserLoginForm.php +++ b/apps/models/form/Auth/UserLoginForm.php @@ -6,7 +6,7 @@ * Time: 17:19 */ -namespace apps\models\form; +namespace apps\models\form\Auth; use apps\libraries\Constant; use apps\components\User\UserInterface; diff --git a/apps/models/form/UserRecoverForm.php b/apps/models/form/Auth/UserRecoverForm.php similarity index 98% rename from apps/models/form/UserRecoverForm.php rename to apps/models/form/Auth/UserRecoverForm.php index ce30bdb..8245e8b 100644 --- a/apps/models/form/UserRecoverForm.php +++ b/apps/models/form/Auth/UserRecoverForm.php @@ -6,7 +6,7 @@ * Time: 14:42 */ -namespace apps\models\form; +namespace apps\models\form\Auth; use apps\components\User\UserInterface; diff --git a/apps/models/form/UserRegisterForm.php b/apps/models/form/Auth/UserRegisterForm.php similarity index 99% rename from apps/models/form/UserRegisterForm.php rename to apps/models/form/Auth/UserRegisterForm.php index 90e9118..3d63b0a 100644 --- a/apps/models/form/UserRegisterForm.php +++ b/apps/models/form/Auth/UserRegisterForm.php @@ -6,7 +6,7 @@ * Time: 18:57 */ -namespace apps\models\form; +namespace apps\models\form\Auth; use apps\libraries\Site;