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

This commit is contained in:
Philipp Holzer 2020-01-18 16:54:49 +01:00
parent ea3a9052d8
commit febc835a2d
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
42 changed files with 185 additions and 185 deletions

View File

@ -79,7 +79,7 @@ function blockem_addon_settings_post(App $a, array &$b)
} }
if (!empty($_POST['blockem-submit'])) { 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); info(L10n::t('BLOCKEM Settings saved.') . EOL);
} }
} }
@ -242,7 +242,7 @@ function blockem_init(App $a)
$words = implode(',', $newarr); $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); info(L10n::t('blockem settings updated') . EOL);
exit(); exit();
} }

View File

@ -127,11 +127,11 @@ function blogger_settings(App $a, &$s)
function blogger_settings_post(App $a, array &$b) function blogger_settings_post(App $a, array &$b)
{ {
if (!empty($_POST['blogger-submit'])) { if (!empty($_POST['blogger-submit'])) {
PConfig::set(local_user(), 'blogger', 'post', $_POST['blogger'] ?? false); DI::pConfig()->set(local_user(), 'blogger', 'post', $_POST['blogger'] ?? false);
PConfig::set(local_user(), 'blogger', 'post_by_default', $_POST['bl_bydefault'] ?? false); DI::pConfig()->set(local_user(), 'blogger', 'post_by_default', $_POST['bl_bydefault'] ?? false);
PConfig::set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username'])); DI::pConfig()->set(local_user(), 'blogger', 'bl_username', trim($_POST['bl_username']));
PConfig::set(local_user(), 'blogger', 'bl_password', trim($_POST['bl_password'])); DI::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', 'bl_blog', trim($_POST['bl_blog']));
} }
} }

View File

@ -121,7 +121,7 @@ function buffer_connect(App $a)
Logger::log("buffer_connect: authenticated"); Logger::log("buffer_connect: authenticated");
$o = L10n::t("You are now authenticated to buffer. "); $o = L10n::t("You are now authenticated to buffer. ");
$o .= '<br /><a href="' . DI::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>'; $o .= '<br /><a href="' . DI::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>';
PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token); DI::pConfig()->set(local_user(), 'buffer','access_token', $buffer->access_token);
} }
return $o; return $o;
@ -236,12 +236,12 @@ function buffer_settings_post(App $a, array &$b)
{ {
if (!empty($_POST['buffer-submit'])) { if (!empty($_POST['buffer-submit'])) {
if (!empty($_POST['buffer_delete'])) { if (!empty($_POST['buffer_delete'])) {
PConfig::set(local_user(), 'buffer', 'access_token' , ''); DI::pConfig()->set(local_user(), 'buffer', 'access_token' , '');
PConfig::set(local_user(), 'buffer', 'post' , false); DI::pConfig()->set(local_user(), 'buffer', 'post' , false);
PConfig::set(local_user(), 'buffer', 'post_by_default', false); DI::pConfig()->set(local_user(), 'buffer', 'post_by_default', false);
} else { } else {
PConfig::set(local_user(), 'buffer', 'post' , intval($_POST['buffer'] ?? false)); DI::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_by_default', intval($_POST['buffer_bydefault'] ?? false));
} }
} }
} }

View File

@ -124,7 +124,7 @@ function catavatar_addon_settings_post(App $a, &$s)
} }
if (!empty($_POST['catavatar-morecat'])) { 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'])) { if (!empty($_POST['catavatar-emailcat'])) {

View File

@ -92,7 +92,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
'icon' => (string) $res->weather['icon'], '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); Cache::set('curweather'.md5($url), serialize($r), Cache::HOUR);
return $r; return $r;
@ -170,9 +170,9 @@ function curweather_addon_settings_post(App $a, $post)
return; return;
} }
PConfig::set(local_user(), 'curweather', 'curweather_loc' , trim($_POST['curweather_loc'])); DI::pConfig()->set(local_user(), 'curweather', 'curweather_loc' , trim($_POST['curweather_loc']));
PConfig::set(local_user(), 'curweather', 'curweather_enable', intval($_POST['curweather_enable'])); DI::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_units' , trim($_POST['curweather_units']));
info(L10n::t('Current Weather settings updated.') . EOL); info(L10n::t('Current Weather settings updated.') . EOL);
} }

View File

@ -174,11 +174,11 @@ function diaspora_settings(App $a, &$s)
function diaspora_settings_post(App $a, &$b) function diaspora_settings_post(App $a, &$b)
{ {
if (!empty($_POST['diaspora-submit'])) { if (!empty($_POST['diaspora-submit'])) {
PConfig::set(local_user(),'diaspora', 'post' , intval($_POST['diaspora'])); DI::pConfig()->set(local_user(),'diaspora', 'post' , intval($_POST['diaspora']));
PConfig::set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault'])); DI::pConfig()->set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault']));
PConfig::set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); DI::pConfig()->set(local_user(),'diaspora', 'handle' , trim($_POST['handle']));
PConfig::set(local_user(),'diaspora', 'password' , trim($_POST['password'])); DI::pConfig()->set(local_user(),'diaspora', 'password' , trim($_POST['password']));
PConfig::set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); DI::pConfig()->set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect']));
} }
} }

View File

@ -61,7 +61,7 @@ function discourse_settings_post(App $a)
return; 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) function discourse_email_getmessage(App $a, &$message)

View File

@ -115,10 +115,10 @@ function dwpost_settings(App $a, &$s)
function dwpost_settings_post(App $a, array &$b) function dwpost_settings_post(App $a, array &$b)
{ {
if (!empty($_POST['dwpost-submit'])) { if (!empty($_POST['dwpost-submit'])) {
PConfig::set(local_user(), 'dwpost', 'post', intval($_POST['dwpost'])); DI::pConfig()->set(local_user(), 'dwpost', 'post', intval($_POST['dwpost']));
PConfig::set(local_user(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault'])); DI::pConfig()->set(local_user(), 'dwpost', 'post_by_default', intval($_POST['dw_bydefault']));
PConfig::set(local_user(), 'dwpost', 'dw_username', trim($_POST['dw_username'])); DI::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', 'dw_password', trim($_POST['dw_password']));
} }
} }

View File

@ -35,8 +35,8 @@ function fromapp_settings_post($a, $post)
return; return;
} }
PConfig::set(local_user(), 'fromapp', 'app', $_POST['fromapp-input']); DI::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', 'force', intval($_POST['fromapp-force']));
info(L10n::t('Fromapp settings updated.') . EOL); info(L10n::t('Fromapp settings updated.') . EOL);
} }

View File

@ -110,7 +110,7 @@ function geonames_addon_settings_post(App $a, array $post)
return; 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.')); info(L10n::t('Geonames settings updated.'));
} }

View File

@ -49,7 +49,7 @@ function gnot_settings_post($a,$post) {
if(! local_user() || empty($_POST['gnot-submit'])) if(! local_user() || empty($_POST['gnot-submit']))
return; 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); info(L10n::t('Gnot settings updated.') . EOL);
} }

View File

@ -43,7 +43,7 @@ function group_text_uninstall() {
function group_text_settings_post($a,$post) { function group_text_settings_post($a,$post) {
if(! local_user() || empty($_POST['group_text-submit'])) if(! local_user() || empty($_POST['group_text-submit']))
return; 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); info(L10n::t('Group Text settings updated.') . EOL);
} }

View File

@ -50,7 +50,7 @@ function ifttt_settings(App $a, &$s)
if (!$key) { if (!$key) {
$key = Strings::getRandomHex(20); $key = Strings::getRandomHex(20);
PConfig::set(local_user(), 'ifttt', 'key', $key); DI::pConfig()->set(local_user(), 'ifttt', 'key', $key);
} }
$s .= '<span id="settings_ifttt_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ifttt_expanded\'); openClose(\'settings_ifttt_inflated\');">'; $s .= '<span id="settings_ifttt_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ifttt_expanded\'); openClose(\'settings_ifttt_inflated\');">';

View File

@ -113,10 +113,10 @@ function ijpost_settings(&$a, &$s)
function ijpost_settings_post(&$a, &$b) function ijpost_settings_post(&$a, &$b)
{ {
if (!empty($_POST['ijpost-submit'])) { if (!empty($_POST['ijpost-submit'])) {
PConfig::set(local_user(), 'ijpost', 'post', intval($_POST['ijpost'])); DI::pConfig()->set(local_user(), 'ijpost', 'post', intval($_POST['ijpost']));
PConfig::set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault'])); DI::pConfig()->set(local_user(), 'ijpost', 'post_by_default', intval($_POST['ij_bydefault']));
PConfig::set(local_user(), 'ijpost', 'ij_username', trim($_POST['ij_username'])); DI::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', 'ij_password', trim($_POST['ij_password']));
} }
} }

View File

