fix namespaces for class Validate
This commit is contained in:
parent
bba4078ea5
commit
659e1ec200
|
|
@ -8,6 +8,7 @@ use App\Models\Player;
|
||||||
use App\Models\PlayerModel;
|
use App\Models\PlayerModel;
|
||||||
use App\Models\Texture;
|
use App\Models\Texture;
|
||||||
use App\Exceptions\E;
|
use App\Exceptions\E;
|
||||||
|
use Validate;
|
||||||
use Utils;
|
use Utils;
|
||||||
use View;
|
use View;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ namespace App\Controllers;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use App\Exceptions\E;
|
use App\Exceptions\E;
|
||||||
|
use Validate;
|
||||||
use Mail;
|
use Mail;
|
||||||
use View;
|
use View;
|
||||||
use Utils;
|
use Utils;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ use App\Models\Player;
|
||||||
use App\Models\PlayerModel;
|
use App\Models\PlayerModel;
|
||||||
use App\Models\Texture;
|
use App\Models\Texture;
|
||||||
use App\Exceptions\E;
|
use App\Exceptions\E;
|
||||||
|
use Validate;
|
||||||
use Utils;
|
use Utils;
|
||||||
use Option;
|
use Option;
|
||||||
use View;
|
use View;
|
||||||
|
|
@ -36,7 +37,7 @@ class PlayerController extends BaseController
|
||||||
if (!isset($player_name))
|
if (!isset($player_name))
|
||||||
View::json('你还没有填写要添加的角色名哦', 1);
|
View::json('你还没有填写要添加的角色名哦', 1);
|
||||||
|
|
||||||
if (!\Validate::playerName($player_name))
|
if (!Validate::playerName($player_name))
|
||||||
{
|
{
|
||||||
$msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线";
|
$msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线";
|
||||||
View::json($msg, 2);
|
View::json($msg, 2);
|
||||||
|
|
@ -85,7 +86,7 @@ class PlayerController extends BaseController
|
||||||
if (!$new_player_name)
|
if (!$new_player_name)
|
||||||
throw new E('Invalid parameters', 1);
|
throw new E('Invalid parameters', 1);
|
||||||
|
|
||||||
if (!\Validate::playerName($new_player_name))
|
if (!Validate::playerName($new_player_name))
|
||||||
{
|
{
|
||||||
$msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线";
|
$msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线";
|
||||||
View::json($msg, 2);
|
View::json($msg, 2);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ namespace App\Controllers;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\Texture;
|
use App\Models\Texture;
|
||||||
use App\Exceptions\E;
|
use App\Exceptions\E;
|
||||||
|
use Validate;
|
||||||
use Option;
|
use Option;
|
||||||
use Utils;
|
use Utils;
|
||||||
use View;
|
use View;
|
||||||
|
|
@ -169,7 +170,7 @@ class SkinlibController extends BaseController
|
||||||
|
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
\Validate::checkPost(['tid']);
|
Validate::checkPost(['tid']);
|
||||||
|
|
||||||
$result = Texture::find($_POST['tid']);
|
$result = Texture::find($_POST['tid']);
|
||||||
|
|
||||||
|
|
@ -208,8 +209,8 @@ class SkinlibController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rename() {
|
public function rename() {
|
||||||
\Validate::checkPost(['tid', 'new_name']);
|
Validate::checkPost(['tid', 'new_name']);
|
||||||
\Validate::textureName($_POST['new_name']);
|
Validate::textureName($_POST['new_name']);
|
||||||
|
|
||||||
$t = Texture::find($_POST['tid']);
|
$t = Texture::find($_POST['tid']);
|
||||||
|
|
||||||
|
|
@ -227,7 +228,7 @@ class SkinlibController extends BaseController
|
||||||
|
|
||||||
private function checkUpload($type)
|
private function checkUpload($type)
|
||||||
{
|
{
|
||||||
\Validate::textureName(Utils::getValue('name', $_POST));
|
Validate::textureName(Utils::getValue('name', $_POST));
|
||||||
|
|
||||||
if (!Utils::getValue('file', $_FILES))
|
if (!Utils::getValue('file', $_FILES))
|
||||||
View::json('你还没有选择任何文件哟', 1);
|
View::json('你还没有选择任何文件哟', 1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user