X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsettings.php;h=ebe07612eb1fa152a0a5d6c74ec60ec15e8c73cf;hb=8c245a5d2f4e6882211ac17561f86537a7089c73;hp=fd75657c7166fd7eb26f4efd56187fa36425ccf2;hpb=e9251499dd63523a552bc3bf6274e3b851cba4c8;p=friendica.git diff --git a/mod/settings.php b/mod/settings.php index fd75657c71..ebe07612eb 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -87,11 +87,14 @@ function settings_post(&$a) { $err = ''; + $name_change = false; + if($username != $a->user['username']) { - if(strlen($username) > 40) - $err .= t(' Please use a shorter name.'); - if(strlen($username) < 3) - $err .= t(' Name too short.'); + $name_change = true; + if(strlen($username) > 40) + $err .= t(' Please use a shorter name.'); + if(strlen($username) < 3) + $err .= t(' Name too short.'); } if($email != $a->user['email']) { @@ -165,13 +168,20 @@ function settings_post(&$a) { intval(local_user()) ); + + if($name_change) { + q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self` = 1 LIMIT 1", + dbesc($username), + dbesc(datetime_convert()), + intval(local_user()) + ); + } + if($old_visibility != $net_publish) { // Update global directory in background - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); $url = $_SESSION['my_url']; if($url && strlen(get_config('system','directory_submit_url'))) - //proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",array(),$foo)); - proc_run($php_path,"include/directory.php","$url"); + proc_run('php',"include/directory.php","$url"); } $_SESSION['theme'] = $theme;