'id' => 'imsettings',
'action' =>
common_local_url('imsettings')));
+ common_hidden('token', common_session_token());
common_element('h2', NULL, _('Address'));
common_checkbox('jabberreplies',
_('Send me replies through Jabber/GTalk from people I\'m not subscribed to.'),
$user->jabberreplies);
+ common_checkbox('jabbermicroid',
+ _('Publish a MicroID for my Jabber/GTalk address.'),
+ $user->jabbermicroid);
common_submit('save', _('Save'));
common_element_end('form');
function handle_post() {
+ # 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;
+ }
+
if ($this->arg('save')) {
$this->save_preferences();
} else if ($this->arg('add')) {
$jabbernotify = $this->boolean('jabbernotify');
$updatefrompresence = $this->boolean('updatefrompresence');
$jabberreplies = $this->boolean('jabberreplies');
+ $jabbermicroid = $this->boolean('jabbermicroid');
$user = common_current_user();
$user->jabbernotify = $jabbernotify;
$user->updatefrompresence = $updatefrompresence;
$user->jabberreplies = $jabberreplies;
+ $user->jabbermicroid = $jabbermicroid;
$result = $user->update($original);