@ -59,10 +59,10 @@ function irc_addon_settings_post(&$a, &$b) {
if(!empty($_POST['irc-submit'])) { if(!empty($_POST['irc-submit'])) {
if (isset($_POST['autochans'])) { 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'])) { 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 */ /* upid pop-up thing */
info(L10n::t('IRC settings saved.') . EOL); info(L10n::t('IRC settings saved.') . EOL);

View File

@ -231,7 +231,7 @@ function jappixmini_init()
$decrypt_func($signed_address, $trusted_address, $key); $decrypt_func($signed_address, $trusted_address, $key);
$now = intval(time()); $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) { } catch (Exception $e) {
} }
@ -277,7 +277,7 @@ function jappixmini_settings(App $a, &$s)
$defaultbosh = Config::get("jappixmini", "bosh_address"); $defaultbosh = Config::get("jappixmini", "bosh_address");
if ($defaultbosh != "") { 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'); $username = DI::pConfig()->get(local_user(), 'jappixmini', 'username');
@ -456,15 +456,15 @@ function jappixmini_settings_post(App $a, &$b)
$purge = 1; $purge = 1;
} }
PConfig::set($uid, 'jappixmini', 'username' , $username); DI::pConfig()->set($uid, 'jappixmini', 'username' , $username);
PConfig::set($uid, 'jappixmini', 'server' , $server); DI::pConfig()->set($uid, 'jappixmini', 'server' , $server);
PConfig::set($uid, 'jappixmini', 'bosh' , trim($b['jappixmini-bosh'])); DI::pConfig()->set($uid, 'jappixmini', 'bosh' , trim($b['jappixmini-bosh']));
PConfig::set($uid, 'jappixmini', 'password' , trim($b['jappixmini-encrypted-password'])); DI::pConfig()->set($uid, 'jappixmini', 'password' , trim($b['jappixmini-encrypted-password']));
PConfig::set($uid, 'jappixmini', 'autosubscribe' , intval($b['jappixmini-autosubscribe'])); DI::pConfig()->set($uid, 'jappixmini', 'autosubscribe' , intval($b['jappixmini-autosubscribe']));
PConfig::set($uid, 'jappixmini', 'autoapprove' , intval($b['jappixmini-autoapprove'])); DI::pConfig()->set($uid, 'jappixmini', 'autoapprove' , intval($b['jappixmini-autoapprove']));
PConfig::set($uid, 'jappixmini', 'activate' , intval($b['jappixmini-activate'])); DI::pConfig()->set($uid, 'jappixmini', 'activate' , intval($b['jappixmini-activate']));
PConfig::set($uid, 'jappixmini', 'dontinsertchat', intval($b['jappixmini-dont-insertchat'])); DI::pConfig()->set($uid, 'jappixmini', 'dontinsertchat', intval($b['jappixmini-dont-insertchat']));
PConfig::set($uid, 'jappixmini', 'encrypt' , $encrypt); DI::pConfig()->set($uid, 'jappixmini', 'encrypt' , $encrypt);
info('Jappix Mini settings saved.'); info('Jappix Mini settings saved.');
if ($purge) { if ($purge) {
@ -692,7 +692,7 @@ function jappixmini_cron(App $a, $d)
} }
// save address // save address
PConfig::set($uid, "jappixmini", "id:$dfrn_id", "$now:$decrypted_address"); DI::pConfig()->set($uid, "jappixmini", "id:$dfrn_id", "$now:$decrypted_address");
} }
} }
} }

View File

@ -123,7 +123,7 @@ function krynn_settings_post($a,$post) {
if(! local_user()) if(! local_user())
return; return;
if($_POST['krynn-submit']) if($_POST['krynn-submit'])
PConfig::set(local_user(),'krynn','enable',intval($_POST['krynn'])); DI::pConfig()->set(local_user(),'krynn','enable',intval($_POST['krynn']));
} }

View File

@ -79,10 +79,10 @@ function langfilter_addon_settings_post(App $a, &$b)
} }
if (!empty($_POST['langfilter-settings-submit'])) { 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); $enable = (!empty($_POST['langfilter_enable']) ? intval($_POST['langfilter_enable']) : 0);
$disable = 1 - $enable; $disable = 1 - $enable;
PConfig::set(local_user(), 'langfilter', 'disable', $disable); DI::pConfig()->set(local_user(), 'langfilter', 'disable', $disable);
$minconfidence = 0 + $_POST['langfilter_minconfidence']; $minconfidence = 0 + $_POST['langfilter_minconfidence'];
if (!$minconfidence) { if (!$minconfidence) {
$minconfidence = 0; $minconfidence = 0;
@ -91,7 +91,7 @@ function langfilter_addon_settings_post(App $a, &$b)
} elseif ($minconfidence > 100) { } elseif ($minconfidence > 100) {
$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']; $minlength = 0 + $_POST['langfilter_minlength'];
if (!$minlength) { if (!$minlength) {
@ -99,7 +99,7 @@ function langfilter_addon_settings_post(App $a, &$b)
} elseif ($minlength < 0) { } elseif ($minlength < 0) {
$minlength = 32; $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); info(L10n::t('Language Filter Settings saved.') . EOL);
} }

View File

@ -119,10 +119,10 @@ function libertree_settings_post(&$a,&$b) {
if(!empty($_POST['libertree-submit'])) { if(!empty($_POST['libertree-submit'])) {
PConfig::set(local_user(),'libertree','post',intval($_POST['libertree'])); DI::pConfig()->set(local_user(),'libertree','post',intval($_POST['libertree']));
PConfig::set(local_user(),'libertree','post_by_default',intval($_POST['libertree_bydefault'])); DI::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'])); DI::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','libertree_url',trim($_POST['libertree_url']));
} }

View File

@ -113,10 +113,10 @@ function ljpost_settings_post(&$a,&$b) {
if(!empty($_POST['ljpost-submit'])) { if(!empty($_POST['ljpost-submit'])) {
PConfig::set(local_user(),'ljpost','post',intval($_POST['ljpost'])); DI::pConfig()->set(local_user(),'ljpost','post',intval($_POST['ljpost']));
PConfig::set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault'])); DI::pConfig()->set(local_user(),'ljpost','post_by_default',intval($_POST['lj_bydefault']));
PConfig::set(local_user(),'ljpost','lj_username',trim($_POST['lj_username'])); DI::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','lj_password',trim($_POST['lj_password']));
} }

View File

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

View File

@ -42,7 +42,7 @@ function markdown_addon_settings_post(App $a, &$b)
return; 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) { function markdown_post_local_start(App $a, &$request) {

View File

@ -40,7 +40,7 @@ function mathjax_settings_post($a)
return; 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) function mathjax_settings(App $a, &$s)

View File

@ -30,7 +30,7 @@ function notimeline_settings_post($a, $post)
return; 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); info(L10n::t('No Timeline settings updated.') . EOL);
} }

