Issue 14231: Automatically add the relay owner as contact person

This commit is contained in:
Michael 2024-06-16 17:04:43 +00:00
parent eb6297c472
commit a27d55f6cf
7 changed files with 341 additions and 271 deletions

View file

@ -330,6 +330,11 @@ class Account extends BaseSettings
}
User::setCommunityUserSettings(DI::userSession()->getLocalUserId());
if ($account_type == User::ACCOUNT_TYPE_RELAY) {
Profile::setResponsibleRelayContact(DI::userSession()->getLocalUserId());
}
DI::baseUrl()->redirect($redirectUrl);
}
@ -425,7 +430,7 @@ class Account extends BaseSettings
$user['account-type'] = User::ACCOUNT_TYPE_COMMUNITY;
}
if (DI::config()->get('system', 'allow_relay_channels')) {
if (!empty($user['parent-uid']) && DI::config()->get('system', 'allow_relay_channels')) {
$account_relay = [
'account-type',
DI::l10n()->t('Channel Relay'),

View file

@ -133,10 +133,13 @@ class Index extends BaseSettings
$homepage = 'http://' . $homepage;
}
$user = User::getById($this->session->getLocalUserId());
$about = Profile::addResponsibleRelayContact($about, $user['parent-uid'], $user['account-type'], $user['language']);
$profileFieldsNew = $this->getProfileFieldsFromInput(
$this->session->getLocalUserId(),
$request['profile_field'],
$request['profile_field_order']
(array)$request['profile_field'],
(array)$request['profile_field_order']
);
$this->profileFieldRepo->saveCollectionForUser($this->session->getLocalUserId(), $profileFieldsNew);
@ -187,6 +190,8 @@ class Index extends BaseSettings
throw new HTTPException\NotFoundException();
}
$owner['about'] = Profile::addResponsibleRelayContact($owner['about'], $owner['parent-uid'], $owner['account-type'], $owner['language']);
$this->page->registerFooterScript('view/asset/es-jquery-sortable/source/js/jquery-sortable-min.js');
$this->page->registerFooterScript(Theme::getPathForFile('js/module/settings/profile/index.js'));