summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-07-21 16:13:42 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-07-21 16:13:42 +0000
commit61b5a6483ace42d0076f78e94e2f4f20c1b03621 (patch)
tree98c56f41786035916d68199d17cfbd4ce0fa8ba9 /roundcubemail/program/steps
parent06a746b43a418a501e67b47242499a1acd2ba848 (diff)
Also protect GET request from CSRF
git-svn-id: https://svn.roundcube.net/trunk@2779 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/settings/delete_identity.inc17
1 files changed, 13 insertions, 4 deletions
diff --git a/roundcubemail/program/steps/settings/delete_identity.inc b/roundcubemail/program/steps/settings/delete_identity.inc
index 97c16d578..3d8e2420b 100644
--- a/roundcubemail/program/steps/settings/delete_identity.inc
+++ b/roundcubemail/program/steps/settings/delete_identity.inc
@@ -5,7 +5,7 @@
| program/steps/settings/delete_identity.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -19,11 +19,20 @@
*/
-if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids))
+$iid = get_input_value('_iid', RCUBE_INPUT_GPC);
+
+// check request token
+if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(RCUBE_INPUT_GPC)) {
+ $OUTPUT->show_message('invalidrequest', 'error');
+ rcmail_overwrite_action('identities');
+ return;
+}
+
+if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid))
{
- $plugin = $RCMAIL->plugins->exec_hook('delete_identity', array('id' => $ids));
+ $plugin = $RCMAIL->plugins->exec_hook('delete_identity', array('id' => $iid));
- if (!$plugin['abort'] && $USER->delete_identity($ids)) {
+ if (!$plugin['abort'] && $USER->delete_identity($iid)) {
$OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false);
}
else {