if (DI::pConfig()->get($uid, 'ostatus', 'legacy_friends') == '') {
if ($_REQUEST['url'] == '') {
- PConfig::delete($uid, 'ostatus', 'legacy_contact');
+ DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . L10n::t('No contact provided.');
}
$contact = Probe::uri($_REQUEST['url']);
if (!$contact) {
- PConfig::delete($uid, 'ostatus', 'legacy_contact');
+ DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . L10n::t('Couldn\'t fetch information for contact.');
}
$curlResult = Network::curl($api . 'statuses/friends.json?screen_name=' . $contact['nick']);
if (!$curlResult->isSuccess()) {
- PConfig::delete($uid, 'ostatus', 'legacy_contact');
+ DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
return $o . L10n::t('Couldn\'t fetch friends for contact.');
}
if ($counter >= $total) {
DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl() . '/settings/connectors">';
- PConfig::delete($uid, 'ostatus', 'legacy_friends');
- PConfig::delete($uid, 'ostatus', 'legacy_contact');
+ DI::pConfig()->delete($uid, 'ostatus', 'legacy_friends');
+ DI::pConfig()->delete($uid, 'ostatus', 'legacy_contact');
$o .= L10n::t('Done');
return $o;
}
*/
class PConfig
{
- /**
- * @brief Deletes the given key from the users's configuration.
- *
- * @param int $uid The user_id
- * @param string $cat The category of the configuration value
- * @param string $key The configuration key to delete
- *
- * @return bool
- */
- public static function delete(int $uid, string $cat, string $key)
- {
- return DI::pConfig()->delete($uid, $cat, $key);
- }
}
case 'disable':
if ($has_secret) {
RecoveryCode::deleteForUser(local_user());
- PConfig::delete(local_user(), '2fa', 'secret');
- PConfig::delete(local_user(), '2fa', 'verified');
+ DI::pConfig()->delete(local_user(), '2fa', 'secret');
+ DI::pConfig()->delete(local_user(), '2fa', 'verified');
Session::remove('2fa');
notice(L10n::t('Two-factor authentication successfully disabled.'));
$value = $rr['v'];
if ($key === 'randomise') {
- PConfig::delete($uid, $family, $key);
+ DI::pConfig()->delete($uid, $family, $key);
}
if ($key === 'show_on_profile') {
DI::pConfig()->set($uid, feature, forumlist_profile, $value);
}
- PConfig::delete($uid, $family, $key);
+ DI::pConfig()->delete($uid, $family, $key);
}
if ($key === 'show_on_network') {
DI::pConfig()->set($uid, feature, forumlist_widget, $value);
}
- PConfig::delete($uid, $family, $key);
+ DI::pConfig()->delete($uid, $family, $key);
}
}
}