View File

@ -103,10 +103,10 @@ function nsfw_addon_settings_post(&$a, &$b)
} }
if (!empty($_POST['nsfw-submit'])) { 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); $enable = (!empty($_POST['nsfw-enable']) ? intval($_POST['nsfw-enable']) : 0);
$disable = 1 - $enable; $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); info(L10n::t('NSFW Settings saved.') . EOL);
} }
} }

View File

@ -41,7 +41,7 @@ function numfriends_settings_post($a,$post) {
if(! local_user() || empty($_POST['numfriends-submit'])) if(! local_user() || empty($_POST['numfriends-submit']))
return; 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); info( L10n::t('Numfriends settings updated.') . EOL);
} }

View File

@ -120,7 +120,7 @@ function planets_settings_post($a,$post) {
if(! local_user()) if(! local_user())
return; return;
if($_POST['planets-submit']) if($_POST['planets-submit'])
PConfig::set(local_user(),'planets','enable',intval($_POST['planets'])); DI::pConfig()->set(local_user(),'planets','enable',intval($_POST['planets']));
} }

View File

@ -150,8 +150,8 @@ function pumpio_connect(App $a)
if ((($consumer_key == "") || ($consumer_secret == "")) && ($hostname != "")) { if ((($consumer_key == "") || ($consumer_secret == "")) && ($hostname != "")) {
Logger::log("pumpio_connect: register client"); Logger::log("pumpio_connect: register client");
$clientdata = pumpio_registerclient($a, $hostname); $clientdata = pumpio_registerclient($a, $hostname);
PConfig::set(local_user(), 'pumpio', 'consumer_key', $clientdata->client_id); DI::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_secret', $clientdata->client_secret);
$consumer_key = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_key'); $consumer_key = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_key');
$consumer_secret = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_secret'); $consumer_secret = DI::pConfig()->get(local_user(), 'pumpio', 'consumer_secret');
@ -191,8 +191,8 @@ function pumpio_connect(App $a)
if (($success = $client->Process())) { if (($success = $client->Process())) {
if (strlen($client->access_token)) { if (strlen($client->access_token)) {
Logger::log("pumpio_connect: otoken: ".$client->access_token." osecrect: ".$client->access_token_secret, Logger::DEBUG); 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); DI::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_secret", $client->access_token_secret);
} }
} }
$success = $client->Finalize($success); $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-submit'])) {
if (!empty($_POST['pumpio_delete'])) { if (!empty($_POST['pumpio_delete'])) {
PConfig::set(local_user(), 'pumpio', 'consumer_key' , ''); DI::pConfig()->set(local_user(), 'pumpio', 'consumer_key' , '');
PConfig::set(local_user(), 'pumpio', 'consumer_secret' , ''); DI::pConfig()->set(local_user(), 'pumpio', 'consumer_secret' , '');
PConfig::set(local_user(), 'pumpio', 'oauth_token' , ''); DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token' , '');
PConfig::set(local_user(), 'pumpio', 'oauth_token_secret', ''); DI::pConfig()->set(local_user(), 'pumpio', 'oauth_token_secret', '');
PConfig::set(local_user(), 'pumpio', 'post' , false); DI::pConfig()->set(local_user(), 'pumpio', 'post' , false);
PConfig::set(local_user(), 'pumpio', 'import' , false); DI::pConfig()->set(local_user(), 'pumpio', 'import' , false);
PConfig::set(local_user(), 'pumpio', 'host' , ''); DI::pConfig()->set(local_user(), 'pumpio', 'host' , '');
PConfig::set(local_user(), 'pumpio', 'user' , ''); DI::pConfig()->set(local_user(), 'pumpio', 'user' , '');
PConfig::set(local_user(), 'pumpio', 'public' , false); DI::pConfig()->set(local_user(), 'pumpio', 'public' , false);
PConfig::set(local_user(), 'pumpio', 'mirror' , false); DI::pConfig()->set(local_user(), 'pumpio', 'mirror' , false);
PConfig::set(local_user(), 'pumpio', 'post_by_default' , false); DI::pConfig()->set(local_user(), 'pumpio', 'post_by_default' , false);
PConfig::set(local_user(), 'pumpio', 'lastdate' , 0); DI::pConfig()->set(local_user(), 'pumpio', 'lastdate' , 0);
PConfig::set(local_user(), 'pumpio', 'last_id' , ''); DI::pConfig()->set(local_user(), 'pumpio', 'last_id' , '');
} else { } else {
// filtering the username if it is filled wrong // filtering the username if it is filled wrong
$user = $_POST['pumpio_user']; $user = $_POST['pumpio_user'];
@ -364,13 +364,13 @@ function pumpio_settings_post(App $a, array &$b)
$host = trim($host); $host = trim($host);
$host = str_replace(["https://", "http://"], ["", ""], $host); $host = str_replace(["https://", "http://"], ["", ""], $host);
PConfig::set(local_user(), 'pumpio', 'post' , $_POST['pumpio'] ?? false); DI::pConfig()->set(local_user(), 'pumpio', 'post' , $_POST['pumpio'] ?? false);
PConfig::set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import'] ?? false); DI::pConfig()->set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import'] ?? false);
PConfig::set(local_user(), 'pumpio', 'host' , $host); DI::pConfig()->set(local_user(), 'pumpio', 'host' , $host);
PConfig::set(local_user(), 'pumpio', 'user' , $user); DI::pConfig()->set(local_user(), 'pumpio', 'user' , $user);
PConfig::set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public'] ?? false); DI::pConfig()->set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public'] ?? false);
PConfig::set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror'] ?? false); DI::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_by_default', $_POST['pumpio_bydefault'] ?? false);
if (!empty($_POST['pumpio_mirror'])) { if (!empty($_POST['pumpio_mirror'])) {
PConfig::delete(local_user(), 'pumpio', 'lastdate'); PConfig::delete(local_user(), 'pumpio', 'lastdate');
@ -597,7 +597,7 @@ function pumpio_send(App $a, array &$b)
if ($success) { if ($success) {
if ($user->generator->displayName) { 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; $post_id = $user->object->id;
@ -740,7 +740,7 @@ function pumpio_sync(App $a)
if ($next_contact_check <= time()) { if ($next_contact_check <= time()) {
pumpio_getallusers($a, $rr["uid"]); 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) { 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"]); 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) function pumpio_getallusers(App &$a, $uid)

View File

@ -68,7 +68,7 @@ function qcomment_addon_settings_post(&$a, &$b)
} }
if ($_POST['qcomment-submit']) { 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); info(L10n::t('Quick Comment settings saved.') . EOL);
} }
} }

View File

@ -139,7 +139,7 @@ function randplace_settings_post($a,$post) {
if(! local_user()) if(! local_user())
return; return;
if($_POST['randplace-submit']) if($_POST['randplace-submit'])
PConfig::set(local_user(),'randplace','enable',intval($_POST['randplace'])); DI::pConfig()->set(local_user(),'randplace','enable',intval($_POST['randplace']));
} }

