mirror of
https://github.com/friendica/friendica
synced 2025-04-25 06:30:11 +00:00
Issue 13511: Ensure stattic community user settings
This commit is contained in:
parent
77ccd7201b
commit
7371070cde
5 changed files with 47 additions and 27 deletions
|
@ -199,6 +199,7 @@ class Account extends BaseSettings
|
|||
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
|
||||
}
|
||||
|
||||
User::setCommunityUserSettings(DI::userSession()->getLocalUserId());
|
||||
DI::baseUrl()->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
|
@ -321,37 +322,16 @@ class Account extends BaseSettings
|
|||
$page_flags = User::PAGE_FLAGS_COMMUNITY;
|
||||
}
|
||||
|
||||
$fields = [];
|
||||
$profile_fields = [];
|
||||
|
||||
if ($account_type == User::ACCOUNT_TYPE_COMMUNITY) {
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'unlisted', true);
|
||||
|
||||
$fields = [
|
||||
'allow_cid' => '',
|
||||
'allow_gid' => $page_flags == User::PAGE_FLAGS_PRVGROUP ?
|
||||
'<' . Circle::FOLLOWERS . '>'
|
||||
: '',
|
||||
'deny_cid' => '',
|
||||
'deny_gid' => '',
|
||||
'blockwall' => true,
|
||||
'blocktags' => true,
|
||||
];
|
||||
|
||||
$profile_fields = [
|
||||
'hide-friends' => true,
|
||||
];
|
||||
}
|
||||
|
||||
$fields = array_merge($fields, [
|
||||
$fields = [
|
||||
'page-flags' => $page_flags,
|
||||
'account-type' => $account_type,
|
||||
]);
|
||||
];
|
||||
|
||||
if (!User::update($fields, DI::userSession()->getLocalUserId()) || !empty($profile_fields) && !Profile::update($profile_fields, DI::userSession()->getLocalUserId())) {
|
||||
if (!User::update($fields, DI::userSession()->getLocalUserId())) {
|
||||
DI::sysmsg()->addNotice(DI::l10n()->t('Settings were not updated.'));
|
||||
}
|
||||
|
||||
User::setCommunityUserSettings(DI::userSession()->getLocalUserId());
|
||||
DI::baseUrl()->redirect($redirectUrl);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue