diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-07-19 19:09:58 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-07-19 19:09:58 -0700 |
commit | c3fd5ed73202f4dd17dda87ac968b0db4f44d423 (patch) | |
tree | 353a6394ebb8ea8eddd0f8dc862fa7d09a3ee0b1 /mod/settings.php | |
parent | 6695b4a203ab03941c8b3305a3e55cc02b85a5ac (diff) | |
download | volse-hubzilla-c3fd5ed73202f4dd17dda87ac968b0db4f44d423.tar.gz volse-hubzilla-c3fd5ed73202f4dd17dda87ac968b0db4f44d423.tar.bz2 volse-hubzilla-c3fd5ed73202f4dd17dda87ac968b0db4f44d423.zip |
one true profile photo, force nicknames
Diffstat (limited to 'mod/settings.php')
-rw-r--r-- | mod/settings.php | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/mod/settings.php b/mod/settings.php index 1abb60fcc..54fca992c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -53,13 +53,10 @@ function settings_post(&$a) { $username = notags(trim($_POST['username'])); $email = notags(trim($_POST['email'])); - if(x($_POST,'nick')) - $nick = notags(trim($_POST['nick'])); $timezone = notags(trim($_POST['timezone'])); $username_changed = false; $email_changed = false; - $nick_changed = false; $zone_changed = false; $err = ''; @@ -81,19 +78,6 @@ function settings_post(&$a) { if($r !== NULL && count($r)) $err .= " This email address is already registered." . EOL; } - if((x($nick)) && ($nick != $a->user['nickname'])) { - $nick_changed = true; - if(! preg_match("/^[a-zA-Z][a-zA-Z0-9\-\_]*$/",$nick)) - $err .= " Nickname must start with a letter and contain only contain letters, numbers, dashes, and underscore."; - $r = q("SELECT `uid` FROM `user` - WHERE `nickname` = '%s' LIMIT 1", - dbesc($nick) - ); - if($r !== NULL && count($r)) - $err .= " Nickname is already registered. Try another." . EOL; - } - else - $nick = $a->user['nickname']; if(strlen($err)) { $_SESSION['sysmsg'] .= $err . EOL; @@ -104,11 +88,10 @@ function settings_post(&$a) { if(strlen($timezone)) date_default_timezone_set($timezone); } - if($email_changed || $username_changed || $nick_changed || $zone_changed ) { - $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `nickname` = '%s', `timezone` = '%s' WHERE `uid` = %d LIMIT 1", + if($email_changed || $username_changed || $zone_changed ) { + $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s' WHERE `uid` = %d LIMIT 1", dbesc($username), dbesc($email), - dbesc($nick), dbesc($timezone), intval($_SESSION['uid'])); if($r) @@ -119,17 +102,6 @@ function settings_post(&$a) { // FIXME - set to un-verified, blocked and redirect to logout } - if($nick_changed) { - $r = q ("UPDATE `profile` SET `url` = '%s', `request` = '%s', `notify` = '%s', `poll` = '%s', `confirm` = '%s' - WHERE `uid` = %d AND `self` = 1 LIMIT 1", - dbesc( $a->get_baseurl() . '/profile/' . $nick ), - dbesc( $a->get_baseurl() . '/dfrn_request/' . $nick ), - dbesc( $a->get_baseurl() . '/dfrn_notify/' . $nick ), - dbesc( $a->get_baseurl() . '/dfrn_poll/' . $nick ), - dbesc( $a->get_baseurl() . '/dfrn_confirm/' . $nick ), - intval($_SESSION['uid']) - ); - } // Refresh the content display with new data |