View File

@ -62,7 +62,7 @@ function remote_permissions_settings_post($a,$post) {
if(! local_user() || empty($_POST['remote-perms-submit'])) if(! local_user() || empty($_POST['remote-perms-submit']))
return; 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); info(L10n::t('Remote Permissions settings updated.') . EOL);
} }

View File

@ -85,9 +85,9 @@ function securemail_settings_post(App &$a, array &$b)
} }
if ($_POST['securemail-submit']) { 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); $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); info(L10n::t('Secure Mail Settings saved.') . EOL);
if ($_POST['securemail-submit'] == L10n::t('Save and send test')) { 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 // enable addon for test
PConfig::set(local_user(), 'securemail', 'enable', 1); DI::pConfig()->set(local_user(), 'securemail', 'enable', 1);
$res = Emailer::send($params); $res = Emailer::send($params);
// revert to saved value // revert to saved value
PConfig::set(local_user(), 'securemail', 'enable', $enable); DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable);
if ($res) { if ($res) {
info(L10n::t('Test email sent') . EOL); info(L10n::t('Test email sent') . EOL);

View File

@ -71,10 +71,10 @@ function showmore_addon_settings_post(&$a, &$b)
} }
if (!empty($_POST['showmore-submit'])) { 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); $enable = (!empty($_POST['showmore-enable']) ? intval($_POST['showmore-enable']) : 0);
$disable = 1-$enable; $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); info(L10n::t('Show More Settings saved.') . EOL);
} }
} }

