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;
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);
// save storage backend form
if (!is_null($storagebackend) && $storagebackend != "") {
- if (!StorageManager::setBackend($storagebackend)) {
- info(L10n::t('Invalid storage backend setting value.'));
- } else {
+ 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;
}
$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);
}
+ } else {
+ info(L10n::t('Invalid storage backend setting value.'));
}
}
$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:'),
`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:'),
];
$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 = [
$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);