mirror of
https://github.com/friendica/friendica
synced 2025-04-22 06:30:11 +00:00
Merge branch 'friendica:2023.09-rc' into Leftovers-from-PR-#13339
This commit is contained in:
commit
1ede164450
26 changed files with 13728 additions and 8954 deletions
|
@ -343,6 +343,35 @@ class User
|
|||
return DBA::selectFirst('user', $fields, ['nickname' => $nickname]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set static settings for community user accounts
|
||||
*
|
||||
* @param integer $uid
|
||||
* @return void
|
||||
*/
|
||||
public static function setCommunityUserSettings(int $uid)
|
||||
{
|
||||
$user = self::getById($uid, ['account-type', 'page-flags']);
|
||||
if ($user['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) {
|
||||
return;
|
||||
}
|
||||
|
||||
DI::pConfig()->set($uid, 'system', 'unlisted', true);
|
||||
|
||||
$fields = [
|
||||
'allow_cid' => '',
|
||||
'allow_gid' => $user['page-flags'] == User::PAGE_FLAGS_PRVGROUP ? '<' . Circle::FOLLOWERS . '>' : '',
|
||||
'deny_cid' => '',
|
||||
'deny_gid' => '',
|
||||
'blockwall' => true,
|
||||
'blocktags' => true,
|
||||
];
|
||||
|
||||
User::update($fields, $uid);
|
||||
|
||||
Profile::update(['hide-friends' => true], $uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user id of a given profile URL
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue