From febc835a2d90509a54a41dca07dba1d8e3ed6d07 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sat, 18 Jan 2020 16:54:49 +0100 Subject: [PATCH] Move PConfig::set() to DI::pConfig()->set() --- blockem/blockem.php | 4 +- blogger/blogger.php | 10 ++-- buffer/buffer.php | 12 ++--- catavatar/catavatar.php | 2 +- curweather/curweather.php | 8 ++-- diaspora/diaspora.php | 10 ++-- discourse/discourse.php | 2 +- dwpost/dwpost.php | 8 ++-- fromapp/fromapp.php | 4 +- geonames/geonames.php | 2 +- gnot/gnot.php | 2 +- group_text/group_text.php | 2 +- ifttt/ifttt.php | 2 +- ijpost/ijpost.php | 8 ++-- irc/irc.php | 4 +- jappixmini/jappixmini.php | 24 +++++----- krynn/krynn.php | 2 +- langfilter/langfilter.php | 8 ++-- libertree/libertree.php | 8 ++-- ljpost/ljpost.php | 8 ++-- mailstream/mailstream.php | 8 ++-- markdown/markdown.php | 2 +- mathjax/mathjax.php | 2 +- notimeline/notimeline.php | 2 +- nsfw/nsfw.php | 4 +- numfriends/numfriends.php | 2 +- planets/planets.php | 2 +- pumpio/pumpio.php | 56 +++++++++++------------ qcomment/qcomment.php | 2 +- randplace/randplace.php | 2 +- remote_permissions/remote_permissions.php | 2 +- securemail/securemail.php | 8 ++-- showmore/showmore.php | 4 +- startpage/startpage.php | 2 +- statusnet/statusnet.php | 52 ++++++++++----------- superblock/superblock.php | 4 +- tumblr/tumblr.php | 10 ++-- twitter/twitter.php | 30 ++++++------ widgets/widgets.php | 2 +- windowsphonepush/windowsphonepush.php | 18 ++++---- wppost/wppost.php | 16 +++---- xmpp/xmpp.php | 10 ++-- 42 files changed, 185 insertions(+), 185 deletions(-) diff --git a/blockem/blockem.php b/blockem/blockem.php index 5bd01e92..80bf8385 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -79,7 +79,7 @@ function blockem_addon_settings_post(App $a, array &$b) } if (!empty($_POST['blockem-submit'])) { - PConfig::set(local_user(), 'blockem', 'words', trim($_POST['blockem-words'])); + DI::pConfig()->set(local_user(), 'blockem', 'words', trim($_POST['blockem-words'])); info(L10n::t('BLOCKEM Settings saved.') . EOL); } } @@ -242,7 +242,7 @@ function blockem_init(App $a) $words = implode(',', $newarr); } - PConfig::set(local_user(), 'blockem', 'words', $words); + DI::pConfig()->set(local_user(), 'blockem', 'words', $words); info(L10n::t('blockem settings updated') . EOL); exit(); } diff --git a/blogger/blogger.php b/blogger/blogger.php index 0458415e..847bcea8 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -127,11 +127,11 @@ function blogger_settings(App $a, &$s) function blogger_settings_post(App $a, array &$b) { if (!empty($_POST['blogger-submit'])) { - PConfig::set(local_user(), 'blogger', 'post', $_POST['blogger'] ?? false); - PConfig::set(local_user(), 'blogger', 'post_by_default', $_POST['bl_bydefault'] ?? false); - PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username'])); - PConfig::set(local_user(), 'blogger', 'bl_password', trim($_POST['bl_password'])); - PConfig::set(local_user(), 'blogger', 'bl_blog', trim($_POST['bl_blog'])); + DI::pConfig()->set(local_user(), 'blogger', 'post', $_POST['blogger'] ?? false); + DI::pConfig()->set(local_user(), 'blogger', 'post_by_default', $_POST['bl_bydefault'] ?? false); + DI::pConfig()->set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username'])); + DI::pConfig()->set(local_user(), 'blogger', 'bl_password', trim($_POST['bl_password'])); + DI::pConfig()->set(local_user(), 'blogger', 'bl_blog', trim($_POST['bl_blog'])); } } diff --git a/buffer/buffer.php b/buffer/buffer.php index ac2c8b8e..2e297075 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -121,7 +121,7 @@ function buffer_connect(App $a) Logger::log("buffer_connect: authenticated"); $o = L10n::t("You are now authenticated to buffer. "); $o .= '
' . L10n::t("return to the connector page") . ''; - PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token); + DI::pConfig()->set(local_user(), 'buffer','access_token', $buffer->access_token); } return $o; @@ -236,12 +236,12 @@ function buffer_settings_post(App $a, array &$b) { if (!empty($_POST['buffer-submit'])) { if (!empty($_POST['buffer_delete'])) { - PConfig::set(local_user(), 'buffer', 'access_token' , ''); - PConfig::set(local_user(), 'buffer', 'post' , false); - PConfig::set(local_user(), 'buffer', 'post_by_default', false); + DI::pConfig()->set(local_user(), 'buffer', 'access_token' , ''); + DI::pConfig()->set(local_user(), 'buffer', 'post' , false); + DI::pConfig()->set(local_user(), 'buffer', 'post_by_default', false); } else { - PConfig::set(local_user(), 'buffer', 'post' , intval($_POST['buffer'] ?? false)); - PConfig::set(local_user(), 'buffer', 'post_by_default', intval($_POST['buffer_bydefault'] ?? false)); + DI::pConfig()->set(local_user(), 'buffer', 'post' , intval($_POST['buffer'] ?? false)); + DI::pConfig()->set(local_user(), 'buffer', 'post_by_default', intval($_POST['buffer_bydefault'] ?? false)); } } } diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 1cdd3b1e..18406490 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -124,7 +124,7 @@ function catavatar_addon_settings_post(App $a, &$s) } if (!empty($_POST['catavatar-morecat'])) { - PConfig::set(local_user(), 'catavatar', 'seed', time()); + DI::pConfig()->set(local_user(), 'catavatar', 'seed', time()); } if (!empty($_POST['catavatar-emailcat'])) { diff --git a/curweather/curweather.php b/curweather/curweather.php index c5476efe..460a148f 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -92,7 +92,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti 'icon' => (string) $res->weather['icon'], ]; - PConfig::set(local_user(), 'curweather', 'last', $now->getTimestamp()); + DI::pConfig()->set(local_user(), 'curweather', 'last', $now->getTimestamp()); Cache::set('curweather'.md5($url), serialize($r), Cache::HOUR); return $r; @@ -170,9 +170,9 @@ function curweather_addon_settings_post(App $a, $post) return; } - PConfig::set(local_user(), 'curweather', 'curweather_loc' , trim($_POST['curweather_loc'])); - PConfig::set(local_user(), 'curweather', 'curweather_enable', intval($_POST['curweather_enable'])); - PConfig::set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units'])); + DI::pConfig()->set(local_user(), 'curweather', 'curweather_loc' , trim($_POST['curweather_loc'])); + DI::pConfig()->set(local_user(), 'curweather', 'curweather_enable', intval($_POST['curweather_enable'])); + DI::pConfig()->set(local_user(), 'curweather', 'curweather_units' , trim($_POST['curweather_units'])); info(L10n::t('Current Weather settings updated.') . EOL); } diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 781c1d04..e33b7fde 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -174,11 +174,11 @@ function diaspora_settings(App $a, &$s) function diaspora_settings_post(App $a, &$b) { if (!empty($_POST['diaspora-submit'])) { - PConfig::set(local_user(),'diaspora', 'post' , intval($_POST['diaspora'])); - PConfig::set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault'])); - PConfig::set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); - PConfig::set(local_user(),'diaspora', 'password' , trim($_POST['password'])); - PConfig::set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); + DI::pConfig()->set(local_user(),'diaspora', 'post' , intval($_POST['diaspora'])); + DI::pConfig()->set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault'])); + DI::pConfig()->set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); + DI::pConfig()->set(local_user(),'diaspora', 'password' , trim($_POST['password'])); + DI::pConfig()->set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); } } diff --git a/discourse/discourse.php b/discourse/discourse.php index 34fa206d..7bb75eda 100644 --- a/discourse/discourse.php +++ b/discourse/discourse.php @@ -61,7 +61,7 @@ function discourse_settings_post(App $a) return; } - PConfig::set(local_user(), 'discourse', 'enabled', intval($_POST['enabled'])); + DI::pConfig()->set(local_user(), 'discourse', 'enabled', intval($_POST['enabled'])); } function discourse_email_getmessage(App $a, &$message) diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 9e2d69e4..87567665 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -115,10 +115,10 @@ function dwpost_settings(App $a, &$s) function dwpost_settings_post(App $a, array &$b) { if (!empty($_POST['dwpost-submit'])) { - PConfig::set(local_user(), 'dwpost', 'post', intval($_POST['dwpost'])); - PConfig::set(local_user(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault'])); - PConfig::set(local_user(), 'dwpost', 'dw_username', trim($_POST['dw_username'])); - PConfig::set(local_user(), 'dwpost', 'dw_password', trim($_POST['dw_password'])); + DI::pConfig()->set(local_user(), 'dwpost', 'post', intval($_POST['dwpost'])); + DI::pConfig()->set(local_user(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault'])); + DI::pConfig()->set(local_user(), 'dwpost', 'dw_username', trim($_POST['dw_username'])); + DI::pConfig()->set(local_user(), 'dwpost', 'dw_password', trim($_POST['dw_password'])); } } diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index 5a18ab55..49a3bacf 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -35,8 +35,8 @@ function fromapp_settings_post($a, $post) return; } - PConfig::set(local_user(), 'fromapp', 'app', $_POST['fromapp-input']); - PConfig::set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force'])); + DI::pConfig()->set(local_user(), 'fromapp', 'app', $_POST['fromapp-input']); + DI::pConfig()->set(local_user(), 'fromapp', 'force', intval($_POST['fromapp-force'])); info(L10n::t('Fromapp settings updated.') . EOL); } diff --git a/geonames/geonames.php b/geonames/geonames.php index 560b5ee8..15e3339d 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -110,7 +110,7 @@ function geonames_addon_settings_post(App $a, array $post) return; } - PConfig::set(local_user(), 'geonames', 'enable', intval($_POST['geonames-enable'])); + DI::pConfig()->set(local_user(), 'geonames', 'enable', intval($_POST['geonames-enable'])); info(L10n::t('Geonames settings updated.')); } diff --git a/gnot/gnot.php b/gnot/gnot.php index 5aa0995b..a3323fdd 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -49,7 +49,7 @@ function gnot_settings_post($a,$post) { if(! local_user() || empty($_POST['gnot-submit'])) return; - PConfig::set(local_user(),'gnot','enable',intval($_POST['gnot'])); + DI::pConfig()->set(local_user(),'gnot','enable',intval($_POST['gnot'])); info(L10n::t('Gnot settings updated.') . EOL); } diff --git a/group_text/group_text.php b/group_text/group_text.php index 0e18ec52..b82c751b 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -43,7 +43,7 @@ function group_text_uninstall() { function group_text_settings_post($a,$post) { if(! local_user() || empty($_POST['group_text-submit'])) return; - PConfig::set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); + DI::pConfig()->set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); info(L10n::t('Group Text settings updated.') . EOL); } diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index ac05fcb9..2be43de2 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -50,7 +50,7 @@ function ifttt_settings(App $a, &$s) if (!$key) { $key = Strings::getRandomHex(20); - PConfig::set(local_user(), 'ifttt', 'key', $key); + DI::pConfig()->set(local_user(), 'ifttt', 'key', $key); } $s .= ''; diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 29fcd0d7..603c0969 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -113,10 +113,10 @@ function ijpost_settings(&$a, &$s) function ijpost_settings_post(&$a, &$b) { if (!empty($_POST['ijpost-submit'])) { - PConfig::set(local_user(), 'ijpost', 'post', intval($_POST['ijpost'])); - PConfig::set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault'])); - PConfig::set(local_user(), 'ijpost', 'ij_username', trim($_POST['ij_username'])); - PConfig::set(local_user(), 'ijpost', 'ij_password', trim($_POST['ij_password'])); + DI::pConfig()->set(local_user(), 'ijpost', 'post', intval($_POST['ijpost'])); + DI::pConfig()->set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault'])); + DI::pConfig()->set(local_user(), 'ijpost', 'ij_username', trim($_POST['ij_username'])); + DI::pConfig()->set(local_user(), 'ijpost', 'ij_password', trim($_POST['ij_password'])); } } diff --git a/irc/irc.php b/irc/irc.php index 96f4a888..ad4164cb 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -59,10 +59,10 @@ function irc_addon_settings_post(&$a, &$b) { if(!empty($_POST['irc-submit'])) { if (isset($_POST['autochans'])) { - PConfig::set(local_user(), 'irc', 'autochans', trim(($_POST['autochans']))); + DI::pConfig()->set(local_user(), 'irc', 'autochans', trim(($_POST['autochans']))); } if (isset($_POST['sitechats'])) { - PConfig::set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats'])); + DI::pConfig()->set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats'])); } /* upid pop-up thing */ info(L10n::t('IRC settings saved.') . EOL); diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 1c67c9d7..d3c79c77 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -231,7 +231,7 @@ function jappixmini_init() $decrypt_func($signed_address, $trusted_address, $key); $now = intval(time()); - PConfig::set($uid, "jappixmini", "id:$dfrn_id", "$now:$trusted_address"); + DI::pConfig()->set($uid, "jappixmini", "id:$dfrn_id", "$now:$trusted_address"); } catch (Exception $e) { } @@ -277,7 +277,7 @@ function jappixmini_settings(App $a, &$s) $defaultbosh = Config::get("jappixmini", "bosh_address"); if ($defaultbosh != "") { - PConfig::set(local_user(), 'jappixmini', 'bosh', $defaultbosh); + DI::pConfig()->set(local_user(), 'jappixmini', 'bosh', $defaultbosh); } $username = DI::pConfig()->get(local_user(), 'jappixmini', 'username'); @@ -456,15 +456,15 @@ function jappixmini_settings_post(App $a, &$b) $purge = 1; } - PConfig::set($uid, 'jappixmini', 'username' , $username); - PConfig::set($uid, 'jappixmini', 'server' , $server); - PConfig::set($uid, 'jappixmini', 'bosh' , trim($b['jappixmini-bosh'])); - PConfig::set($uid, 'jappixmini', 'password' , trim($b['jappixmini-encrypted-password'])); - PConfig::set($uid, 'jappixmini', 'autosubscribe' , intval($b['jappixmini-autosubscribe'])); - PConfig::set($uid, 'jappixmini', 'autoapprove' , intval($b['jappixmini-autoapprove'])); - PConfig::set($uid, 'jappixmini', 'activate' , intval($b['jappixmini-activate'])); - PConfig::set($uid, 'jappixmini', 'dontinsertchat', intval($b['jappixmini-dont-insertchat'])); - PConfig::set($uid, 'jappixmini', 'encrypt' , $encrypt); + DI::pConfig()->set($uid, 'jappixmini', 'username' , $username); + DI::pConfig()->set($uid, 'jappixmini', 'server' , $server); + DI::pConfig()->set($uid, 'jappixmini', 'bosh' , trim($b['jappixmini-bosh'])); + DI::pConfig()->set($uid, 'jappixmini', 'password' , trim($b['jappixmini-encrypted-password'])); + DI::pConfig()->set($uid, 'jappixmini', 'autosubscribe' , intval($b['jappixmini-autosubscribe'])); + DI::pConfig()->set($uid, 'jappixmini', 'autoapprove' , intval($b['jappixmini-autoapprove'])); + DI::pConfig()->set($uid, 'jappixmini', 'activate' , intval($b['jappixmini-activate'])); + DI::pConfig()->set($uid, 'jappixmini', 'dontinsertchat', intval($b['jappixmini-dont-insertchat'])); + DI::pConfig()->set($uid, 'jappixmini', 'encrypt' , $encrypt); info('Jappix Mini settings saved.'); if ($purge) { @@ -692,7 +692,7 @@ function jappixmini_cron(App $a, $d) } // save address - PConfig::set($uid, "jappixmini", "id:$dfrn_id", "$now:$decrypted_address"); + DI::pConfig()->set($uid, "jappixmini", "id:$dfrn_id", "$now:$decrypted_address"); } } } diff --git a/krynn/krynn.php b/krynn/krynn.php index c16ccefb..62959bb6 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -123,7 +123,7 @@ function krynn_settings_post($a,$post) { if(! local_user()) return; if($_POST['krynn-submit']) - PConfig::set(local_user(),'krynn','enable',intval($_POST['krynn'])); + DI::pConfig()->set(local_user(),'krynn','enable',intval($_POST['krynn'])); } diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index cb580888..0ddd8548 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -79,10 +79,10 @@ function langfilter_addon_settings_post(App $a, &$b) } if (!empty($_POST['langfilter-settings-submit'])) { - PConfig::set(local_user(), 'langfilter', 'languages', trim($_POST['langfilter_languages'])); + DI::pConfig()->set(local_user(), 'langfilter', 'languages', trim($_POST['langfilter_languages'])); $enable = (!empty($_POST['langfilter_enable']) ? intval($_POST['langfilter_enable']) : 0); $disable = 1 - $enable; - PConfig::set(local_user(), 'langfilter', 'disable', $disable); + DI::pConfig()->set(local_user(), 'langfilter', 'disable', $disable); $minconfidence = 0 + $_POST['langfilter_minconfidence']; if (!$minconfidence) { $minconfidence = 0; @@ -91,7 +91,7 @@ function langfilter_addon_settings_post(App $a, &$b) } elseif ($minconfidence > 100) { $minconfidence = 100; } - PConfig::set(local_user(), 'langfilter', 'minconfidence', $minconfidence / 100.0); + DI::pConfig()->set(local_user(), 'langfilter', 'minconfidence', $minconfidence / 100.0); $minlength = 0 + $_POST['langfilter_minlength']; if (!$minlength) { @@ -99,7 +99,7 @@ function langfilter_addon_settings_post(App $a, &$b) } elseif ($minlength < 0) { $minlength = 32; } - PConfig::set(local_user(), 'langfilter', 'minlength', $minlength); + DI::pConfig()->set(local_user(), 'langfilter', 'minlength', $minlength); info(L10n::t('Language Filter Settings saved.') . EOL); } diff --git a/libertree/libertree.php b/libertree/libertree.php index 88163fd8..a98419e3 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -119,10 +119,10 @@ function libertree_settings_post(&$a,&$b) { if(!empty($_POST['libertree-submit'])) { - PConfig::set(local_user(),'libertree','post',intval($_POST['libertree'])); - PConfig::set(local_user(),'libertree','post_by_default',intval($_POST['libertree_bydefault'])); - PConfig::set(local_user(),'libertree','libertree_api_token',trim($_POST['libertree_api_token'])); - PConfig::set(local_user(),'libertree','libertree_url',trim($_POST['libertree_url'])); + DI::pConfig()->set(local_user(),'libertree','post',intval($_POST['libertree'])); + DI::pConfig()->set(local_user(),'libertree','post_by_default',intval($_POST['libertree_bydefault'])); + DI::pConfig()->set(local_user(),'libertree','libertree_api_token',trim($_POST['libertree_api_token'])); + DI::pConfig()->set(local_user(),'libertree','libertree_url',trim($_POST['libertree_url'])); } diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index f6ac37ed..ab47416f 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -113,10 +113,10 @@ function ljpost_settings_post(&$a,&$b) { if(!empty($_POST['ljpost-submit'])) { - PConfig::set(local_user(),'ljpost','post',intval($_POST['ljpost'])); - PConfig::set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); - PConfig::set(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); - PConfig::set(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); + DI::pConfig()->set(local_user(),'ljpost','post',intval($_POST['ljpost'])); + DI::pConfig()->set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); + DI::pConfig()->set(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); + DI::pConfig()->set(local_user(),'ljpost','lj_password',trim($_POST['lj_password'])); } diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 39a848d7..4aad1d22 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -400,25 +400,25 @@ function mailstream_addon_settings(&$a,&$s) { function mailstream_addon_settings_post($a,$post) { if ($_POST['mailstream_address'] != "") { - PConfig::set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); + DI::pConfig()->set(local_user(), 'mailstream', 'address', $_POST['mailstream_address']); } else { PConfig::delete(local_user(), 'mailstream', 'address'); } if ($_POST['mailstream_nolikes']) { - PConfig::set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']); + DI::pConfig()->set(local_user(), 'mailstream', 'nolikes', $_POST['mailstream_enabled']); } else { PConfig::delete(local_user(), 'mailstream', 'nolikes'); } if ($_POST['mailstream_enabled']) { - PConfig::set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']); + DI::pConfig()->set(local_user(), 'mailstream', 'enabled', $_POST['mailstream_enabled']); } else { PConfig::delete(local_user(), 'mailstream', 'enabled'); } if ($_POST['mailstream_attachimg']) { - PConfig::set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']); + DI::pConfig()->set(local_user(), 'mailstream', 'attachimg', $_POST['mailstream_attachimg']); } else { PConfig::delete(local_user(), 'mailstream', 'attachimg'); diff --git a/markdown/markdown.php b/markdown/markdown.php index 302a603c..854bc689 100644 --- a/markdown/markdown.php +++ b/markdown/markdown.php @@ -42,7 +42,7 @@ function markdown_addon_settings_post(App $a, &$b) return; } - PConfig::set(local_user(), 'markdown', 'enabled', intval($_POST['enabled'])); + DI::pConfig()->set(local_user(), 'markdown', 'enabled', intval($_POST['enabled'])); } function markdown_post_local_start(App $a, &$request) { diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index dbdfbccc..718a62fa 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -40,7 +40,7 @@ function mathjax_settings_post($a) return; } - PConfig::set(local_user(), 'mathjax', 'use', intval($_POST['mathjax_use'])); + DI::pConfig()->set(local_user(), 'mathjax', 'use', intval($_POST['mathjax_use'])); } function mathjax_settings(App $a, &$s) diff --git a/notimeline/notimeline.php b/notimeline/notimeline.php index 8887b542..d090b744 100644 --- a/notimeline/notimeline.php +++ b/notimeline/notimeline.php @@ -30,7 +30,7 @@ function notimeline_settings_post($a, $post) return; } - PConfig::set(local_user(), 'system', 'no_wall_archive_widget', intval($_POST['notimeline'])); + DI::pConfig()->set(local_user(), 'system', 'no_wall_archive_widget', intval($_POST['notimeline'])); info(L10n::t('No Timeline settings updated.') . EOL); } diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 32c95acb..4369df40 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -103,10 +103,10 @@ function nsfw_addon_settings_post(&$a, &$b) } if (!empty($_POST['nsfw-submit'])) { - PConfig::set(local_user(), 'nsfw', 'words', trim($_POST['nsfw-words'])); + DI::pConfig()->set(local_user(), 'nsfw', 'words', trim($_POST['nsfw-words'])); $enable = (!empty($_POST['nsfw-enable']) ? intval($_POST['nsfw-enable']) : 0); $disable = 1 - $enable; - PConfig::set(local_user(), 'nsfw', 'disable', $disable); + DI::pConfig()->set(local_user(), 'nsfw', 'disable', $disable); info(L10n::t('NSFW Settings saved.') . EOL); } } diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php index be0aa932..773cc650 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -41,7 +41,7 @@ function numfriends_settings_post($a,$post) { if(! local_user() || empty($_POST['numfriends-submit'])) return; - PConfig::set(local_user(),'system','display_friend_count',intval($_POST['numfriends'])); + DI::pConfig()->set(local_user(),'system','display_friend_count',intval($_POST['numfriends'])); info( L10n::t('Numfriends settings updated.') . EOL); } diff --git a/planets/planets.php b/planets/planets.php index aedfc889..e7a1e9b8 100644 --- a/planets/planets.php +++ b/planets/planets.php @@ -120,7 +120,7 @@ function planets_settings_post($a,$post) { if(! local_user()) return; if($_POST['planets-submit']) - PConfig::set(local_user(),'planets','enable',intval($_POST['planets'])); + DI::pConfig()->set(local_user(),'planets','enable',intval($_POST['planets'])); } diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 68f3e8d7..70352adc 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -150,8 +150,8 @@ function pumpio_connect(App $a) if ((($consumer_key == "") || ($consumer_secret == "")) && ($hostname != "")) { Logger::log("pumpio_connect: register client"); $clientdata = pumpio_registerclient($a, $hostname); - PConfig::set(local_user(), 'pumpio', 'consumer_key', $clientdata->client_id); - PConfig::set(local_user(), 'pumpio', 'consumer_secret', $clientdata->client_secret); + DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key', $clientdata->client_id); + DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret', $clientdata->client_secret); $consumer_key = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_key'); $consumer_secret = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_secret'); @@ -191,8 +191,8 @@ function pumpio_connect(App $a) if (($success = $client->Process())) { if (strlen($client->access_token)) { Logger::log("pumpio_connect: otoken: ".$client->access_token." osecrect: ".$client->access_token_secret, Logger::DEBUG); - PConfig::set(local_user(), "pumpio", "oauth_token", $client->access_token); - PConfig::set(local_user(), "pumpio", "oauth_token_secret", $client->access_token_secret); + DI::pConfig()->set(local_user(), "pumpio", "oauth_token", $client->access_token); + DI::pConfig()->set(local_user(), "pumpio", "oauth_token_secret", $client->access_token_secret); } } $success = $client->Finalize($success); @@ -335,19 +335,19 @@ function pumpio_settings_post(App $a, array &$b) { if (!empty($_POST['pumpio-submit'])) { if (!empty($_POST['pumpio_delete'])) { - PConfig::set(local_user(), 'pumpio', 'consumer_key' , ''); - PConfig::set(local_user(), 'pumpio', 'consumer_secret' , ''); - PConfig::set(local_user(), 'pumpio', 'oauth_token' , ''); - PConfig::set(local_user(), 'pumpio', 'oauth_token_secret', ''); - PConfig::set(local_user(), 'pumpio', 'post' , false); - PConfig::set(local_user(), 'pumpio', 'import' , false); - PConfig::set(local_user(), 'pumpio', 'host' , ''); - PConfig::set(local_user(), 'pumpio', 'user' , ''); - PConfig::set(local_user(), 'pumpio', 'public' , false); - PConfig::set(local_user(), 'pumpio', 'mirror' , false); - PConfig::set(local_user(), 'pumpio', 'post_by_default' , false); - PConfig::set(local_user(), 'pumpio', 'lastdate' , 0); - PConfig::set(local_user(), 'pumpio', 'last_id' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token_secret', ''); + DI::pConfig()->set(local_user(), 'pumpio', 'post' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'import' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'host' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'user' , ''); + DI::pConfig()->set(local_user(), 'pumpio', 'public' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default' , false); + DI::pConfig()->set(local_user(), 'pumpio', 'lastdate' , 0); + DI::pConfig()->set(local_user(), 'pumpio', 'last_id' , ''); } else { // filtering the username if it is filled wrong $user = $_POST['pumpio_user']; @@ -364,13 +364,13 @@ function pumpio_settings_post(App $a, array &$b) $host = trim($host); $host = str_replace(["https://", "http://"], ["", ""], $host); - PConfig::set(local_user(), 'pumpio', 'post' , $_POST['pumpio'] ?? false); - PConfig::set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import'] ?? false); - PConfig::set(local_user(), 'pumpio', 'host' , $host); - PConfig::set(local_user(), 'pumpio', 'user' , $user); - PConfig::set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public'] ?? false); - PConfig::set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror'] ?? false); - PConfig::set(local_user(), 'pumpio', 'post_by_default', $_POST['pumpio_bydefault'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'post' , $_POST['pumpio'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'host' , $host); + DI::pConfig()->set(local_user(), 'pumpio', 'user' , $user); + DI::pConfig()->set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror'] ?? false); + DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default', $_POST['pumpio_bydefault'] ?? false); if (!empty($_POST['pumpio_mirror'])) { PConfig::delete(local_user(), 'pumpio', 'lastdate'); @@ -597,7 +597,7 @@ function pumpio_send(App $a, array &$b) if ($success) { if ($user->generator->displayName) { - PConfig::set($b["uid"], "pumpio", "application_name", $user->generator->displayName); + DI::pConfig()->set($b["uid"], "pumpio", "application_name", $user->generator->displayName); } $post_id = $user->object->id; @@ -740,7 +740,7 @@ function pumpio_sync(App $a) if ($next_contact_check <= time()) { pumpio_getallusers($a, $rr["uid"]); - PConfig::set($rr['uid'], 'pumpio', 'contact_check', time()); + DI::pConfig()->set($rr['uid'], 'pumpio', 'contact_check', time()); } } } @@ -882,7 +882,7 @@ function pumpio_fetchtimeline(App $a, $uid) } if ($lastdate != 0) { - PConfig::set($uid, 'pumpio', 'lastdate', $lastdate); + DI::pConfig()->set($uid, 'pumpio', 'lastdate', $lastdate); } } @@ -1372,7 +1372,7 @@ function pumpio_fetchinbox(App $a, $uid) pumpio_fetchallcomments($a, $uid, $item["uri"]); } - PConfig::set($uid, 'pumpio', 'last_id', $last_id); + DI::pConfig()->set($uid, 'pumpio', 'last_id', $last_id); } function pumpio_getallusers(App &$a, $uid) diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index 541afabb..b4190e2e 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -68,7 +68,7 @@ function qcomment_addon_settings_post(&$a, &$b) } if ($_POST['qcomment-submit']) { - PConfig::set(local_user(), 'qcomment', 'words', XML::escape($_POST['qcomment-words'])); + DI::pConfig()->set(local_user(), 'qcomment', 'words', XML::escape($_POST['qcomment-words'])); info(L10n::t('Quick Comment settings saved.') . EOL); } } diff --git a/randplace/randplace.php b/randplace/randplace.php index b4c9d594..f08f85b3 100644 --- a/randplace/randplace.php +++ b/randplace/randplace.php @@ -139,7 +139,7 @@ function randplace_settings_post($a,$post) { if(! local_user()) return; if($_POST['randplace-submit']) - PConfig::set(local_user(),'randplace','enable',intval($_POST['randplace'])); + DI::pConfig()->set(local_user(),'randplace','enable',intval($_POST['randplace'])); } diff --git a/remote_permissions/remote_permissions.php b/remote_permissions/remote_permissions.php index 5e1612ba..1a457872 100644 --- a/remote_permissions/remote_permissions.php +++ b/remote_permissions/remote_permissions.php @@ -62,7 +62,7 @@ function remote_permissions_settings_post($a,$post) { if(! local_user() || empty($_POST['remote-perms-submit'])) return; - PConfig::set(local_user(),'remote_perms','show',intval($_POST['remote-perms'])); + DI::pConfig()->set(local_user(),'remote_perms','show',intval($_POST['remote-perms'])); info(L10n::t('Remote Permissions settings updated.') . EOL); } diff --git a/securemail/securemail.php b/securemail/securemail.php index 6fa59a7a..37e4eef0 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -85,9 +85,9 @@ function securemail_settings_post(App &$a, array &$b) } if ($_POST['securemail-submit']) { - PConfig::set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey'])); + DI::pConfig()->set(local_user(), 'securemail', 'pkey', trim($_POST['securemail-pkey'])); $enable = (!empty($_POST['securemail-enable']) ? 1 : 0); - PConfig::set(local_user(), 'securemail', 'enable', $enable); + DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable); info(L10n::t('Secure Mail Settings saved.') . EOL); if ($_POST['securemail-submit'] == L10n::t('Save and send test')) { @@ -117,12 +117,12 @@ function securemail_settings_post(App &$a, array &$b) ]; // enable addon for test - PConfig::set(local_user(), 'securemail', 'enable', 1); + DI::pConfig()->set(local_user(), 'securemail', 'enable', 1); $res = Emailer::send($params); // revert to saved value - PConfig::set(local_user(), 'securemail', 'enable', $enable); + DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable); if ($res) { info(L10n::t('Test email sent') . EOL); diff --git a/showmore/showmore.php b/showmore/showmore.php index 98224f06..acd8e33d 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -71,10 +71,10 @@ function showmore_addon_settings_post(&$a, &$b) } if (!empty($_POST['showmore-submit'])) { - PConfig::set(local_user(), 'showmore', 'chars', trim($_POST['showmore-chars'])); + DI::pConfig()->set(local_user(), 'showmore', 'chars', trim($_POST['showmore-chars'])); $enable = (!empty($_POST['showmore-enable']) ? intval($_POST['showmore-enable']) : 0); $disable = 1-$enable; - PConfig::set(local_user(), 'showmore', 'disable', $disable); + DI::pConfig()->set(local_user(), 'showmore', 'disable', $disable); info(L10n::t('Show More Settings saved.') . EOL); } } diff --git a/startpage/startpage.php b/startpage/startpage.php index 21adae4b..8feb6312 100644 --- a/startpage/startpage.php +++ b/startpage/startpage.php @@ -54,7 +54,7 @@ function startpage_settings_post($a, $post) } if (!empty($_POST['startpage-submit'])) { - PConfig::set(local_user(), 'startpage', 'startpage', strip_tags(trim($_POST['startpage']))); + DI::pConfig()->set(local_user(), 'startpage', 'startpage', strip_tags(trim($_POST['startpage']))); } } diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 0d3162ef..e19b7e3f 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -159,10 +159,10 @@ function statusnet_settings_post(App $a, $post) $apibase = $asn['apiurl']; $c = Network::fetchUrl($apibase . 'statusnet/version.xml'); if (strlen($c) > 0) { - PConfig::set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']); - PConfig::set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']); - PConfig::set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']); - //PConfig::set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] ); + DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']); + DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']); + DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']); + //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] ); } else { notice(L10n::t('Please contact your site administrator.
The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL); } @@ -178,19 +178,19 @@ function statusnet_settings_post(App $a, $post) $c = Network::fetchUrl($apibase . 'statusnet/version.xml'); if (strlen($c) > 0) { // ok the API path is correct, let's save the settings - PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); - PConfig::set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); - PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); - //PConfig::set(local_user(), 'statusnet', 'application_name', $_POST['statusnet-applicationname'] ); + DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); + DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); + DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase); + //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $_POST['statusnet-applicationname'] ); } else { // the API path is not correct, maybe missing trailing / ? $apibase = $apibase . '/'; $c = Network::fetchUrl($apibase . 'statusnet/version.xml'); if (strlen($c) > 0) { // ok the API path is now correct, let's save the settings - PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); - PConfig::set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); - PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); + DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); + DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); + DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase); } else { // still not the correct API base, let's do noting notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL); @@ -209,20 +209,20 @@ function statusnet_settings_post(App $a, $post) $connection = new StatusNetOAuth($api, $ckey, $csecret, $_POST['statusnet-token'], $_POST['statusnet-token2']); $token = $connection->getAccessToken($_POST['statusnet-pin']); // ok, now that we have the Access Token, save them in the user config - PConfig::set(local_user(), 'statusnet', 'oauthtoken', $token['oauth_token']); - PConfig::set(local_user(), 'statusnet', 'oauthsecret', $token['oauth_token_secret']); - PConfig::set(local_user(), 'statusnet', 'post', 1); - PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1); + DI::pConfig()->set(local_user(), 'statusnet', 'oauthtoken', $token['oauth_token']); + DI::pConfig()->set(local_user(), 'statusnet', 'oauthsecret', $token['oauth_token_secret']); + DI::pConfig()->set(local_user(), 'statusnet', 'post', 1); + DI::pConfig()->set(local_user(), 'statusnet', 'post_taglinks', 1); // reload the Addon Settings page, if we don't do it see Bug #42 DI::baseUrl()->redirect('settings/connectors'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a dent for every new __public__ posting to the wall - PConfig::set(local_user(), 'statusnet', 'post', intval($_POST['statusnet-enable'])); - PConfig::set(local_user(), 'statusnet', 'post_by_default', intval($_POST['statusnet-default'])); - PConfig::set(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror'])); - PConfig::set(local_user(), 'statusnet', 'import', intval($_POST['statusnet-import'])); - PConfig::set(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user'])); + DI::pConfig()->set(local_user(), 'statusnet', 'post', intval($_POST['statusnet-enable'])); + DI::pConfig()->set(local_user(), 'statusnet', 'post_by_default', intval($_POST['statusnet-default'])); + DI::pConfig()->set(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror'])); + DI::pConfig()->set(local_user(), 'statusnet', 'import', intval($_POST['statusnet-import'])); + DI::pConfig()->set(local_user(), 'statusnet', 'create_user', intval($_POST['statusnet-create_user'])); if (!intval($_POST['statusnet-mirror'])) PConfig::delete(local_user(), 'statusnet', 'lastid'); @@ -597,7 +597,7 @@ function statusnet_post_hook(App $a, &$b) $dent = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); $max_char = $dent->get_maxlength(); // max. length for a dent - PConfig::set($b['uid'], 'statusnet', 'max_char', $max_char); + DI::pConfig()->set($b['uid'], 'statusnet', 'max_char', $max_char); $tempfile = ""; $msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 7); @@ -642,7 +642,7 @@ function statusnet_post_hook(App $a, &$b) "\nmessage: " . $msg . "\nOriginal post: " . print_r($b, true) . "\nPost Data: " . print_r($postdata, true), Logger::DEBUG); if (!empty($result->source)) { - PConfig::set($b["uid"], "statusnet", "application_name", strip_tags($result->source)); + DI::pConfig()->set($b["uid"], "statusnet", "application_name", strip_tags($result->source)); } if (!empty($result->error)) { @@ -925,7 +925,7 @@ function statusnet_fetchtimeline(App $a, $uid) } } } - PConfig::set($uid, 'statusnet', 'lastid', $lastid); + DI::pConfig()->set($uid, 'statusnet', 'lastid', $lastid); } function statusnet_address($contact) @@ -1350,7 +1350,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) } } } - PConfig::set($uid, 'statusnet', 'lasthometimelineid', $lastid); + DI::pConfig()->set($uid, 'statusnet', 'lasthometimelineid', $lastid); } // Fetching mentions @@ -1401,7 +1401,7 @@ function statusnet_fetchhometimeline(App $a, $uid, $mode = 1) } } - PConfig::set($uid, 'statusnet', 'lastmentionid', $lastid); + DI::pConfig()->set($uid, 'statusnet', 'lastmentionid', $lastid); } function statusnet_complete_conversation(App $a, $uid, $self, $create_user, $nick, $conversation) @@ -1566,7 +1566,7 @@ function statusnet_fetch_own_contact(App $a, $uid) return false; } - PConfig::set($uid, 'statusnet', 'own_url', Strings::normaliseLink($user->statusnet_profile_url)); + DI::pConfig()->set($uid, 'statusnet', 'own_url', Strings::normaliseLink($user->statusnet_profile_url)); $contact_id = statusnet_fetch_contact($uid, $user, true); } else { diff --git a/superblock/superblock.php b/superblock/superblock.php index 2783c5bb..6b7dae22 100644 --- a/superblock/superblock.php +++ b/superblock/superblock.php @@ -69,7 +69,7 @@ function superblock_addon_settings_post(&$a, &$b) } if (!empty($_POST['superblock-submit'])) { - PConfig::set(local_user(), 'system', 'blocked',trim($_POST['superblock-words'])); + DI::pConfig()->set(local_user(), 'system', 'blocked',trim($_POST['superblock-words'])); info(L10n::t('SUPERBLOCK Settings saved.') . EOL); } } @@ -163,7 +163,7 @@ function superblock_init(&$a) $words .= trim($_GET['block']); } - PConfig::set(local_user(), 'system', 'blocked', $words); + DI::pConfig()->set(local_user(), 'system', 'blocked', $words); info(L10n::t('superblock settings updated') . EOL ); exit(); } diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 493f3715..038237e4 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -185,8 +185,8 @@ function tumblr_callback(App $a) } // What's next? Now that we have an Access Token and Secret, we can make an API call. - PConfig::set(local_user(), "tumblr", "oauth_token", $access_token['oauth_token']); - PConfig::set(local_user(), "tumblr", "oauth_token_secret", $access_token['oauth_token_secret']); + DI::pConfig()->set(local_user(), "tumblr", "oauth_token", $access_token['oauth_token']); + DI::pConfig()->set(local_user(), "tumblr", "oauth_token_secret", $access_token['oauth_token_secret']); $o = L10n::t("You are now authenticated to tumblr."); $o .= '
' . L10n::t("return to the connector page") . ''; @@ -300,9 +300,9 @@ function tumblr_settings(App $a, &$s) function tumblr_settings_post(App $a, array &$b) { if (!empty($_POST['tumblr-submit'])) { - PConfig::set(local_user(), 'tumblr', 'post', intval($_POST['tumblr'])); - PConfig::set(local_user(), 'tumblr', 'page', $_POST['tumblr_page']); - PConfig::set(local_user(), 'tumblr', 'post_by_default', intval($_POST['tumblr_bydefault'])); + DI::pConfig()->set(local_user(), 'tumblr', 'post', intval($_POST['tumblr'])); + DI::pConfig()->set(local_user(), 'tumblr', 'page', $_POST['tumblr_page']); + DI::pConfig()->set(local_user(), 'tumblr', 'post_by_default', intval($_POST['tumblr_bydefault'])); } } diff --git a/twitter/twitter.php b/twitter/twitter.php index e5ce967e..fe66886f 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -255,9 +255,9 @@ function twitter_settings_post(App $a) $connection = new TwitterOAuth($ckey, $csecret, $_POST['twitter-token'], $_POST['twitter-token2']); $token = $connection->oauth("oauth/access_token", ["oauth_verifier" => $_POST['twitter-pin']]); // ok, now that we have the Access Token, save them in the user config - PConfig::set(local_user(), 'twitter', 'oauthtoken', $token['oauth_token']); - PConfig::set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']); - PConfig::set(local_user(), 'twitter', 'post', 1); + DI::pConfig()->set(local_user(), 'twitter', 'oauthtoken', $token['oauth_token']); + DI::pConfig()->set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']); + DI::pConfig()->set(local_user(), 'twitter', 'post', 1); } catch(Exception $e) { info($e->getMessage()); } catch(TwitterOAuthException $e) { @@ -268,11 +268,11 @@ function twitter_settings_post(App $a) } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall - PConfig::set(local_user(), 'twitter', 'post', intval($_POST['twitter-enable'])); - PConfig::set(local_user(), 'twitter', 'post_by_default', intval($_POST['twitter-default'])); - PConfig::set(local_user(), 'twitter', 'mirror_posts', intval($_POST['twitter-mirror'])); - PConfig::set(local_user(), 'twitter', 'import', intval($_POST['twitter-import'])); - PConfig::set(local_user(), 'twitter', 'create_user', intval($_POST['twitter-create_user'])); + DI::pConfig()->set(local_user(), 'twitter', 'post', intval($_POST['twitter-enable'])); + DI::pConfig()->set(local_user(), 'twitter', 'post_by_default', intval($_POST['twitter-default'])); + DI::pConfig()->set(local_user(), 'twitter', 'mirror_posts', intval($_POST['twitter-mirror'])); + DI::pConfig()->set(local_user(), 'twitter', 'import', intval($_POST['twitter-import'])); + DI::pConfig()->set(local_user(), 'twitter', 'create_user', intval($_POST['twitter-create_user'])); if (!intval($_POST['twitter-mirror'])) { PConfig::delete(local_user(), 'twitter', 'lastid'); @@ -792,7 +792,7 @@ function twitter_cron(App $a) if($next_contact_check <= time()) { pumpio_getallusers($a, $rr["uid"]); - PConfig::set($rr['uid'],'pumpio','contact_check',time()); + DI::pConfig()->set($rr['uid'],'pumpio','contact_check',time()); } */ } @@ -978,7 +978,7 @@ function twitter_fetchtimeline(App $a, $uid) foreach ($posts as $post) { if ($post->id_str > $lastid) { $lastid = $post->id_str; - PConfig::set($uid, 'twitter', 'lastid', $lastid); + DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid); } if ($first_time) { @@ -1003,7 +1003,7 @@ function twitter_fetchtimeline(App $a, $uid) } } } - PConfig::set($uid, 'twitter', 'lastid', $lastid); + DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid); Logger::log('Last ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG); } @@ -1698,7 +1698,7 @@ function twitter_fetchhometimeline(App $a, $uid) foreach ($posts as $post) { if ($post->id_str > $lastid) { $lastid = $post->id_str; - PConfig::set($uid, 'twitter', 'lasthometimelineid', $lastid); + DI::pConfig()->set($uid, 'twitter', 'lasthometimelineid', $lastid); } if ($first_time) { @@ -1743,7 +1743,7 @@ function twitter_fetchhometimeline(App $a, $uid) Logger::log('User ' . $uid . ' posted home timeline item ' . $item); } } - PConfig::set($uid, 'twitter', 'lasthometimelineid', $lastid); + DI::pConfig()->set($uid, 'twitter', 'lasthometimelineid', $lastid); Logger::log('Last timeline ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG); @@ -1798,7 +1798,7 @@ function twitter_fetchhometimeline(App $a, $uid) } } - PConfig::set($uid, 'twitter', 'lastmentionid', $lastid); + DI::pConfig()->set($uid, 'twitter', 'lastmentionid', $lastid); Logger::log('Last mentions ID for user ' . $uid . ' is now ' . $lastid, Logger::DEBUG); } @@ -1824,7 +1824,7 @@ function twitter_fetch_own_contact(App $a, $uid) return false; } - PConfig::set($uid, 'twitter', 'own_id', $user->id_str); + DI::pConfig()->set($uid, 'twitter', 'own_id', $user->id_str); $contact_id = twitter_fetch_contact($uid, $user, true); } else { diff --git a/widgets/widgets.php b/widgets/widgets.php index c3e1b2ed..0d8d2a70 100644 --- a/widgets/widgets.php +++ b/widgets/widgets.php @@ -41,7 +41,7 @@ function widgets_settings(&$a,&$o) { $key = DI::pConfig()->get(local_user(), 'widgets', 'key' ); - if ($key=='') { $key = mt_rand(); PConfig::set(local_user(), 'widgets', 'key', $key); } + if ($key=='') { $key = mt_rand(); DI::pConfig()->set(local_user(), 'widgets', 'key', $key); } $widgets = []; $d = dir(dirname(__file__)); diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 3e574586..efae2f2e 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -86,13 +86,13 @@ function windowsphonepush_settings_post($a, $post) return; } $enable = intval($_POST['windowsphonepush']); - PConfig::set(local_user(), 'windowsphonepush', 'enable', $enable); + DI::pConfig()->set(local_user(), 'windowsphonepush', 'enable', $enable); if ($enable) { - PConfig::set(local_user(), 'windowsphonepush', 'counterunseen', 0); + DI::pConfig()->set(local_user(), 'windowsphonepush', 'counterunseen', 0); } - PConfig::set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext'])); + DI::pConfig()->set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext'])); info(L10n::t('WindowsPhonePush settings updated.') . EOL); } @@ -174,7 +174,7 @@ function windowsphonepush_cron() switch (trim($res_tile)) { case "Received": // ok, count has been pushed, let's save it in personal settings - PConfig::set($rr['uid'], 'windowsphonepush', 'counterunseen', $count[0]['count']); + DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'counterunseen', $count[0]['count']); break; case "QueueFull": // maximum of 30 messages reached, server rejects any further push notification until device reconnects @@ -232,7 +232,7 @@ function windowsphonepush_cron() // further log information done on count pushing with send_tile (see above) $res_toast = send_toast($device_url, $author, $body); if (trim($res_toast) === 'Received') { - PConfig::set($rr['uid'], 'windowsphonepush', 'lastpushid', $count[0]['max']); + DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'lastpushid', $count[0]['max']); } } } @@ -306,7 +306,7 @@ function send_push($device_url, $headers, $msg) // and log this fact $subscriptionStatus = get_header_value($output, 'X-SubscriptionStatus'); if ($subscriptionStatus == "Expired") { - PConfig::set(local_user(), 'windowsphonepush', 'device_url', ""); + DI::pConfig()->set(local_user(), 'windowsphonepush', 'device_url', ""); Logger::log("ERROR: the stored Device-URL " . $device_url . "returned an 'Expired' error, it has been deleted now."); } @@ -422,12 +422,12 @@ function windowsphonepush_updatesettings() `v` = '" . $device_url . "'"); if (count($r)) { foreach ($r as $rr) { - PConfig::set($rr['uid'], 'windowsphonepush', 'device_url', ''); + DI::pConfig()->set($rr['uid'], 'windowsphonepush', 'device_url', ''); Logger::log("WARN: the sent URL was already registered with user '" . $rr['uid'] . "'. Deleted for this user as we expect to be correct now for user '" . local_user() . "'."); } } - PConfig::set(local_user(), 'windowsphonepush', 'device_url', $device_url); + DI::pConfig()->set(local_user(), 'windowsphonepush', 'device_url', $device_url); // output the successfull update of the device URL to the logger for error analysis if necessary Logger::log("INFO: Device-URL for user '" . local_user() . "' has been updated with '" . $device_url . "'"); return "Device-URL updated successfully!"; @@ -446,7 +446,7 @@ function windowsphonepush_updatecounterunseen() return "Plug-in not enabled"; } - PConfig::set(local_user(), 'windowsphonepush', 'counterunseen', 0); + DI::pConfig()->set(local_user(), 'windowsphonepush', 'counterunseen', 0); return "Counter set to zero"; } diff --git a/wppost/wppost.php b/wppost/wppost.php index 2a0222f7..12fc19b8 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -151,17 +151,17 @@ function wppost_settings(&$a,&$s) { function wppost_settings_post(&$a,&$b) { if(!empty($_POST['wppost-submit'])) { - PConfig::set(local_user(),'wppost','post',intval($_POST['wppost'])); - PConfig::set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false)); - PConfig::set(local_user(),'wppost','wp_username',trim($_POST['wp_username'])); - PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); - PConfig::set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog'])); - PConfig::set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'] ?? '')); - PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck'])); + DI::pConfig()->set(local_user(),'wppost','post',intval($_POST['wppost'])); + DI::pConfig()->set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false)); + DI::pConfig()->set(local_user(),'wppost','wp_username',trim($_POST['wp_username'])); + DI::pConfig()->set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); + DI::pConfig()->set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog'])); + DI::pConfig()->set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'] ?? '')); + DI::pConfig()->set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck'])); $wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text'])); $wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8); $wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true); - PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); + DI::pConfig()->set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); } } diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index ce31822d..6b962c78 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -38,9 +38,9 @@ function xmpp_addon_settings_post() return; } - PConfig::set(local_user(), 'xmpp', 'enabled', $_POST['xmpp_enabled'] ?? false); - PConfig::set(local_user(), 'xmpp', 'individual', $_POST['xmpp_individual'] ?? false); - PConfig::set(local_user(), 'xmpp', 'bosh_proxy', $_POST['xmpp_bosh_proxy'] ?? ''); + DI::pConfig()->set(local_user(), 'xmpp', 'enabled', $_POST['xmpp_enabled'] ?? false); + DI::pConfig()->set(local_user(), 'xmpp', 'individual', $_POST['xmpp_individual'] ?? false); + DI::pConfig()->set(local_user(), 'xmpp', 'bosh_proxy', $_POST['xmpp_bosh_proxy'] ?? ''); info(L10n::t('XMPP settings updated.') . EOL); } @@ -102,7 +102,7 @@ function xmpp_login() { if (empty($_SESSION['allow_api'])) { $password = Strings::getRandomHex(16); - PConfig::set(local_user(), 'xmpp', 'password', $password); + DI::pConfig()->set(local_user(), 'xmpp', 'password', $password); } } @@ -165,7 +165,7 @@ function xmpp_converse(App $a) if ($password == "") { $password = Strings::getRandomHex(16); - PConfig::set(local_user(), "xmpp", "password", $password); + DI::pConfig()->set(local_user(), "xmpp", "password", $password); } $jid = $a->user["nickname"] . "@" . DI::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5); -- 2.39.5