$verified = 0;
$blocked = 1;
- $arr = array('post' => $_POST);
+ $arr = ['post' => $_POST];
call_hooks('register_post', $arr);
$max_dailies = intval(Config::get('system', 'max_daily_registrations'));
$arr['verified'] = $verified;
$arr['language'] = get_browser_language();
- $result = User::create($arr);
-
- if (!$result['success']) {
- notice($result['message']);
+ try {
+ $result = User::create($arr);
+ } catch (Exception $e) {
+ notice($e->getMessage());
return;
}
// send notification to admins
foreach ($adminlist as $admin) {
- notification(array(
+ notification([
'type' => NOTIFY_SYSTEM,
'event' => 'SYSTEM_REGISTER_REQUEST',
'source_name' => $user['username'],
'uid' => $admin['uid'],
'language' => $admin['language'] ? $admin['language'] : 'en',
'show_in_notification_page' => false
- ));
+ ]);
}
// send notification to the user, that the registration is pending
User::sendRegisterPendingEmail(
$profile_publish = '<input type="hidden" name="profile_publish_reg" value="1" />';
} else {
$publish_tpl = get_markup_template("profile_publish.tpl");
- $profile_publish = replace_macros($publish_tpl, array(
+ $profile_publish = replace_macros($publish_tpl, [
'$instance' => 'reg',
'$pubdesc' => t('Include your profile in member directory?'),
'$yes_selected' => ' checked="checked" ',
'$no_selected' => '',
'$str_yes' => t('Yes'),
'$str_no' => t('No'),
- ));
+ ]);
}
$r = q("SELECT COUNT(*) AS `contacts` FROM `contact`");
$license = '';
- $o = get_markup_template("register.tpl");
+ $tpl = get_markup_template("register.tpl");
- $arr = array('template' => $o);
+ $arr = ['template' => $tpl];
call_hooks('register_form', $arr);
- $o = $arr['template'];
+ $tpl = $arr['template'];
- $o = replace_macros($o, [
+ $o = replace_macros($tpl, [
'$oidhtml' => $oidhtml,
'$invitations' => Config::get('system', 'invitation_only'),
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
- '$permonlybox' => array('permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')),
+ '$permonlybox' => ['permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')],
'$invite_desc' => t('Membership on this site is by invitation only.'),
'$invite_label' => t('Your invitation ID: '),
'$invite_id' => $invite_id,
'$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
'$addrlabel' => t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
'$passwords' => $passwords,
- '$password1' => array('password1', t('New Password:'), '', t('Leave empty for an auto generated password.')),
- '$password2' => array('confirm', t('Confirm:'), '', ''),
+ '$password1' => ['password1', t('New Password:'), '', t('Leave empty for an auto generated password.')],
+ '$password2' => ['confirm', t('Confirm:'), '', ''],
'$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@%s</strong>\'.', $a->get_hostname()),
'$nicklabel' => t('Choose a nickname: '),
'$photo' => $photo,