View File

@ -54,7 +54,7 @@ function startpage_settings_post($a, $post)
} }
if (!empty($_POST['startpage-submit'])) { 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'])));
} }
} }

View File

@ -159,10 +159,10 @@ function statusnet_settings_post(App $a, $post)
$apibase = $asn['apiurl']; $apibase = $asn['apiurl'];
$c = Network::fetchUrl($apibase . 'statusnet/version.xml'); $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) { if (strlen($c) > 0) {
PConfig::set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']); DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']);
PConfig::set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']); DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']);
PConfig::set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']); DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']);
//PConfig::set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] ); //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] );
} else { } else {
notice(L10n::t('Please contact your site administrator.<br />The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL); notice(L10n::t('Please contact your site administrator.<br />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'); $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) { if (strlen($c) > 0) {
// ok the API path is correct, let's save the settings // ok the API path is correct, let's save the settings
PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
PConfig::set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']);
PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase);
//PConfig::set(local_user(), 'statusnet', 'application_name', $_POST['statusnet-applicationname'] ); //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $_POST['statusnet-applicationname'] );
} else { } else {
// the API path is not correct, maybe missing trailing / ? // the API path is not correct, maybe missing trailing / ?
$apibase = $apibase . '/'; $apibase = $apibase . '/';
$c = Network::fetchUrl($apibase . 'statusnet/version.xml'); $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) { if (strlen($c) > 0) {
// ok the API path is now correct, let's save the settings // ok the API path is now correct, let's save the settings
PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']); DI::pConfig()->set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
PConfig::set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']); DI::pConfig()->set(local_user(), 'statusnet', 'consumersecret', $_POST['statusnet-consumersecret']);
PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase); DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase);
} else { } else {
// still not the correct API base, let's do noting // 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); 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']); $connection = new StatusNetOAuth($api, $ckey, $csecret, $_POST['statusnet-token'], $_POST['statusnet-token2']);
$token = $connection->getAccessToken($_POST['statusnet-pin']); $token = $connection->getAccessToken($_POST['statusnet-pin']);
// ok, now that we have the Access Token, save them in the user config // ok, now that we have the Access Token, save them in the user config
PConfig::set(local_user(), 'statusnet', 'oauthtoken', $token['oauth_token']); DI::pConfig()->set(local_user(), 'statusnet', 'oauthtoken', $token['oauth_token']);
PConfig::set(local_user(), 'statusnet', 'oauthsecret', $token['oauth_token_secret']); DI::pConfig()->set(local_user(), 'statusnet', 'oauthsecret', $token['oauth_token_secret']);
PConfig::set(local_user(), 'statusnet', 'post', 1); DI::pConfig()->set(local_user(), 'statusnet', 'post', 1);
PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1); DI::pConfig()->set(local_user(), 'statusnet', 'post_taglinks', 1);
// reload the Addon Settings page, if we don't do it see Bug #42 // reload the Addon Settings page, if we don't do it see Bug #42
DI::baseUrl()->redirect('settings/connectors'); DI::baseUrl()->redirect('settings/connectors');
} else { } else {
// if no PIN is supplied in the POST variables, the user has changed the setting // 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 // to post a dent for every new __public__ posting to the wall
PConfig::set(local_user(), 'statusnet', 'post', intval($_POST['statusnet-enable'])); DI::pConfig()->set(local_user(), 'statusnet', 'post', intval($_POST['statusnet-enable']));
PConfig::set(local_user(), 'statusnet', 'post_by_default', intval($_POST['statusnet-default'])); DI::pConfig()->set(local_user(), 'statusnet', 'post_by_default', intval($_POST['statusnet-default']));
PConfig::set(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror'])); DI::pConfig()->set(local_user(), 'statusnet', 'mirror_posts', intval($_POST['statusnet-mirror']));
PConfig::set(local_user(), 'statusnet', 'import', intval($_POST['statusnet-import'])); DI::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', 'create_user', intval($_POST['statusnet-create_user']));
if (!intval($_POST['statusnet-mirror'])) if (!intval($_POST['statusnet-mirror']))
PConfig::delete(local_user(), 'statusnet', 'lastid'); 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); $dent = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret);
$max_char = $dent->get_maxlength(); // max. length for a dent $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 = ""; $tempfile = "";
$msgarr = ItemContent::getPlaintextPost($b, $max_char, true, 7); $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); "\nmessage: " . $msg . "\nOriginal post: " . print_r($b, true) . "\nPost Data: " . print_r($postdata, true), Logger::DEBUG);
if (!empty($result->source)) { 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)) { 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) 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 // 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) 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; 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); $contact_id = statusnet_fetch_contact($uid, $user, true);
} else { } else {

View File

@ -69,7 +69,7 @@ function superblock_addon_settings_post(&$a, &$b)
} }
if (!empty($_POST['superblock-submit'])) { 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); info(L10n::t('SUPERBLOCK Settings saved.') . EOL);
} }
} }
@ -163,7 +163,7 @@ function superblock_init(&$a)
$words .= trim($_GET['block']); $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 ); info(L10n::t('superblock settings updated') . EOL );
exit(); exit();
} }

