-
- $validhex = preg_match('/^[a-f0-9]{6}$/i',$this->linkcolor);
- if($validhex === false || $validhex == 0) {
- $this->clientError(_('Not a valid hex color.'),404,'json');
- return;
- }
-
- // save the new color
- $original = clone($this->user);
- $this->user->linkcolor = $this->linkcolor;
- if (!$this->user->update($original)) {
- $this->clientError(_('Error updating user.'),404,'json');
- return;
- }
-
- $profile = $this->user->getProfile();
-
- if (empty($profile)) {
- $this->clientError(_('User has no profile.'),'json');
- return;
+
+ // save the new color
+ $original = clone($this->auth_user);
+ $this->auth_user->linkcolor = $this->linkcolor;
+ if (!$this->auth_user->update($original)) {
+ $this->clientError(_('Error updating user.'), 400);