'id' => 'profilesettings',
'action' =>
common_local_url('profilesettings')));
+ common_hidden('token', common_session_token());
# too much common patterns here... abstractable?
common_input('nickname', _('Nickname'),
($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname,
$language = $this->trimmed('language');
$timezone = $this->trimmed('timezone');
+ # CSRF protection
+
+ $token = $this->trimmed('token');
+ if (!$token || $token != common_session_token()) {
+ $this->show_form(_('There was a problem with your session token. Try again, please.'));
+ return;
+ }
+
# Some validation
if (!Validate::string($nickname, array('min_length' => 1,
}
# XXX: XOR
-
+
if ($user->autosubscribe ^ $autosubscribe) {
-
+
$original = clone($user);
$user->autosubscribe = $autosubscribe;
return;
}
}
-
+
$profile = $user->getProfile();
$orig_profile = clone($profile);