+ function update($dataObject=false)
+ {
+ if (is_object($dataObject) && $this->nickname != $dataObject->nickname) {
+ try {
+ $local = $this->getUser();
+ common_debug("Updating User ({$this->id}) nickname from {$dataObject->nickname} to {$this->nickname}");
+ $origuser = clone($local);
+ $local->nickname = $this->nickname;
+ $result = $local->updateKeys($origuser);
+ if ($result === false) {
+ common_log_db_error($local, 'UPDATE', __FILE__);
+ // TRANS: Server error thrown when user profile settings could not be updated.
+ throw new ServerException(_('Could not update user nickname.'));
+ }
+
+ // Clear the site owner, in case nickname changed
+ if ($local->hasRole(Profile_role::OWNER)) {
+ User::blow('user:site_owner');
+ }
+ } catch (NoSuchUserException $e) {
+ // Nevermind...
+ }
+ }
+
+ return parent::update($dataObject);
+ }
+
+ function delete($useWhere=false)