Move PConfig::delete() to DI::pConfig()->delete()

This commit is contained in:
nupplaPhil 2020-01-18 16:56:45 +01:00
parent febc835a2d
commit 346bf125a7
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
7 changed files with 35 additions and 35 deletions

View file

@ -128,7 +128,7 @@ function catavatar_addon_settings_post(App $a, &$s)
}
if (!empty($_POST['catavatar-emailcat'])) {
PConfig::delete(local_user(), 'catavatar', 'seed');
DI::pConfig()->delete(local_user(), 'catavatar', 'seed');
}
}

View file

@ -89,7 +89,7 @@ function ifttt_settings(App $a, &$s)
function ifttt_settings_post()
{
if (!empty($_POST['ifttt-submit']) && isset($_POST['ifttt-rekey'])) {
PConfig::delete(local_user(), 'ifttt', 'key');
DI::pConfig()->delete(local_user(), 'ifttt', 'key');
}
}

View file

@ -403,25 +403,25 @@ function mailstream_addon_settings_post($a,$post) {
DI::pConfig()->set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']);
}
else {
PConfig::delete(local_user(), 'mailstream', 'address');
DI::pConfig()->delete(local_user(), 'mailstream', 'address');
}
if ($_POST['mailstream_nolikes']) {
DI::pConfig()->set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']);
}
else {
PConfig::delete(local_user(), 'mailstream', 'nolikes');
DI::pConfig()->delete(local_user(), 'mailstream', 'nolikes');
}
if ($_POST['mailstream_enabled']) {
DI::pConfig()->set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']);
}
else {
PConfig::delete(local_user(), 'mailstream', 'enabled');
DI::pConfig()->delete(local_user(), 'mailstream', 'enabled');
}
if ($_POST['mailstream_attachimg']) {
DI::pConfig()->set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']);
}
else {
PConfig::delete(local_user(), 'mailstream', 'attachimg');
DI::pConfig()->delete(local_user(), 'mailstream', 'attachimg');
}
}

View file

@ -373,7 +373,7 @@ function pumpio_settings_post(App $a, array &$b)
DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default', $_POST['pumpio_bydefault'] ?? false);
if (!empty($_POST['pumpio_mirror'])) {
PConfig::delete(local_user(), 'pumpio', 'lastdate');
DI::pConfig()->delete(local_user(), 'pumpio', 'lastdate');
}
}
}

View file

