]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Merge pull request #8132 from annando/child-user
[friendica.git] / mod / settings.php
index c7fcbc0e5c3afdf09a47ec891f92b8e5e3c9137f..8213fda7c9b4b40cce17cf910653b333572fde9c 100644 (file)
@@ -5,7 +5,6 @@
 
 use Friendica\App;
 use Friendica\BaseModule;
-use Friendica\BaseObject;
 use Friendica\Content\Feature;
 use Friendica\Content\Nav;
 use Friendica\Core\ACL;
@@ -13,21 +12,18 @@ use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
-use Friendica\Core\PConfig;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
-use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
 use Friendica\Model\Group;
 use Friendica\Model\User;
-use Friendica\Module\Login;
+use Friendica\Module\Security\Login;
 use Friendica\Protocol\Email;
-use Friendica\Util\ACLFormatter;
-use Friendica\Util\Network;
 use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 use Friendica\Worker\Delivery;
@@ -36,7 +32,7 @@ function get_theme_config_file($theme)
 {
        $theme = Strings::sanitizeFilePathItem($theme);
 
-       $a = \get_app();
+       $a = DI::app();
        $base_theme = $a->theme_info['extends'] ?? '';
 
        if (file_exists("view/theme/$theme/config.php")) {
@@ -58,7 +54,7 @@ function settings_init(App $a)
        // These lines provide the javascript needed by the acl selector
 
        $tpl = Renderer::getMarkupTemplate('settings/head.tpl');
-       $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
+       DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
                '$ispublic' => L10n::t('everybody')
        ]);
 
@@ -145,7 +141,7 @@ function settings_init(App $a)
 
 
        $tabtpl = Renderer::getMarkupTemplate("generic_links_widget.tpl");
-       $a->page['aside'] = Renderer::replaceMacros($tabtpl, [
+       DI::page()['aside'] = Renderer::replaceMacros($tabtpl, [
                '$title' => L10n::t('Settings'),
                '$class' => 'settings-widget',
                '$items' => $tabs,
@@ -175,7 +171,7 @@ function settings_post(App $a)
 
                $key = $_POST['remove'];
                DBA::delete('tokens', ['id' => $key, 'uid' => local_user()]);
-               $a->internalRedirect('settings/oauth/', true);
+               DI::baseUrl()->redirect('settings/oauth/', true);
                return;
        }
 
@@ -221,7 +217,7 @@ function settings_post(App $a)
                                );
                        }
                }
-               $a->internalRedirect('settings/oauth/', true);
+               DI::baseUrl()->redirect('settings/oauth/', true);
                return;
        }
 
