X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsettings.php;h=3edad6945c02d6497398b2975373d3881e5fc561;hb=bac60164e759141144d6d39431dc3f65c61854e8;hp=6fcbe4d116b9a7efaf6a7ee79213109946d5ad73;hpb=ba560ff76cc0f47e535d4e68c105ce5032590259;p=friendica.git diff --git a/mod/settings.php b/mod/settings.php index 6fcbe4d116..3edad6945c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -13,6 +13,7 @@ use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBM; +use Friendica\Model\Contact; use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\User; @@ -207,8 +208,7 @@ function settings_post(App $a) return; } - if (($a->argc > 1) && ($a->argv[1] == 'connectors')) - { + if (($a->argc > 1) && ($a->argv[1] == 'connectors')) { check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors'); if (x($_POST, 'general-submit')) { @@ -485,10 +485,7 @@ function settings_post(App $a) $err = ''; - $name_change = false; - if ($username != $a->user['username']) { - $name_change = true; if (strlen($username) > 40) { $err .= L10n::t(' Please use a shorter name.'); } @@ -628,14 +625,7 @@ function settings_post(App $a) intval(local_user()) ); - - if ($name_change) { - q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self`", - dbesc($username), - dbesc(DateTimeFormat::utcNow()), - intval(local_user()) - ); - } + Contact::updateSelfFromUserID(local_user()); if (($old_visibility != $net_publish) || ($page_flags != $old_page_flags)) { // Update global directory in background @@ -1112,7 +1102,7 @@ function settings_content(App $a) if (strlen(Config::get('system', 'directory'))) { $profile_in_net_dir = replace_macros($opt_tpl, [ - '$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], L10n::t('Your profile will be publishedin this node\'s local directory. Your profile details may be publicly visible depending on the system settings.', System::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]] + '$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], L10n::t('Your profile will be published in this node\'s local directory. Your profile details may be publicly visible depending on the system settings.', System::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]] ]); } else { $profile_in_net_dir = '';