{
switch ($accounttype) {
case 'person':
- return User::ACCOUNT_TYPE_PERSON;
+ return self::ACCOUNT_TYPE_PERSON;
case 'organisation':
- return User::ACCOUNT_TYPE_ORGANISATION;
+ return self::ACCOUNT_TYPE_ORGANISATION;
case 'news':
- return User::ACCOUNT_TYPE_NEWS;
+ return self::ACCOUNT_TYPE_NEWS;
case 'community':
- return User::ACCOUNT_TYPE_COMMUNITY;
+ return self::ACCOUNT_TYPE_COMMUNITY;
}
return null;
}
$system['sprvkey'] = $system['uprvkey'] = $system['prvkey'];
$system['spubkey'] = $system['upubkey'] = $system['pubkey'];
$system['nickname'] = $system['nick'];
- $system['page-flags'] = User::PAGE_FLAGS_SOAPBOX;
+ $system['page-flags'] = self::PAGE_FLAGS_SOAPBOX;
$system['account-type'] = $system['contact-type'];
$system['guid'] = '';
$system['picdate'] = '';
'sprvkey' => $system['sprvkey'],
'guid' => System::createUUID(),
'verified' => true,
- 'page-flags' => User::PAGE_FLAGS_SOAPBOX,
- 'account-type' => User::ACCOUNT_TYPE_RELAY,
+ 'page-flags' => self::PAGE_FLAGS_SOAPBOX,
+ 'account-type' => self::ACCOUNT_TYPE_RELAY,
];
DBA::update('user', $fields, ['uid' => 0]);
public static function setCommunityUserSettings(int $uid)
{
$user = self::getById($uid, ['account-type', 'page-flags']);
- if ($user['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) {
+ if ($user['account-type'] != self::ACCOUNT_TYPE_COMMUNITY) {
return;
}
$fields = [
'allow_cid' => '',
- 'allow_gid' => $user['page-flags'] == User::PAGE_FLAGS_PRVGROUP ? '<' . Circle::FOLLOWERS . '>' : '',
+ 'allow_gid' => $user['page-flags'] == self::PAGE_FLAGS_PRVGROUP ? '<' . Circle::FOLLOWERS . '>' : '',
'deny_cid' => '',
'deny_gid' => '',
'blockwall' => true,
'blocktags' => true,
];
- User::update($fields, $uid);
+ self::update($fields, $uid);
Profile::update(['hide-friends' => true], $uid);
}
*/
public static function getWantedLanguages(int $uid): array
{
- return DI::pConfig()->get($uid, 'channel', 'languages', [User::getLanguageCode($uid)]) ?? [];
+ return DI::pConfig()->get($uid, 'channel', 'languages', [self::getLanguageCode($uid)]) ?? [];
}
/**
return;
}
- $user = User::getById($uid, ['last-activity']);
+ $user = self::getById($uid, ['last-activity']);
if (empty($user)) {
return;
}
$current_day = DateTimeFormat::utcNow('Y-m-d');
if ($user['last-activity'] != $current_day) {
- User::update(['last-activity' => $current_day], $uid);
+ self::update(['last-activity' => $current_day], $uid);
// Set the last activity for all identities of the user
DBA::update('user', ['last-activity' => $current_day], ['parent-uid' => $uid, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
}
throw new Exception(DI::l10n()->t('Nickname is already registered. Please choose another.'));
}
- $new_password = strlen($password) ? $password : User::generateNewPassword();
+ $new_password = strlen($password) ? $password : self::generateNewPassword();
$new_password_encoded = self::hashPassword($new_password);
$return['password'] = $new_password;
return false;
}
- $user = User::getById($register['uid']);
+ $user = self::getById($register['uid']);
if (!DBA::isResult($user)) {
return false;
}
$l10n = DI::l10n()->withLang($register['language']);
- return User::sendRegisterOpenEmail(
+ return self::sendRegisterOpenEmail(
$l10n,
$user,
DI::config()->get('config', 'sitename'),
return false;
}
- $user = User::getById($register['uid']);
+ $user = self::getById($register['uid']);
if (!DBA::isResult($user)) {
return false;
}