diff --git a/engine/function/users.php b/engine/function/users.php index 03f8a9f..7dcfa3c 100644 --- a/engine/function/users.php +++ b/engine/function/users.php @@ -1243,7 +1243,7 @@ function user_create_account($register_data, $maildata) { 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); $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')"); diff --git a/register.php b/register.php index e7d5c63..dbf6907 100644 --- a/register.php +++ b/register.php @@ -36,7 +36,7 @@ if (empty($_POST) === false) { if ($isNoob) { $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) { $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) { $errors[] = 'Your account can only contain numbers 0-9.'; } - } + } // name restriction $resname = explode(" ", $_POST['username']); foreach($resname as $res) {