fix namespaces for class Validate

This commit is contained in:
printempw 2016-08-06 21:53:55 +08:00
parent bba4078ea5
commit 659e1ec200
4 changed files with 10 additions and 6 deletions

View File

@ -8,6 +8,7 @@ use App\Models\Player;
use App\Models\PlayerModel;
use App\Models\Texture;
use App\Exceptions\E;
use Validate;
use Utils;
use View;

View File

@ -5,6 +5,7 @@ namespace App\Controllers;
use App\Models\User;
use App\Models\UserModel;
use App\Exceptions\E;
use Validate;
use Mail;
use View;
use Utils;

View File

@ -7,6 +7,7 @@ use App\Models\Player;
use App\Models\PlayerModel;
use App\Models\Texture;
use App\Exceptions\E;
use Validate;
use Utils;
use Option;
use View;
@ -36,7 +37,7 @@ class PlayerController extends BaseController
if (!isset($player_name))
View::json('你还没有填写要添加的角色名哦', 1);
if (!\Validate::playerName($player_name))
if (!Validate::playerName($player_name))
{
$msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线";
View::json($msg, 2);
@ -85,7 +86,7 @@ class PlayerController extends BaseController
if (!$new_player_name)
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") ? "汉字、" : "")."字母、数字以及下划线";
View::json($msg, 2);

View File

@ -5,6 +5,7 @@ namespace App\Controllers;
use App\Models\User;
use App\Models\Texture;
use App\Exceptions\E;
use Validate;
use Option;
use Utils;
use View;
@ -169,7 +170,7 @@ class SkinlibController extends BaseController
public function delete()
{
\Validate::checkPost(['tid']);
Validate::checkPost(['tid']);
$result = Texture::find($_POST['tid']);
@ -208,8 +209,8 @@ class SkinlibController extends BaseController
}
public function rename() {
\Validate::checkPost(['tid', 'new_name']);
\Validate::textureName($_POST['new_name']);
Validate::checkPost(['tid', 'new_name']);
Validate::textureName($_POST['new_name']);
$t = Texture::find($_POST['tid']);
@ -227,7 +228,7 @@ class SkinlibController extends BaseController
private function checkUpload($type)
{
\Validate::textureName(Utils::getValue('name', $_POST));
Validate::textureName(Utils::getValue('name', $_POST));
if (!Utils::getValue('file', $_FILES))
View::json('你还没有选择任何文件哟', 1);