View File

@ -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. // 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']); DI::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_secret", $access_token['oauth_token_secret']);
$o = L10n::t("You are now authenticated to tumblr."); $o = L10n::t("You are now authenticated to tumblr.");
$o .= '<br /><a href="' . DI::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>'; $o .= '<br /><a href="' . DI::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>';
@ -300,9 +300,9 @@ function tumblr_settings(App $a, &$s)
function tumblr_settings_post(App $a, array &$b) function tumblr_settings_post(App $a, array &$b)
{ {
if (!empty($_POST['tumblr-submit'])) { if (!empty($_POST['tumblr-submit'])) {
PConfig::set(local_user(), 'tumblr', 'post', intval($_POST['tumblr'])); DI::pConfig()->set(local_user(), 'tumblr', 'post', intval($_POST['tumblr']));
PConfig::set(local_user(), 'tumblr', 'page', $_POST['tumblr_page']); DI::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_by_default', intval($_POST['tumblr_bydefault']));
} }
} }

View File

@ -255,9 +255,9 @@ function twitter_settings_post(App $a)
$connection = new TwitterOAuth($ckey, $csecret, $_POST['twitter-token'], $_POST['twitter-token2']); $connection = new TwitterOAuth($ckey, $csecret, $_POST['twitter-token'], $_POST['twitter-token2']);
$token = $connection->oauth("oauth/access_token", ["oauth_verifier" => $_POST['twitter-pin']]); $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 // ok, now that we have the Access Token, save them in the user config
PConfig::set(local_user(), 'twitter', 'oauthtoken', $token['oauth_token']); DI::pConfig()->set(local_user(), 'twitter', 'oauthtoken', $token['oauth_token']);
PConfig::set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']); DI::pConfig()->set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']);
PConfig::set(local_user(), 'twitter', 'post', 1); DI::pConfig()->set(local_user(), 'twitter', 'post', 1);
} catch(Exception $e) { } catch(Exception $e) {
info($e->getMessage()); info($e->getMessage());
} catch(TwitterOAuthException $e) { } catch(TwitterOAuthException $e) {
@ -268,11 +268,11 @@ function twitter_settings_post(App $a)
} else { } else {
// if no PIN is supplied in the POST variables, the user has changed the setting // 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 // to post a tweet for every new __public__ posting to the wall
PConfig::set(local_user(), 'twitter', 'post', intval($_POST['twitter-enable'])); DI::pConfig()->set(local_user(), 'twitter', 'post', intval($_POST['twitter-enable']));
PConfig::set(local_user(), 'twitter', 'post_by_default', intval($_POST['twitter-default'])); DI::pConfig()->set(local_user(), 'twitter', 'post_by_default', intval($_POST['twitter-default']));
PConfig::set(local_user(), 'twitter', 'mirror_posts', intval($_POST['twitter-mirror'])); DI::pConfig()->set(local_user(), 'twitter', 'mirror_posts', intval($_POST['twitter-mirror']));
PConfig::set(local_user(), 'twitter', 'import', intval($_POST['twitter-import'])); DI::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', 'create_user', intval($_POST['twitter-create_user']));
if (!intval($_POST['twitter-mirror'])) { if (!intval($_POST['twitter-mirror'])) {
PConfig::delete(local_user(), 'twitter', 'lastid'); PConfig::delete(local_user(), 'twitter', 'lastid');
@ -792,7 +792,7 @@ function twitter_cron(App $a)
if($next_contact_check <= time()) { if($next_contact_check <= time()) {
pumpio_getallusers($a, $rr["uid"]); 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) { foreach ($posts as $post) {
if ($post->id_str > $lastid) { if ($post->id_str > $lastid) {
$lastid = $post->id_str; $lastid = $post->id_str;
PConfig::set($uid, 'twitter', 'lastid', $lastid); DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid);
} }
if ($first_time) { 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); 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) { foreach ($posts as $post) {
if ($post->id_str > $lastid) { if ($post->id_str > $lastid) {
$lastid = $post->id_str; $lastid = $post->id_str;
PConfig::set($uid, 'twitter', 'lasthometimelineid', $lastid); DI::pConfig()->set($uid, 'twitter', 'lasthometimelineid', $lastid);
} }
if ($first_time) { if ($first_time) {
@ -1743,7 +1743,7 @@ function twitter_fetchhometimeline(App $a, $uid)
Logger::log('User ' . $uid . ' posted home timeline item ' . $item); 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); 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); 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; 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); $contact_id = twitter_fetch_contact($uid, $user, true);
} else { } else {

View File

@ -41,7 +41,7 @@ function widgets_settings(&$a,&$o) {
$key = DI::pConfig()->get(local_user(), 'widgets', 'key' ); $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 = []; $widgets = [];
$d = dir(dirname(__file__)); $d = dir(dirname(__file__));

View File

@ -86,13 +86,13 @@ function windowsphonepush_settings_post($a, $post)
return; return;
} }
$enable = intval($_POST['windowsphonepush']); $enable = intval($_POST['windowsphonepush']);
PConfig::set(local_user(), 'windowsphonepush', 'enable', $enable); DI::pConfig()->set(local_user(), 'windowsphonepush', 'enable', $enable);
if ($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); info(L10n::t('WindowsPhonePush settings updated.') . EOL);
} }
@ -174,7 +174,7 @@ function windowsphonepush_cron()
switch (trim($res_tile)) { switch (trim($res_tile)) {
case "Received": case "Received":
// ok, count has been pushed, let's save it in personal settings // 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; break;
case "QueueFull": case "QueueFull":
// maximum of 30 messages reached, server rejects any further push notification until device reconnects // 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) // further log information done on count pushing with send_tile (see above)
$res_toast = send_toast($device_url, $author, $body); $res_toast = send_toast($device_url, $author, $body);
if (trim($res_toast) === 'Received') { 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 // and log this fact
$subscriptionStatus = get_header_value($output, 'X-SubscriptionStatus'); $subscriptionStatus = get_header_value($output, 'X-SubscriptionStatus');
if ($subscriptionStatus == "Expired") { 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."); 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 . "'"); `v` = '" . $device_url . "'");
if (count($r)) { if (count($r)) {
foreach ($r as $rr) { 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() . "'."); 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 // 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 . "'"); Logger::log("INFO: Device-URL for user '" . local_user() . "' has been updated with '" . $device_url . "'");
return "Device-URL updated successfully!"; return "Device-URL updated successfully!";
@ -446,7 +446,7 @@ function windowsphonepush_updatecounterunseen()
return "Plug-in not enabled"; 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"; return "Counter set to zero";
} }

View File

@ -151,17 +151,17 @@ function wppost_settings(&$a,&$s) {
function wppost_settings_post(&$a,&$b) { function wppost_settings_post(&$a,&$b) {
if(!empty($_POST['wppost-submit'])) { if(!empty($_POST['wppost-submit'])) {
PConfig::set(local_user(),'wppost','post',intval($_POST['wppost'])); DI::pConfig()->set(local_user(),'wppost','post',intval($_POST['wppost']));
PConfig::set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false)); DI::pConfig()->set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false));
PConfig::set(local_user(),'wppost','wp_username',trim($_POST['wp_username'])); DI::pConfig()->set(local_user(),'wppost','wp_username',trim($_POST['wp_username']));
PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); DI::pConfig()->set(local_user(),'wppost','wp_password',trim($_POST['wp_password']));
PConfig::set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog'])); DI::pConfig()->set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog']));
PConfig::set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'] ?? '')); DI::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','shortcheck',trim($_POST['wp_shortcheck']));
$wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text'])); $wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text']));
$wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8); $wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8);
$wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true); $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);
} }
} }

View File

@ -38,9 +38,9 @@ function xmpp_addon_settings_post()
return; return;
} }
PConfig::set(local_user(), 'xmpp', 'enabled', $_POST['xmpp_enabled'] ?? false); DI::pConfig()->set(local_user(), 'xmpp', 'enabled', $_POST['xmpp_enabled'] ?? false);
PConfig::set(local_user(), 'xmpp', 'individual', $_POST['xmpp_individual'] ?? false); DI::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', 'bosh_proxy', $_POST['xmpp_bosh_proxy'] ?? '');
info(L10n::t('XMPP settings updated.') . EOL); info(L10n::t('XMPP settings updated.') . EOL);
} }
@ -102,7 +102,7 @@ function xmpp_login()
{ {
if (empty($_SESSION['allow_api'])) { if (empty($_SESSION['allow_api'])) {
$password = Strings::getRandomHex(16); $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 == "") { if ($password == "") {
$password = Strings::getRandomHex(16); $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); $jid = $a->user["nickname"] . "@" . DI::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5);