]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
Merge pull request #3861 from annando/direct-forum-post
[friendica.git] / mod / settings.php
index 2707565abf73bd696e9d7ffd18d30e749a7c0b8c..e8d24f43de51941fd4312acdea1a04a209ea6c13 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\System;
 
 require_once('include/group.php');
 require_once('include/socgraph.php');
@@ -142,7 +143,7 @@ function settings_post(App $a) {
                q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
                        dbesc($key),
                        local_user());
-               goaway(App::get_baseurl(true)."/settings/oauth/");
+               goaway(System::baseUrl(true)."/settings/oauth/");
                return;
        }
 
@@ -187,7 +188,7 @@ function settings_post(App $a) {
                                                local_user());
                        }
                }
-               goaway(App::get_baseurl(true)."/settings/oauth/");
+               goaway(System::baseUrl(true)."/settings/oauth/");
                return;
        }
 
@@ -230,17 +231,12 @@ function settings_post(App $a) {
                                        intval(local_user())
                                );
                                if (! dbm::is_result($r)) {
-                                       q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
-                                               intval(local_user())
-                                       );
+                                       dba::insert('mailacct', array('uid' => local_user()));
                                }
                                if(strlen($mail_pass)) {
                                        $pass = '';
                                        openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
-                                       q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d",
-                                               dbesc(bin2hex($pass)),
-                                               intval(local_user())
-                                       );
+                                       dba::update('mailacct', array('pass' => bin2hex($pass)), array('uid' => local_user()));
                                }
                                $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
                                        `action` = %d, `movetofolder` = '%s',
@@ -722,7 +718,7 @@ function settings_content(App $a) {
                        $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d",
                                        dbesc($a->argv[3]),
                                        local_user());
-                       goaway(App::get_baseurl(true)."/settings/oauth/");
+                       goaway(System::baseUrl(true)."/settings/oauth/");
                        return;
                }
 
@@ -738,7 +734,7 @@ function settings_content(App $a) {
                $tpl = get_markup_template("settings_oauth.tpl");
                $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("settings_oauth"),
-                       '$baseurl'      => App::get_baseurl(true),
+                       '$baseurl'      => System::baseUrl(true),
                        '$title'        => t('Connected Apps'),
                        '$add'          => t('Add application'),
                        '$edit'         => t('Edit'),
@@ -828,7 +824,7 @@ function settings_content(App $a) {
 
                /// @TODO Found to much different usage to test empty/non-empty strings (e.g. empty(), trim() == '' ) which is wanted?
                if ($legacy_contact != "") {
-                       $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.App::get_baseurl().'/ostatus_subscribe?url='.urlencode($legacy_contact).'">';
+                       $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.System::baseUrl().'/ostatus_subscribe?url='.urlencode($legacy_contact).'">';
                }
 
                $settings_connectors .= '<div id="legacy-contact-wrapper" class="field input">';
@@ -837,7 +833,7 @@ function settings_content(App $a) {
                $settings_connectors .= '<span class="field_help">'.t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.').'</span>';
                $settings_connectors .= '</div>';
 
-               $settings_connectors .= '<p><a href="'.App::get_baseurl().'/repair_ostatus">'.t("Repair OStatus subscriptions").'</a></p>';
+               $settings_connectors .= '<p><a href="'.System::baseUrl().'/repair_ostatus">'.t("Repair OStatus subscriptions").'</a></p>';
 
                $settings_connectors .= '<div class="settings-submit-wrapper" ><input type="submit" name="general-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div>';
 
@@ -878,12 +874,7 @@ function settings_content(App $a) {
 
                $tpl = get_markup_template("settings_connectors.tpl");
 
-               if (! service_class_allows(local_user(),'email_connect')) {
-                       $mail_disabled_message = upgrade_bool_message();
-               } else {
-                       $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
-               }
-
+               $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
 
                $o .= replace_macros($tpl, array(
                        '$form_security_token' => get_form_security_token("settings_connectors"),
@@ -1004,7 +995,7 @@ function settings_content(App $a) {
                        '$ptitle'       => t('Display Settings'),
                        '$form_security_token' => get_form_security_token("settings_display"),
                        '$submit'       => t('Save Settings'),
-                       '$baseurl' => App::get_baseurl(true),
+                       '$baseurl' => System::baseUrl(true),
                        '$uid' => local_user(),
 
                        '$theme'        => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true),
@@ -1018,7 +1009,7 @@ function settings_content(App $a) {
                        '$first_day_of_week'    => array('first_day_of_week', t('Beginning of week:'), $first_day_of_week, '', $weekdays, false),
                        '$noinfo'       => array('noinfo', t("Don't show notices"), $noinfo, ''),
                        '$infinite_scroll'      => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''),
-                       '$no_auto_update'       => array('no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, 'When disabled, the network page is updated all the time, which could be confusing while reading.'),
+                       '$no_auto_update'       => array('no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, t('When disabled, the network page is updated all the time, which could be confusing while reading.')),
                        '$bandwidth_saver' => array('bandwidth_saver', t('Bandwith Saver Mode'), $bandwidth_saver, t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')),
 
                        '$d_tset' => t('General Theme Settings'),
@@ -1222,7 +1213,7 @@ function settings_content(App $a) {
        $tpl_addr = get_markup_template("settings_nick_set.tpl");
 
        $prof_addr = replace_macros($tpl_addr,array(
-               '$desc' => sprintf(t("Your Identity Address is <strong>'%s'</strong> or '%s'."), $nickname.'@'.$a->get_hostname().$a->get_path(), App::get_baseurl().'/profile/'.$nickname),
+               '$desc' => sprintf(t("Your Identity Address is <strong>'%s'</strong> or '%s'."), $nickname.'@'.$a->get_hostname().$a->get_path(), System::baseUrl().'/profile/'.$nickname),
                '$basepath' => $a->get_hostname()
        ));
 
@@ -1270,7 +1261,7 @@ function settings_content(App $a) {
                '$ptitle'       => t('Account Settings'),
 
                '$submit'       => t('Save Settings'),
-               '$baseurl' => App::get_baseurl(true),
+               '$baseurl' => System::baseUrl(true),
                '$uid' => local_user(),
                '$form_security_token' => get_form_security_token("settings"),
                '$nickname_block' => $prof_addr,