$block = Config::get('system', 'block_extended_register');
if (local_user() && $block) {
- notice('Permission denied.' . EOL);
+ notice(L10n::t('Permission denied.'));
return '';
}
if (local_user()) {
$user = DBA::selectFirst('user', ['parent-uid'], ['uid' => local_user()]);
if (!empty($user['parent-uid'])) {
- notice('Only parent users can create additional profiles.');
+ notice(L10n::t('Only parent users can create additional profiles.'));
return '';
}
}
if (!local_user() && (intval(Config::get('config', 'register_policy')) === self::CLOSED)) {
- notice('Permission denied.' . EOL);
+ notice(L10n::t('Permission denied.'));
return '';
}
$count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']);
if ($count >= $max_dailies) {
Logger::log('max daily registrations exceeded.');
- notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
+ notice(L10n::t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
return '';
}
}
$additional_account = false;
if (!local_user() && !empty($arr['post']['parent_password'])) {
- notice(L10n::t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.'));
return;
} elseif (local_user() && !empty($arr['post']['parent_password'])) {
try {
Model\User::getIdFromPasswordAuthentication(local_user(), $arr['post']['parent_password']);
} catch (\Exception $ex) {
- notice(L10n::t("Password doesn't match"));
+ notice(L10n::t("Password doesn't match."));
$regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata));
}
$additional_account = true;
} elseif (local_user()) {
- notice(L10n::t('Please enter your password'));
+ notice(L10n::t('Please enter your password.'));
$regdata = ['nickname' => $arr['post']['nickname'], 'username' => $arr['post']['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata));
}
case self::CLOSED:
default:
if (empty($_SESSION['authenticated']) && empty($_SESSION['administrator'])) {
- \notice(L10n::t('Permission denied.') . EOL);
+ notice(L10n::t('Permission denied.'));
return;
}
$blocked = 1;
if ($additional_account) {
$user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]);
if (!DBA::isResult($user)) {
- notice(L10n::t('User not found'));
+ notice(L10n::t('User not found.'));
DI::baseUrl()->redirect('register');
}
try {
$result = Model\User::create($arr);
} catch (\Exception $e) {
- \notice($e->getMessage());
+ notice($e->getMessage());
return;
}
);
if ($res) {
- \info(L10n::t('Registration successful. Please check your email for further instructions.') . EOL);
+ info(L10n::t('Registration successful. Please check your email for further instructions.'));
DI::baseUrl()->redirect();
} else {
- \notice(
+ notice(
L10n::t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.',
$user['email'],
$result['password'])
);
}
} else {
- \info(L10n::t('Registration successful.') . EOL);
+ info(L10n::t('Registration successful.'));
DI::baseUrl()->redirect();
}
} elseif (intval(Config::get('config', 'register_policy')) === self::APPROVE) {
if (!strlen(Config::get('config', 'admin_email'))) {
- \notice(L10n::t('Your registration can not be processed.') . EOL);
+ notice(L10n::t('Your registration can not be processed.'));
DI::baseUrl()->redirect();
}
// Check if the note to the admin is actually filled out
if (empty($_POST['permonlybox'])) {
- \notice(L10n::t('You have to leave a request note for the admin.')
- . L10n::t('Your registration can not be processed.') . EOL);
+ notice(L10n::t('You have to leave a request note for the admin.')
+ . L10n::t('Your registration can not be processed.'));
DI::baseUrl()->redirect('register/');
}
$result['password']
);
- \info(L10n::t('Your registration is pending approval by the site owner.') . EOL);
+ info(L10n::t('Your registration is pending approval by the site owner.'));
DI::baseUrl()->redirect();
}