]> git.mxchange.org Git - friendica.git/blobdiff - mod/admin.php
Merge pull request #7039 from annando/api-reshare-quote
[friendica.git] / mod / admin.php
index fe068629625d5c5a6607b82f4c4a589c7f4f5be4..a067b516ffad4df391edc539cd7038bff96b6ca7 100644 (file)
@@ -32,6 +32,7 @@ use Friendica\Module\Tos;
 use Friendica\Protocol\PortableContact;
 use Friendica\Util\Arrays;
 use Friendica\Util\BasePath;
+use Friendica\Util\BaseURL;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
@@ -1041,9 +1042,6 @@ function admin_page_site_post(App $a)
                update_table($a, "gcontact", ['connect', 'addr'], $old_host, $new_host);
 
                // update config
-               $configFileSaver = new \Friendica\Util\Config\ConfigFileSaver($a->getBasePath());
-               $configFileSaver->addConfigValue('config', 'hostname', parse_url($new_url, PHP_URL_HOST));
-               $configFileSaver->saveToConfigFile();
                Config::set('system', 'url', $new_url);
                $a->setBaseURL($new_url);
 
@@ -1159,17 +1157,17 @@ function admin_page_site_post(App $a)
        if (!is_null($storagebackend) && $storagebackend != "") {
                if (StorageManager::setBackend($storagebackend)) {
                        $storage_opts = $storagebackend::getOptions();
-                       $storage_form_prefix=preg_replace('|[^a-zA-Z0-9]|' ,'', $storagebackend);
+                       $storage_form_prefix = preg_replace('|[^a-zA-Z0-9]|', '', $storagebackend);
                        $storage_opts_data = [];
-                       foreach($storage_opts as $name => $info) {
+                       foreach ($storage_opts as $name => $info) {
                                $fieldname = $storage_form_prefix . '_' . $name;
                                switch ($info[0]) { // type
-                               case 'checkbox':
-                               case 'yesno':
-                                       $value = !empty($_POST[$fieldname]);
-                                       break;
-                               default:
-                                       $value = defaults($_POST, $fieldname, '');
+                                       case 'checkbox':
+                                       case 'yesno':
+                                               $value = !empty($_POST[$fieldname]);
+                                               break;
+                                       default:
+                                               $value = defaults($_POST, $fieldname, '');
                                }
                                $storage_opts_data[$name] = $value;
                        }
@@ -1178,7 +1176,7 @@ function admin_page_site_post(App $a)
 
                        $storage_form_errors = $storagebackend::saveOptions($storage_opts_data);
                        if (count($storage_form_errors)) {
-                               foreach($storage_form_errors as $name => $err) {
+                               foreach ($storage_form_errors as $name => $err) {
                                        notice('Storage backend, ' . $storage_opts[$name][1] . ': ' . $err);
                                }
                                $a->internalRedirect('admin/site' . $active_panel);
@@ -1200,7 +1198,7 @@ function admin_page_site_post(App $a)
                $diaspora_enabled = false;
        }
        if ($ssl_policy != intval(Config::get('system', 'ssl_policy'))) {
-               if ($ssl_policy == SSL_POLICY_FULL) {
+               if ($ssl_policy == BaseURL::SSL_POLICY_FULL) {
                        q("UPDATE `contact` SET
                                `url`     = REPLACE(`url`    , 'http:' , 'https:'),
                                `photo`   = REPLACE(`photo`  , 'http:' , 'https:'),
@@ -1218,7 +1216,7 @@ function admin_page_site_post(App $a)
                                `thumb`   = REPLACE(`thumb`  , 'http:' , 'https:')
                                WHERE 1 "
                        );
-               } elseif ($ssl_policy == SSL_POLICY_SELFSIGN) {
+               } elseif ($ssl_policy == BaseURL::SSL_POLICY_SELFSIGN) {
                        q("UPDATE `contact` SET
                                `url`     = REPLACE(`url`    , 'https:' , 'http:'),
                                `photo`   = REPLACE(`photo`  , 'https:' , 'http:'),
@@ -1474,9 +1472,9 @@ function admin_page_site(App $a)
        ];
 
        $ssl_choices = [
-               SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"),
-               SSL_POLICY_FULL => L10n::t("Force all links to use SSL"),
-               SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
+               BaseURL::SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"),
+               BaseURL::SSL_POLICY_FULL => L10n::t("Force all links to use SSL"),
+               BaseURL::SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
        ];
 
        $check_git_version_choices = [
@@ -1508,7 +1506,7 @@ function admin_page_site(App $a)
                $storage_backends_choices[''] = L10n::t('Database (legacy)');
        };
 
-       foreach($storage_backends as $name=>$class) {
+       foreach ($storage_backends as $name => $class) {
                $storage_backends_choices[$class] = $name;
        }
        unset($storage_backends);