nothing important: brackets

This commit is contained in:
slawkens 2024-09-14 11:16:47 +02:00
parent 7161678c4b
commit 2568046a4d

View File

@ -23,32 +23,36 @@ if(isset($_GET['account']))
{ {
$account = $_GET['account']; $account = $_GET['account'];
if(USE_ACCOUNT_NAME) { if(USE_ACCOUNT_NAME) {
if(!Validator::accountName($account)) if(!Validator::accountName($account)) {
error_(Validator::getLastError()); error_(Validator::getLastError());
}
} }
else if(!Validator::accountId($account)) else if(!Validator::accountId($account)) {
error_(Validator::getLastError()); error_(Validator::getLastError());
}
$_account = new OTS_Account(); $_account = new OTS_Account();
if(USE_ACCOUNT_NAME || USE_ACCOUNT_NUMBER) if(USE_ACCOUNT_NAME || USE_ACCOUNT_NUMBER) {
$_account->find($account); $_account->find($account);
else } else {
$_account->load($account); $_account->load($account);
}
$accountNameOrNumber = (USE_ACCOUNT_NAME ? ' name' : 'number'); $accountNameOrNumber = (USE_ACCOUNT_NAME ? ' name' : 'number');
if($_account->isLoaded()) if($_account->isLoaded()) {
error_("Account with this $accountNameOrNumber already exist."); error_("Account with this $accountNameOrNumber already exist.");
}
success_("Good account $accountNameOrNumber ($account)."); success_("Good account $accountNameOrNumber ($account).");
} }
else if(isset($_GET['email'])) else if(isset($_GET['email']))
{ {
$email = $_GET['email']; $email = $_GET['email'];
if(!Validator::email($email)) if(!Validator::email($email)) {
error_(Validator::getLastError()); error_(Validator::getLastError());
}
if(setting('core.account_mail_unique')) if(setting('core.account_mail_unique')) {
{
if(Account::where('email', '=', $email)->exists()) if(Account::where('email', '=', $email)->exists())
error_('Account with this e-mail already exist.'); error_('Account with this e-mail already exist.');
} }
@ -62,11 +66,13 @@ else if(isset($_GET['name']))
$name = strtolower(stripslashes($name)); $name = strtolower(stripslashes($name));
} }
if(!Validator::characterName($name)) if(!Validator::characterName($name)) {
error_(Validator::getLastError()); error_(Validator::getLastError());
}
if(!admin() && !Validator::newCharacterName($name)) if(!admin() && !Validator::newCharacterName($name)) {
error_(Validator::getLastError()); error_(Validator::getLastError());
}
$createCharacter = new CreateCharacter(); $createCharacter = new CreateCharacter();
if (!$createCharacter->checkName($name, $errors)) { if (!$createCharacter->checkName($name, $errors)) {
@ -83,16 +89,19 @@ else if(isset($_GET['password']) && isset($_GET['password_confirm'])) {
error_('Please enter the password for your new account.'); error_('Please enter the password for your new account.');
} }
if(!Validator::password($password)) if(!Validator::password($password)) {
error_(Validator::getLastError()); error_(Validator::getLastError());
}
if($password != $password_confirm) if($password != $password_confirm) {
error_('Passwords are not the same.'); error_('Passwords are not the same.');
}
success_(1); success_(1);
} }
else else {
error_('Error: no input specified.'); error_('Error: no input specified.');
}
/** /**
* Output message & exit. * Output message & exit.