Fixed OTHIRE account registration bug

This commit is contained in:
Znote 2019-04-04 00:49:32 +02:00
parent a76e468645
commit e64032e630
2 changed files with 3 additions and 3 deletions

View File

@ -1243,7 +1243,7 @@ function user_create_account($register_data, $maildata) {
mysql_insert("INSERT INTO `accounts` ($fields) VALUES ($data)"); mysql_insert("INSERT INTO `accounts` ($fields) VALUES ($data)");
$account_id = user_id($register_data['name']); $account_id = (isset($register_data['name'])) ? user_id($register_data['name']) : user_id($register_data['id']);
$activeKey = rand(100000000,999999999); $activeKey = rand(100000000,999999999);
$active = ($maildata['register']) ? 0 : 1; $active = ($maildata['register']) ? 0 : 1;
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`, `active`, `activekey`, `flag`) VALUES ('$account_id', '$ip', '$created', '$active', '$activeKey', '$flag')"); mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`, `active`, `activekey`, `flag`) VALUES ('$account_id', '$ip', '$created', '$active', '$activeKey', '$flag')");

View File

@ -36,7 +36,7 @@ if (empty($_POST) === false) {
if ($isNoob) { if ($isNoob) {
$errors[] = 'This account name is blocked for registration.'; $errors[] = 'This account name is blocked for registration.';
} }
if ($config['ServerEngine'] !== 'OTHIRE') { if ($config['ServerEngine'] !== 'OTHIRE' && $config['client'] >= 830) {
if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']) == false) { if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']) == false) {
$errors[] = 'Your account name can only contain characters a-z, A-Z and 0-9.'; $errors[] = 'Your account name can only contain characters a-z, A-Z and 0-9.';
} }
@ -44,7 +44,7 @@ if (empty($_POST) === false) {
if (preg_match("/^[0-9]+$/", $_POST['username']) == false) { if (preg_match("/^[0-9]+$/", $_POST['username']) == false) {
$errors[] = 'Your account can only contain numbers 0-9.'; $errors[] = 'Your account can only contain numbers 0-9.';
} }
} }
// name restriction // name restriction
$resname = explode(" ", $_POST['username']); $resname = explode(" ", $_POST['username']);
foreach($resname as $res) { foreach($resname as $res) {