<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model;
+use Friendica\Model\User;
+use Friendica\Util\Proxy;
use Friendica\Util\Strings;
/**
$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,
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)) {
$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']) {
// send notification to admins
while ($admin = DBA::fetch($admins_stmt)) {
\notification([
- 'type' => Model\Notify\Type::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',
+ 'source_photo' => User::getAvatarUrlForId($user['uid'], Proxy::SIZE_THUMB),
'show_in_notification_page' => false
]);
}