mirror of
https://github.com/friendica/friendica
synced 2025-04-22 03:10:10 +00:00
Move PConfig::set() to DI::pConfig()->set()
This commit is contained in:
parent
9e9429b56d
commit
88bb66371c
17 changed files with 68 additions and 82 deletions
|
@ -69,7 +69,7 @@ class Invite extends BaseModule
|
|||
if (!is_site_admin()) {
|
||||
$invites_remaining--;
|
||||
if ($invites_remaining >= 0) {
|
||||
PConfig::set(local_user(), 'system', 'invites_remaining', $invites_remaining);
|
||||
DI::pConfig()->set(local_user(), 'system', 'invites_remaining', $invites_remaining);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class Invite extends BaseModule
|
|||
if ($res) {
|
||||
$total++;
|
||||
$current_invites++;
|
||||
PConfig::set(local_user(), 'system', 'sent_invites', $current_invites);
|
||||
DI::pConfig()->set(local_user(), 'system', 'sent_invites', $current_invites);
|
||||
if ($current_invites > $max_invites) {
|
||||
notice(L10n::t('Invitation limit exceeded. Please contact your site administrator.') . EOL);
|
||||
return;
|
||||
|
|
|
@ -293,7 +293,7 @@ class Register extends BaseModule
|
|||
if (intval(Config::get('config', 'register_policy')) === self::OPEN) {
|
||||
if ($using_invites && $invite_id) {
|
||||
Model\Register::deleteByHash($invite_id);
|
||||
PConfig::set($user['uid'], 'system', 'invites_remaining', $num_invites);
|
||||
DI::pConfig()->set($user['uid'], 'system', 'invites_remaining', $num_invites);
|
||||
}
|
||||
|
||||
// Only send a password mail when the password wasn't manually provided
|
||||
|
@ -339,7 +339,7 @@ class Register extends BaseModule
|
|||
// invite system
|
||||
if ($using_invites && $invite_id) {
|
||||
Model\Register::deleteByHash($invite_id);
|
||||
PConfig::set($user['uid'], 'system', 'invites_remaining', $num_invites);
|
||||
DI::pConfig()->set($user['uid'], 'system', 'invites_remaining', $num_invites);
|
||||
}
|
||||
|
||||
// send email to admins
|
||||
|
|
|
@ -37,7 +37,7 @@ class Index extends BaseSettingsModule
|
|||
if (!$has_secret && !$verified) {
|
||||
$Google2FA = new Google2FA();
|
||||
|
||||
PConfig::set(local_user(), '2fa', 'secret', $Google2FA->generateSecretKey(32));
|
||||
DI::pConfig()->set(local_user(), '2fa', 'secret', $Google2FA->generateSecretKey(32));
|
||||
|
||||
DI::baseUrl()->redirect('settings/2fa/recovery?t=' . self::getFormSecurityToken('settings_2fa_password'));
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class Verify extends BaseSettingsModule
|
|||
$valid = $google2fa->verifyKey(DI::pConfig()->get(local_user(), '2fa', 'secret'), $_POST['verify_code'] ?? '');
|
||||
|
||||
if ($valid) {
|
||||
PConfig::set(local_user(), '2fa', 'verified', true);
|
||||
DI::pConfig()->set(local_user(), '2fa', 'verified', true);
|
||||
Session::set('2fa', true);
|
||||
|
||||
notice(L10n::t('Two-factor authentication successfully activated.'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue