$user = User::staticGet('nickname', $nickname);
if (!$user) {
- $this->client_error(sprintf(_('No such user: %s'), $nickname));
+ $this->client_error(_('No such user.'));
return;
}
$profile = $user->getProfile();
if (!$profile) {
- common_server_error(_('User record exists without profile.'));
+ common_server_error(_('User has no profile.'));
return;
}
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
- common_user_error(_('No such nickname.'));
+ common_user_error(_('No such user.'));
return false;
} else {
return true;
$this->client_error(_('Invalid size.'));
return;
}
-
+
$user = User::staticGet('nickname', $nickname);
if (!$user) {
$this->client_error(_('No such user.'));
}
$profile = $user->getProfile();
if (!$profile) {
- $this->client_error(_('No such profile.'));
+ $this->client_error(_('User has no profile.'));
return;
}
if ($size == 'original') {
} else {
$avatar = $profile->getAvatar($size+0);
}
-
+
if ($avatar) {
$url = $avatar->url;
} else {
if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
- $this->show_form(_('Nickname must have only letters and numbers and no spaces.'));
+ $this->show_form(_('Nickname must have only lowercase letters and numbers and no spaces.'));
return;
}
$user = User::staticGet('nickname', $nickname);
if (!$user) {
- common_user_error(_('No such user'), 404);
+ common_user_error(_('No such user.'), 404);
return;
}
$profile = $user->getProfile();
if (!$profile) {
- common_server_error(_('User has no profile'), 500);
+ common_server_error(_('User has no profile.'), 500);
return;
}
if ($result === FALSE) {
common_log_db_error($user, 'UPDATE', __FILE__);
- common_server_error(_('Couldnt update user.'));
+ common_server_error(_('Couldn\'t update user.'));
return;
}
if ($result === FALSE) {
common_log_db_error($confirm, 'INSERT', __FILE__);
- common_server_error(_('Couldnt insert confirmation code.'));
+ common_server_error(_('Couldn\'t insert confirmation code.'));
return;
}
$result = $user->updateKeys($original);
if (!$result) {
common_log_db_error($user, 'UPDATE', __FILE__);
- common_server_error(_('Couldnt update user.'));
+ common_server_error(_('Couldn\'t update user.'));
return;
}
$user->query('COMMIT');
$confirm = $this->arg('confirm');
if (0 != strcmp($newpassword, $confirm)) {
- $this->show_form(_('Passwords don\'t match'));
+ $this->show_form(_('Passwords don\'t match.'));
return;
}
return;
}
- $this->show_form(_('Password saved'), true);
+ $this->show_form(_('Password saved.'), true);
}
}
} else if (!Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
- $this->show_form(_('Nickname must have only letters and numbers and no spaces.'));
+ $this->show_form(_('Nickname must have only lowercase letters and numbers and no spaces.'));
return;
} else if (!User::allowed_nickname($nickname)) {
$this->show_form(_('Not a valid nickname.'));
$this->show_form(_('Homepage is not a valid URL.'));
return;
} else if (!is_null($fullname) && strlen($fullname) > 255) {
- $this->show_form(_('Fullname is too long (max 255 chars).'));
+ $this->show_form(_('Full name is too long (max 255 chars).'));
return;
} else if (!is_null($bio) && strlen($bio) > 140) {
$this->show_form(_('Bio is too long (max 140 chars).'));
$this->show_form(_('Location is too long (max 255 chars).'));
return;
} else if ($this->nickname_exists($nickname)) {
- $this->show_form(_('Nickname already exists.'));
+ $this->show_form(_('Nickname already in use. Try another one.'));
return;
} else if ($this->email_exists($email)) {
$this->show_form(_('Email address already exists.'));
if ($result === FALSE) {
common_log_db_error($user, 'UPDATE', __FILE__);
- common_server_error(_('Couldnt update user.'));
+ common_server_error(_('Couldn\'t update user.'));
return;
}
}
if (!$result) {
common_log_db_error($confirm, 'INSERT', __FILE__);
- common_server_error(_('Couldnt confirm email.'));
+ common_server_error(_('Couldn\'t confirm email.'));
return FALSE;
}
if (!$result) {
common_log_db_error($profile, 'UPDATE', __FILE__);
- common_server_error(_('Couldnt save profile.'));
+ common_server_error(_('Couldn\'t save profile.'));
return;
}
} else if ($this->arg('reset')) {
$this->reset_password();
} else {
- $this->client_error(_('Unexpected form.'));
+ $this->client_error(_('Unexpected form submission.'));
}
} else {
if ($this->trimmed('code')) {
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
$this->show_form(_('Nickname must have only lowercase letters and numbers and no spaces.'));
} else if ($this->nickname_exists($nickname)) {
- $this->show_form(_('Nickname already exists.'));
+ $this->show_form(_('Nickname already in use. Try another one.'));
} else if (!User::allowed_nickname($nickname)) {
$this->show_form(_('Not a valid nickname.'));
} else if ($this->email_exists($email)) {
$user = $this->get_user();
if (!$user) {
- $this->show_form(_('No such user!'));
+ $this->show_form(_('No such user.'));
return;
}
$profile = $this->trimmed('profile_url');
if (!$profile) {
- $this->show_form(_('No such user!'));
+ $this->show_form(_('No such user.'));
return;
}
$profile = $user->getProfile();
if (!$profile) {
- common_server_error(_('User record exists without profile.'));
+ common_server_error(_('User has no profile.'));
return;
}
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
- common_user_error(_('No such nickname.'));
+ common_user_error(_('No such user.'));
return false;
} else {
return true;
$profile = $user->getProfile();
if (!$profile) {
- common_server_error(_('User record exists without profile.'));
+ common_server_error(_('User has no profile.'));
return;
}
if ($nickname && !Validate::string($nickname, array('min_length' => 1,
'max_length' => 64,
'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) {
- $this->client_error(_('Nickname must have only letters and numbers and no spaces.'));
+ $this->client_error(_('Nickname must have only lowercase letters and numbers and no spaces.'));
return false;
}
$license = $req->get_parameter('omb_listenee_license');
# optional stuff
$fullname = $req->get_parameter('omb_listenee_fullname');
if ($fullname && strlen($fullname) > 255) {
- $this->client_error(sprintf(_("Full name '%s' too long."), $fullname));
+ $this->client_error(_("Full name is too long (max 255 chars)."));
return false;
}
$homepage = $req->get_parameter('omb_listenee_homepage');
}
$bio = $req->get_parameter('omb_listenee_bio');
if ($bio && strlen($bio) > 140) {
- $this->client_error(sprintf(_("Bio too long '%s'"), $bio));
+ $this->client_error(_("Bio is too long (max 140 chars)."));
return false;
}
$location = $req->get_parameter('omb_listenee_location');
if ($location && strlen($location) > 255) {
- $this->client_error(sprintf(_("Location too long '%s'"), $location));
+ $this->client_error(_("Location is too long (max 255 chars)."));
return false;
}
$avatar = $req->get_parameter('omb_listenee_avatar');
$this->user = User::staticGet('nickname', $nickname);
if (!$this->user) {
- common_user_error(_('No such nickname.'));
+ common_user_error(_('No such user.'));
return false;
} else {
return true;