X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FRegister.php;h=6e36023f3837bd35ca5375cfbfe708f83fc2d784;hb=e34795762d72347746bd506f253495da7d0ab329;hp=4f12a898555b8eed71fd7dfbd97c4cc9ff6a0deb;hpb=6c36fd9e01510a14fea9de766b4afe6760912a2e;p=friendica.git diff --git a/src/Module/Register.php b/src/Module/Register.php index 4f12a89855..6e36023f38 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -1,10 +1,28 @@ . + * + */ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Content\Text\BBCode; -use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; @@ -88,7 +106,7 @@ class Register extends BaseModule if (DI::config()->get('system', 'publish_all')) { $profile_publish = ''; } else { - $publish_tpl = Renderer::getMarkupTemplate('profile_publish.tpl'); + $publish_tpl = Renderer::getMarkupTemplate('profile/publish.tpl'); $profile_publish = Renderer::replaceMacros($publish_tpl, [ '$instance' => 'reg', '$pubdesc' => DI::l10n()->t('Include your profile in member directory?'), @@ -114,7 +132,7 @@ class Register extends BaseModule $o = Renderer::replaceMacros($tpl, [ '$invitations' => DI::config()->get('system', 'invitation_only'), '$permonly' => intval(DI::config()->get('config', 'register_policy')) === self::APPROVE, - '$permonlybox' => ['permonlybox', DI::l10n()->t('Note for the admin'), '', DI::l10n()->t('Leave a message for the admin, why you want to join this node'), 'required'], + '$permonlybox' => ['permonlybox', DI::l10n()->t('Note for the admin'), '', DI::l10n()->t('Leave a message for the admin, why you want to join this node'), DI::l10n()->t('Required')], '$invite_desc' => DI::l10n()->t('Membership on this site is by invitation only.'), '$invite_label' => DI::l10n()->t('Your invitation code: '), '$invite_id' => $invite_id, @@ -166,8 +184,6 @@ class Register extends BaseModule { BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register'); - $a = DI::app(); - $arr = ['post' => $_POST]; Hook::callAll('register_post', $arr); @@ -232,10 +248,6 @@ class Register extends BaseModule DI::baseUrl()->redirect('register/'); } - - // Overwriting the "tar pit" field with the real one - $arr['email'] = $arr['field1']; - if ($additional_account) { $user = DBA::selectFirst('user', ['email'], ['uid' => local_user()]); if (!DBA::isResult($user)) { @@ -248,6 +260,9 @@ class Register extends BaseModule $arr['password1'] = $arr['confirm'] = $arr['parent_password']; $arr['repeat'] = $arr['email'] = $user['email']; + } else { + // Overwriting the "tar pit" field with the real one + $arr['email'] = $arr['field1']; } if ($arr['email'] != $arr['repeat']) { @@ -349,17 +364,15 @@ class Register extends BaseModule // send notification to admins while ($admin = DBA::fetch($admins_stmt)) { \notification([ - 'type' => NOTIFY_SYSTEM, + 'type' => Model\Notification\Type::SYSTEM, 'event' => 'SYSTEM_REGISTER_REQUEST', + 'uid' => $admin['uid'], + 'link' => $base_url . '/admin/users/', 'source_name' => $user['username'], 'source_mail' => $user['email'], 'source_nick' => $user['nickname'], 'source_link' => $base_url . '/admin/users/', - 'link' => $base_url . '/admin/users/', 'source_photo' => $base_url . '/photo/avatar/' . $user['uid'] . '.jpg', - 'to_email' => $admin['email'], - 'uid' => $admin['uid'], - 'language' => ($admin['language'] ?? '') ?: 'en', 'show_in_notification_page' => false ]); }