@@ -236,13 +232,13 @@ function settings_post(App $a)
                BaseModule::checkFormSecurityTokenRedirectOnError('/settings/connectors', 'settings_connectors');
 
                if (!empty($_POST['general-submit'])) {
-                       PConfig::set(local_user(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
-                       PConfig::set(local_user(), 'system', 'disable_cw', intval($_POST['disable_cw']));
-                       PConfig::set(local_user(), 'system', 'no_intelligent_shortening', intval($_POST['no_intelligent_shortening']));
-                       PConfig::set(local_user(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
-                       PConfig::set(local_user(), 'system', 'ostatus_autofriend', intval($_POST['snautofollow']));
-                       PConfig::set(local_user(), 'ostatus', 'default_group', $_POST['group-selection']);
-                       PConfig::set(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
+                       DI::pConfig()->set(local_user(), 'system', 'accept_only_sharer', intval($_POST['accept_only_sharer']));
+                       DI::pConfig()->set(local_user(), 'system', 'disable_cw', intval($_POST['disable_cw']));
+                       DI::pConfig()->set(local_user(), 'system', 'no_intelligent_shortening', intval($_POST['no_intelligent_shortening']));
+                       DI::pConfig()->set(local_user(), 'system', 'attach_link_title', intval($_POST['attach_link_title']));
+                       DI::pConfig()->set(local_user(), 'system', 'ostatus_autofriend', intval($_POST['snautofollow']));
+                       DI::pConfig()->set(local_user(), 'ostatus', 'default_group', $_POST['group-selection']);
+                       DI::pConfig()->set(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
                } elseif (!empty($_POST['imap-submit'])) {
                        $mail_server       =                 $_POST['mail_server']       ?? '';
                        $mail_port         =                 $_POST['mail_port']         ?? '';
@@ -317,7 +313,7 @@ function settings_post(App $a)
                BaseModule::checkFormSecurityTokenRedirectOnError('/settings/features', 'settings_features');
                foreach ($_POST as $k => $v) {
                        if (strpos($k, 'feature_') === 0) {
-                               PConfig::set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
+                               DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
                        }
                }
                info(L10n::t('Features updated') . EOL);
@@ -327,17 +323,17 @@ function settings_post(App $a)
        if (($a->argc > 1) && ($a->argv[1] === 'display')) {
                BaseModule::checkFormSecurityTokenRedirectOnError('/settings/display', 'settings_display');
 
-               $theme             = !empty($_POST['theme'])             ? Strings::escapeTags(trim($_POST['theme']))        : $a->user['theme'];
-               $mobile_theme      = !empty($_POST['mobile_theme'])      ? Strings::escapeTags(trim($_POST['mobile_theme'])) : '';
-               $nosmile           = !empty($_POST['nosmile'])           ? intval($_POST['nosmile'])            : 0;
-               $first_day_of_week = !empty($_POST['first_day_of_week']) ? intval($_POST['first_day_of_week'])  : 0;
-               $noinfo            = !empty($_POST['noinfo'])            ? intval($_POST['noinfo'])             : 0;
-               $infinite_scroll   = !empty($_POST['infinite_scroll'])   ? intval($_POST['infinite_scroll'])    : 0;
-               $no_auto_update    = !empty($_POST['no_auto_update'])    ? intval($_POST['no_auto_update'])     : 0;
-               $bandwidth_saver   = !empty($_POST['bandwidth_saver'])   ? intval($_POST['bandwidth_saver'])    : 0;
-               $smart_threading   = !empty($_POST['smart_threading'])   ? intval($_POST['smart_threading'])    : 0;
-               $nowarn_insecure   = !empty($_POST['nowarn_insecure'])   ? intval($_POST['nowarn_insecure'])    : 0;
-               $browser_update    = !empty($_POST['browser_update'])    ? intval($_POST['browser_update'])     : 0;
+               $theme              = !empty($_POST['theme'])              ? Strings::escapeTags(trim($_POST['theme']))        : $a->user['theme'];
+               $mobile_theme       = !empty($_POST['mobile_theme'])       ? Strings::escapeTags(trim($_POST['mobile_theme'])) : '';
+               $nosmile            = !empty($_POST['nosmile'])            ? intval($_POST['nosmile'])            : 0;
+               $first_day_of_week  = !empty($_POST['first_day_of_week'])  ? intval($_POST['first_day_of_week'])  : 0;
+               $noinfo             = !empty($_POST['noinfo'])             ? intval($_POST['noinfo'])             : 0;
+               $infinite_scroll    = !empty($_POST['infinite_scroll'])    ? intval($_POST['infinite_scroll'])    : 0;
+               $no_auto_update     = !empty($_POST['no_auto_update'])     ? intval($_POST['no_auto_update'])     : 0;
+               $bandwidth_saver    = !empty($_POST['bandwidth_saver'])    ? intval($_POST['bandwidth_saver'])    : 0;
+               $no_smart_threading = !empty($_POST['no_smart_threading']) ? intval($_POST['no_smart_threading']) : 0;
+               $nowarn_insecure    = !empty($_POST['nowarn_insecure'])    ? intval($_POST['nowarn_insecure'])    : 0;
+               $browser_update     = !empty($_POST['browser_update'])     ? intval($_POST['browser_update'])     : 0;
                if ($browser_update != -1) {
                        $browser_update = $browser_update * 1000;
                        if ($browser_update < 10000) {
@@ -355,20 +351,20 @@ function settings_post(App $a)
                }
 
                if ($mobile_theme !== '') {
-                       PConfig::set(local_user(), 'system', 'mobile_theme', $mobile_theme);
+                       DI::pConfig()->set(local_user(), 'system', 'mobile_theme', $mobile_theme);
                }
 
-               PConfig::set(local_user(), 'system', 'nowarn_insecure'         , $nowarn_insecure);
-               PConfig::set(local_user(), 'system', 'update_interval'         , $browser_update);
-               PConfig::set(local_user(), 'system', 'itemspage_network'       , $itemspage_network);
-               PConfig::set(local_user(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
-               PConfig::set(local_user(), 'system', 'no_smilies'              , $nosmile);
-               PConfig::set(local_user(), 'system', 'first_day_of_week'       , $first_day_of_week);
-               PConfig::set(local_user(), 'system', 'ignore_info'             , $noinfo);
-               PConfig::set(local_user(), 'system', 'infinite_scroll'         , $infinite_scroll);
-               PConfig::set(local_user(), 'system', 'no_auto_update'          , $no_auto_update);
-               PConfig::set(local_user(), 'system', 'bandwidth_saver'         , $bandwidth_saver);
-               PConfig::set(local_user(), 'system', 'smart_threading'         , $smart_threading);
+               DI::pConfig()->set(local_user(), 'system', 'nowarn_insecure'         , $nowarn_insecure);
+               DI::pConfig()->set(local_user(), 'system', 'update_interval'         , $browser_update);
+               DI::pConfig()->set(local_user(), 'system', 'itemspage_network'       , $itemspage_network);
+               DI::pConfig()->set(local_user(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
+               DI::pConfig()->set(local_user(), 'system', 'no_smilies'              , $nosmile);
+               DI::pConfig()->set(local_user(), 'system', 'first_day_of_week'       , $first_day_of_week);
+               DI::pConfig()->set(local_user(), 'system', 'ignore_info'             , $noinfo);
+               DI::pConfig()->set(local_user(), 'system', 'infinite_scroll'         , $infinite_scroll);
+               DI::pConfig()->set(local_user(), 'system', 'no_auto_update'          , $no_auto_update);
+               DI::pConfig()->set(local_user(), 'system', 'bandwidth_saver'         , $bandwidth_saver);
+               DI::pConfig()->set(local_user(), 'system', 'no_smart_threading'      , $no_smart_threading);
 
                if (in_array($theme, Theme::getAllowedList())) {
                        if ($theme == $a->user['theme']) {
@@ -385,7 +381,7 @@ function settings_post(App $a)
                }
 
                Hook::callAll('display_settings_post', $_POST);
-               $a->internalRedirect('settings/display');
+               DI::baseUrl()->redirect('settings/display');
                return; // NOTREACHED
        }
 
@@ -421,7 +417,7 @@ function settings_post(App $a)
        if (!empty($_POST['resend_relocate'])) {
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, local_user());
                info(L10n::t("Relocate message has been send to your contacts"));
-               $a->internalRedirect('settings');
+               DI::baseUrl()->redirect('settings');
        }
 
        Hook::callAll('settings_post', $_POST);
@@ -564,24 +560,23 @@ function settings_post(App $a)
                date_default_timezone_set($timezone);
        }
 
-       /** @var ACLFormatter $aclFormatter */
-       $aclFormatter = BaseObject::getClass(ACLFormatter::class);
+       $aclFormatter = DI::aclFormatter();
 
        $str_group_allow   = !empty($_POST['group_allow'])   ? $aclFormatter->toString($_POST['group_allow'])   : '';
        $str_contact_allow = !empty($_POST['contact_allow']) ? $aclFormatter->toString($_POST['contact_allow']) : '';
        $str_group_deny    = !empty($_POST['group_deny'])    ? $aclFormatter->toString($_POST['group_deny'])    : '';
        $str_contact_deny  = !empty($_POST['contact_deny'])  ? $aclFormatter->toString($_POST['contact_deny'])  : '';
 
-       PConfig::set(local_user(), 'expire', 'items', $expire_items);
-       PConfig::set(local_user(), 'expire', 'notes', $expire_notes);
-       PConfig::set(local_user(), 'expire', 'starred', $expire_starred);
-       PConfig::set(local_user(), 'expire', 'photos', $expire_photos);
-       PConfig::set(local_user(), 'expire', 'network_only', $expire_network_only);
+       DI::pConfig()->set(local_user(), 'expire', 'items', $expire_items);
+       DI::pConfig()->set(local_user(), 'expire', 'notes', $expire_notes);
+       DI::pConfig()->set(local_user(), 'expire', 'starred', $expire_starred);
+       DI::pConfig()->set(local_user(), 'expire', 'photos', $expire_photos);
+       DI::pConfig()->set(local_user(), 'expire', 'network_only', $expire_network_only);
 
-       PConfig::set(local_user(), 'system', 'suggestme', $suggestme);
+       DI::pConfig()->set(local_user(), 'system', 'suggestme', $suggestme);
 
-       PConfig::set(local_user(), 'system', 'email_textonly', $email_textonly);
-       PConfig::set(local_user(), 'system', 'detailed_notif', $detailed_notif);
+       DI::pConfig()->set(local_user(), 'system', 'email_textonly', $email_textonly);
+       DI::pConfig()->set(local_user(), 'system', 'detailed_notif', $detailed_notif);
 
        if ($page_flags == User::PAGE_FLAGS_PRVGROUP) {
                $hidewall = 1;
@@ -641,7 +636,7 @@ function settings_post(App $a)
        // Update the global contact for the user
        GContact::updateForUser(local_user());
 
-       $a->internalRedirect('settings');
+       DI::baseUrl()->redirect('settings');
        return; // NOTREACHED
 }
 
@@ -708,7 +703,7 @@ function settings_content(App $a)
                        BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
 
                        DBA::delete('clients', ['client_id' => $a->argv[3], 'uid' => local_user()]);
-                       $a->internalRedirect('settings/oauth/', true);
+                       DI::baseUrl()->redirect('settings/oauth/', true);
                        return;
                }
 
@@ -724,7 +719,7 @@ function settings_content(App $a)
                $tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                       '$baseurl'      => $a->getBaseURL(true),
+                       '$baseurl'      => DI::baseUrl()->get(true),
                        '$title'        => L10n::t('Connected Apps'),
                        '$add'          => L10n::t('Add application'),
                        '$edit'         => L10n::t('Edit'),
@@ -780,17 +775,17 @@ function settings_content(App $a)
        }
 
        if (($a->argc > 1) && ($a->argv[1] === 'connectors')) {
-               $accept_only_sharer        = intval(PConfig::get(local_user(), 'system', 'accept_only_sharer'));
-               $disable_cw                = intval(PConfig::get(local_user(), 'system', 'disable_cw'));
-               $no_intelligent_shortening = intval(PConfig::get(local_user(), 'system', 'no_intelligent_shortening'));
-               $attach_link_title         = intval(PConfig::get(local_user(), 'system', 'attach_link_title'));
-               $ostatus_autofriend        = intval(PConfig::get(local_user(), 'system', 'ostatus_autofriend'));
-               $default_group             = PConfig::get(local_user(), 'ostatus', 'default_group');
-               $legacy_contact            = PConfig::get(local_user(), 'ostatus', 'legacy_contact');
+               $accept_only_sharer        = intval(DI::pConfig()->get(local_user(), 'system', 'accept_only_sharer'));
+               $disable_cw                = intval(DI::pConfig()->get(local_user(), 'system', 'disable_cw'));
+               $no_intelligent_shortening = intval(DI::pConfig()->get(local_user(), 'system', 'no_intelligent_shortening'));
+               $attach_link_title         = intval(DI::pConfig()->get(local_user(), 'system', 'attach_link_title'));
+               $ostatus_autofriend        = intval(DI::pConfig()->get(local_user(), 'system', 'ostatus_autofriend'));
+               $default_group             = DI::pConfig()->get(local_user(), 'ostatus', 'default_group');
+               $legacy_contact            = DI::pConfig()->get(local_user(), 'ostatus', 'legacy_contact');
 
                if (!empty($legacy_contact)) {
                        /// @todo Isn't it supposed to be a $a->internalRedirect() call?
-                       $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . System::baseUrl().'/ostatus_subscribe?url=' . urlencode($legacy_contact) . '">';
+                       DI::page()['htmlhead'] = '<meta http-equiv="refresh" content="0; URL=' . DI::baseUrl().'/ostatus_subscribe?url=' . urlencode($legacy_contact) . '">';
                }
 
                $settings_connectors = '';
@@ -854,7 +849,7 @@ function settings_content(App $a)
                        '$default_group' => Group::displayGroupSelection(local_user(), $default_group, L10n::t("Default group for OStatus contacts")),
                        '$legacy_contact' => ['legacy_contact', L10n::t('Your legacy GNU Social account'), $legacy_contact, L10n::t("If you enter your old GNU Social/Statusnet account name here \x28in the format user@domain.tld\x29, your contacts will be added automatically. The field will be emptied when done.")],
 
-                       '$repair_ostatus_url' => System::baseUrl() . '/repair_ostatus',
+                       '$repair_ostatus_url' => DI::baseUrl() . '/repair_ostatus',
                        '$repair_ostatus_text' => L10n::t('Repair OStatus subscriptions'),
 
                        '$settings_connectors' => $settings_connectors,
@@ -919,27 +914,27 @@ function settings_content(App $a)
                $theme_selected        = $a->user['theme'] ?: $default_theme;
                $mobile_theme_selected = Session::get('mobile-theme', $default_mobile_theme);
 
-               $nowarn_insecure = intval(PConfig::get(local_user(), 'system', 'nowarn_insecure'));
+               $nowarn_insecure = intval(DI::pConfig()->get(local_user(), 'system', 'nowarn_insecure'));
 
-               $browser_update = intval(PConfig::get(local_user(), 'system', 'update_interval'));
+               $browser_update = intval(DI::pConfig()->get(local_user(), 'system', 'update_interval'));
                if (intval($browser_update) != -1) {
                        $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
                }
 
-               $itemspage_network = intval(PConfig::get(local_user(), 'system', 'itemspage_network'));
+               $itemspage_network = intval(DI::pConfig()->get(local_user(), 'system', 'itemspage_network'));
                $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items
-               $itemspage_mobile_network = intval(PConfig::get(local_user(), 'system', 'itemspage_mobile_network'));
+               $itemspage_mobile_network = intval(DI::pConfig()->get(local_user(), 'system', 'itemspage_mobile_network'));
                $itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : 20); // default if not set: 20 items
 
-               $nosmile = PConfig::get(local_user(), 'system', 'no_smilies', 0);
-               $first_day_of_week = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
+               $nosmile = DI::pConfig()->get(local_user(), 'system', 'no_smilies', 0);
+               $first_day_of_week = DI::pConfig()->get(local_user(), 'system', 'first_day_of_week', 0);
                $weekdays = [0 => L10n::t("Sunday"), 1 => L10n::t("Monday")];
 
-               $noinfo = PConfig::get(local_user(), 'system', 'ignore_info', 0);
-               $infinite_scroll = PConfig::get(local_user(), 'system', 'infinite_scroll', 0);
-               $no_auto_update = PConfig::get(local_user(), 'system', 'no_auto_update', 0);
-               $bandwidth_saver = PConfig::get(local_user(), 'system', 'bandwidth_saver', 0);
-               $smart_threading = PConfig::get(local_user(), 'system', 'smart_threading', 0);
+               $noinfo = DI::pConfig()->get(local_user(), 'system', 'ignore_info', 0);
+               $infinite_scroll = DI::pConfig()->get(local_user(), 'system', 'infinite_scroll', 0);
+               $no_auto_update = DI::pConfig()->get(local_user(), 'system', 'no_auto_update', 0);
+               $bandwidth_saver = DI::pConfig()->get(local_user(), 'system', 'bandwidth_saver', 0);
+               $no_smart_threading = DI::pConfig()->get(local_user(), 'system', 'no_smart_threading', 0);
 
                $theme_config = "";
                if (($themeconfigfile = get_theme_config_file($theme_selected)) !== null) {
@@ -952,7 +947,7 @@ function settings_content(App $a)
                        '$ptitle'       => L10n::t('Display Settings'),
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_display"),
                        '$submit'       => L10n::t('Save Settings'),
-                       '$baseurl' => System::baseUrl(true),
+                       '$baseurl' => DI::baseUrl()->get(true),
                        '$uid' => local_user(),
 
                        '$theme'        => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes, true],
@@ -968,7 +963,7 @@ function settings_content(App $a)
                        '$infinite_scroll'      => ['infinite_scroll', L10n::t("Infinite scroll"), $infinite_scroll, ''],
                        '$no_auto_update'       => ['no_auto_update', L10n::t("Automatic updates only at the top of the network page"), $no_auto_update, L10n::t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
                        '$bandwidth_saver' => ['bandwidth_saver', L10n::t('Bandwidth Saver Mode'), $bandwidth_saver, L10n::t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
-                       '$smart_threading' => ['smart_threading', L10n::t('Smart Threading'), $smart_threading, L10n::t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
+                       '$no_smart_threading' => ['no_smart_threading', L10n::t('Disable Smart Threading'), $no_smart_threading, L10n::t('Disable the automatic suppression of extraneous thread indentation.')],
 
                        '$d_tset' => L10n::t('General Theme Settings'),
                        '$d_ctset' => L10n::t('Custom Theme Settings'),
@@ -1004,12 +999,12 @@ function settings_content(App $a)
        $unkmail    = $a->user['unkmail'];
        $cntunkmail = $a->user['cntunkmail'];
 
-       $expire_items = PConfig::get(local_user(), 'expire', 'items', true);
-       $expire_notes = PConfig::get(local_user(), 'expire', 'notes', true);
-       $expire_starred = PConfig::get(local_user(), 'expire', 'starred', true);
-       $expire_photos = PConfig::get(local_user(), 'expire', 'photos', false);
-       $expire_network_only = PConfig::get(local_user(), 'expire', 'network_only', false);
-       $suggestme = PConfig::get(local_user(), 'system', 'suggestme', false);
+       $expire_items = DI::pConfig()->get(local_user(), 'expire', 'items', true);
+       $expire_notes = DI::pConfig()->get(local_user(), 'expire', 'notes', true);
+       $expire_starred = DI::pConfig()->get(local_user(), 'expire', 'starred', true);
+       $expire_photos = DI::pConfig()->get(local_user(), 'expire', 'photos', false);
+       $expire_network_only = DI::pConfig()->get(local_user(), 'expire', 'network_only', false);
+       $suggestme = DI::pConfig()->get(local_user(), 'system', 'suggestme', false);
 
        // nowarn_insecure
 
@@ -1087,7 +1082,7 @@ function settings_content(App $a)
                $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
        } else {
                $profile_in_dir = Renderer::replaceMacros($opt_tpl, [
-                       '$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', System::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]]
+                       '$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', DI::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]]
                ]);
        }
 
@@ -1130,8 +1125,8 @@ function settings_content(App $a)
        $tpl_addr = Renderer::getMarkupTemplate('settings/nick_set.tpl');
 
        $prof_addr = Renderer::replaceMacros($tpl_addr,[
-               '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->getHostName() . $a->getURLPath(), System::baseUrl() . '/profile/' . $nickname),
-               '$basepath' => $a->getHostName()
+               '$desc' => L10n::t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHostname() . DI::baseUrl()->getUrlPath(), DI::baseUrl() . '/profile/' . $nickname),
+               '$basepath' => DI::baseUrl()->getHostname()
        ]);
 
        $stpl = Renderer::getMarkupTemplate('settings/settings.tpl');
@@ -1155,7 +1150,7 @@ function settings_content(App $a)
                $private_post = 0;
        }
 
-       $query_str = $a->query_string;
+       $query_str = DI::args()->getQueryString();
        if (strpos($query_str, 'public=1') !== false) {
                $query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
        }
@@ -1177,7 +1172,7 @@ function settings_content(App $a)
                '$ptitle'       => L10n::t('Account Settings'),
 
                '$submit'       => L10n::t('Save Settings'),
-               '$baseurl' => System::baseUrl(true),
+               '$baseurl' => DI::baseUrl()->get(true),
                '$uid' => local_user(),
                '$form_security_token' => BaseModule::getFormSecurityToken("settings"),
                '$nickname_block' => $prof_addr,
@@ -1206,7 +1201,7 @@ function settings_content(App $a)
                '$permissions' => L10n::t('Default Post Permissions'),
                '$permdesc' => L10n::t("\x28click to open/close\x29"),
                '$visibility' => $profile['net-publish'],
-               '$aclselect' => ACL::getFullSelectorHTML($a->page, $a->user),
+               '$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user),
                '$suggestme' => $suggestme,
                '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''),
                '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''),
@@ -1248,11 +1243,11 @@ function settings_content(App $a)
                '$desktop_notifications' => ['desktop_notifications', L10n::t('Activate desktop notifications') , false, L10n::t('Show desktop popup on new notifications')],
 
                '$email_textonly' => ['email_textonly', L10n::t('Text-only notification emails'),
-                                                                       PConfig::get(local_user(), 'system', 'email_textonly'),
+                                                                       DI::pConfig()->get(local_user(), 'system', 'email_textonly'),
                                                                        L10n::t('Send text only notification emails, without the html part')],
 
                '$detailed_notif' => ['detailed_notif', L10n::t('Show detailled notifications'),
-                                                                       PConfig::get(local_user(), 'system', 'detailed_notif'),
+                                                                       DI::pConfig()->get(local_user(), 'system', 'detailed_notif'),
                                                                        L10n::t('Per default, notifications are condensed to a single notification per item. When enabled every notification is displayed.')],
 
                '$h_advn' => L10n::t('Advanced Account/Page Type Settings'),