aboutsummaryrefslogtreecommitdiffstats
path: root/mod/settings.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-01-25 10:16:47 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-01-25 10:16:47 +0100
commit1f95ba5c344a1b17c735bf2760a169beeff864c2 (patch)
tree576774009b9c9a9f8828538865d2ff8d9bbe3596 /mod/settings.php
parentf2789132ce13c92166f41992dd8955f667cab440 (diff)
parentb0ab3e468b5c20cfe369ff282b7906d1690a3510 (diff)
downloadvolse-hubzilla-1f95ba5c344a1b17c735bf2760a169beeff864c2.tar.gz
volse-hubzilla-1f95ba5c344a1b17c735bf2760a169beeff864c2.tar.bz2
volse-hubzilla-1f95ba5c344a1b17c735bf2760a169beeff864c2.zip
Merge remote branch 'friendika-master/master'
Diffstat (limited to 'mod/settings.php')
-rw-r--r--mod/settings.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/mod/settings.php b/mod/settings.php
index 1923c58da..32906d86e 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,6 +168,15 @@ 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');