diff options
author | Zach Copley <zach@controlyourself.ca> | 2008-08-29 00:54:41 -0400 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2008-08-29 00:54:41 -0400 |
commit | a637f36214d0da21f6f51e5763ff77faefaf10a6 (patch) | |
tree | 39201f02482c958df0a24f266db00b3df5cbd93f /actions/invite.php | |
parent | 412eae10fe81c6493f3ca5e05d7365839045f54e (diff) |
CSRF protection for invites.php
darcs-hash:20080829045441-7b5ce-a1382496d8d6b043a1a72c0fb32051f1b43163c8.gz
Diffstat (limited to 'actions/invite.php')
-rw-r--r-- | actions/invite.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actions/invite.php b/actions/invite.php index 8b4346ca9..c7d92085c 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -40,6 +40,13 @@ class InviteAction extends Action { function send_invitations() { + # 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; + } + $user = common_current_user(); $profile = $user->getProfile(); @@ -125,6 +132,7 @@ class InviteAction extends Action { common_element_start('form', array('method' => 'post', 'id' => 'invite', 'action' => common_local_url('invite'))); + common_hidden('token', common_session_token()); common_textarea('addresses', _('Email addresses'), $this->trimmed('addresses'), |