+ // Is there text in the tar pit?
+ if (!empty($arr['email'])) {
+ Logger::info('Tar pit', $arr);
+ notice(DI::l10n()->t('You have entered too much information.'));
+ 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)) {
+ notice(DI::l10n()->t('User not found.'));
+ DI::baseUrl()->redirect('register');
+ }
+
+ $blocked = 0;
+ $verified = 1;
+
+ $arr['password1'] = $arr['confirm'] = $arr['parent_password'];
+ $arr['repeat'] = $arr['email'] = $user['email'];
+ }
+
+ if ($arr['email'] != $arr['repeat']) {
+ Logger::info('Mail mismatch', $arr);
+ notice(DI::l10n()->t('Please enter the identical mail address in the second field.'));
+ $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']];
+ DI::baseUrl()->redirect('register?' . http_build_query($regdata));
+ }
+