@ -134,18 +134,18 @@ function statusnet_settings_post(App $a, $post)
/* * *
* if the GNU Social-disconnect checkbox is set, clear the GNU Social configuration
*/
PConfig::delete(local_user(), 'statusnet', 'consumerkey');
PConfig::delete(local_user(), 'statusnet', 'consumersecret');
PConfig::delete(local_user(), 'statusnet', 'post');
PConfig::delete(local_user(), 'statusnet', 'post_by_default');
PConfig::delete(local_user(), 'statusnet', 'oauthtoken');
PConfig::delete(local_user(), 'statusnet', 'oauthsecret');
PConfig::delete(local_user(), 'statusnet', 'baseapi');
PConfig::delete(local_user(), 'statusnet', 'lastid');
PConfig::delete(local_user(), 'statusnet', 'mirror_posts');
PConfig::delete(local_user(), 'statusnet', 'import');
PConfig::delete(local_user(), 'statusnet', 'create_user');
PConfig::delete(local_user(), 'statusnet', 'own_url');
DI::pConfig()->delete(local_user(), 'statusnet', 'consumerkey');
DI::pConfig()->delete(local_user(), 'statusnet', 'consumersecret');
DI::pConfig()->delete(local_user(), 'statusnet', 'post');
DI::pConfig()->delete(local_user(), 'statusnet', 'post_by_default');
DI::pConfig()->delete(local_user(), 'statusnet', 'oauthtoken');
DI::pConfig()->delete(local_user(), 'statusnet', 'oauthsecret');
DI::pConfig()->delete(local_user(), 'statusnet', 'baseapi');
DI::pConfig()->delete(local_user(), 'statusnet', 'lastid');
DI::pConfig()->delete(local_user(), 'statusnet', 'mirror_posts');
DI::pConfig()->delete(local_user(), 'statusnet', 'import');
DI::pConfig()->delete(local_user(), 'statusnet', 'create_user');
DI::pConfig()->delete(local_user(), 'statusnet', 'own_url');
} else {
if (isset($_POST['statusnet-preconf-apiurl'])) {
/* * *
@ -225,7 +225,7 @@ function statusnet_settings_post(App $a, $post)
DI::pConfig()->set(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user']));
if (!intval($_POST['statusnet-mirror']))
PConfig::delete(local_user(), 'statusnet', 'lastid');
DI::pConfig()->delete(local_user(), 'statusnet', 'lastid');
info(L10n::t('GNU Social settings updated.') . EOL);
}
@ -1575,7 +1575,7 @@ function statusnet_fetch_own_contact(App $a, $uid)
if (DBA::isResult($r)) {
$contact_id = $r[0]["id"];
} else {
PConfig::delete($uid, 'statusnet', 'own_url');
DI::pConfig()->delete($uid, 'statusnet', 'own_url');
}
}
return $contact_id;

View file

@ -227,17 +227,17 @@ function twitter_settings_post(App $a)
* if the twitter-disconnect checkbox is set, clear the OAuth key/secret pair
* from the user configuration
*/
PConfig::delete(local_user(), 'twitter', 'consumerkey');
PConfig::delete(local_user(), 'twitter', 'consumersecret');
PConfig::delete(local_user(), 'twitter', 'oauthtoken');
PConfig::delete(local_user(), 'twitter', 'oauthsecret');
PConfig::delete(local_user(), 'twitter', 'post');
PConfig::delete(local_user(), 'twitter', 'post_by_default');
PConfig::delete(local_user(), 'twitter', 'lastid');
PConfig::delete(local_user(), 'twitter', 'mirror_posts');
PConfig::delete(local_user(), 'twitter', 'import');
PConfig::delete(local_user(), 'twitter', 'create_user');
PConfig::delete(local_user(), 'twitter', 'own_id');
DI::pConfig()->delete(local_user(), 'twitter', 'consumerkey');
DI::pConfig()->delete(local_user(), 'twitter', 'consumersecret');
DI::pConfig()->delete(local_user(), 'twitter', 'oauthtoken');
DI::pConfig()->delete(local_user(), 'twitter', 'oauthsecret');
DI::pConfig()->delete(local_user(), 'twitter', 'post');
DI::pConfig()->delete(local_user(), 'twitter', 'post_by_default');
DI::pConfig()->delete(local_user(), 'twitter', 'lastid');
DI::pConfig()->delete(local_user(), 'twitter', 'mirror_posts');
DI::pConfig()->delete(local_user(), 'twitter', 'import');
DI::pConfig()->delete(local_user(), 'twitter', 'create_user');
DI::pConfig()->delete(local_user(), 'twitter', 'own_id');
} else {
if (isset($_POST['twitter-pin'])) {
// if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
@ -275,7 +275,7 @@ function twitter_settings_post(App $a)
DI::pConfig()->set(local_user(), 'twitter', 'create_user', intval($_POST['twitter-create_user']));
if (!intval($_POST['twitter-mirror'])) {
PConfig::delete(local_user(), 'twitter', 'lastid');
DI::pConfig()->delete(local_user(), 'twitter', 'lastid');
}
info(L10n::t('Twitter settings updated.') . EOL);
@ -1834,7 +1834,7 @@ function twitter_fetch_own_contact(App $a, $uid)
if (DBA::isResult($r)) {
$contact_id = $r[0]["id"];
} else {
PConfig::delete($uid, 'twitter', 'own_id');
DI::pConfig()->delete($uid, 'twitter', 'own_id');
}
}

View file

@ -30,7 +30,7 @@ function widgets_settings_post(){
if(! local_user())
return;
if (isset($_POST['widgets-submit'])){
PConfig::delete(local_user(), 'widgets', 'key');
DI::pConfig()->delete(local_user(), 'widgets', 'key');
}
}