($this->arg('bio')) ? $this->arg('bio') : $profile->bio);
common_input('location', _t('Location'),
($this->arg('location')) ? $this->arg('location') : $profile->location);
- common_element('input', array('name' => 'submit',
- 'type' => 'submit',
- 'id' => 'submit',
- 'value' => _t('Save')));
+ common_submit('submit', _t('Save'));
common_element_end('form');
common_show_footer();
}
$user->nickname = $this->arg('nickname');
$user->email = $this->arg('email');
+ $val = $user->validate();
+ if ($val !== TRUE) {
+ # XXX: better validation
+ $this->show_form(_t('Error saving user; invalid.'));
+ return;
+ }
+
if (!$user->update($original)) {
common_server_error(_t('Couldnt update user.'));
return;
$profile->location = $this->arg('location');
$profile->profileurl = common_profile_url($nickname);
+ $val = $profile->validate();
+ if ($val !== TRUE) {
+ # XXX: some feedback here, please!
+ $this->show_form(_t('Error saving profile; invalid.'));
+ return;
+ }
+
if (!$profile->update($orig_profile)) {
common_server_error(_t('Couldnt save profile.'));
return;