Allow admin to create GM, God etc. names
This commit is contained in:
slawkens
2022-05-16 14:33:50 +02:00
parent 802e6c228c
commit 734a63f6c3
3 changed files with 70 additions and 30 deletions

View File

@@ -13,6 +13,7 @@
require '../common.php';
require SYSTEM . 'functions.php';
require SYSTEM . 'init.php';
require SYSTEM . 'login.php';
$error = '';
if(isset($_GET['account']))
@@ -58,8 +59,15 @@ else if(isset($_GET['name']))
if(!Validator::characterName($name))
error_(Validator::getLastError());
if(!Validator::newCharacterName($name))
if(!admin() && !Validator::newCharacterName($name)){
error_(Validator::getLastError());
}
require_once LIBS . 'CreateCharacter.php';
$createCharacter = new CreateCharacter();
if (!$createCharacter->checkName($name, $errors)) {
error_($errors['name']);
}
success_('Good. Your name will be:<br /><b>' . ucwords($name) . '</b>');
}