thomascube
2009-11-02 0207c45c90818e7c7df64ea52c61050850dee13d
commit | author | age
4e17e6 1 <?php
T 2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/settings/delete_identity.inc                            |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
2a5d02 8  | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland                 |
30233b 9  | Licensed under the GNU GPL                                            |
4e17e6 10  |                                                                       |
T 11  | PURPOSE:                                                              |
12  |   Delete the submitted identities (IIDs) from the database            |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id$
19
20 */
21
2a5d02 22 $iid = get_input_value('_iid', RCUBE_INPUT_GPC);
T 23
24 // check request token
25 if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(RCUBE_INPUT_GPC)) {
26   $OUTPUT->show_message('invalidrequest', 'error');
27   rcmail_overwrite_action('identities');
28   return;
29 }
30
31 if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid))
f11541 32 {
2a5d02 33   $plugin = $RCMAIL->plugins->exec_hook('delete_identity', array('id' => $iid));
69f18a 34   
2a5d02 35   if (!$plugin['abort'] && $USER->delete_identity($iid)) {
69f18a 36     $OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false);
e3a0af 37   }
f645ce 38   else {
69f18a 39     $OUTPUT->show_message('nodeletelastidentity', 'error', null, false);
e3a0af 40   }
4e17e6 41   // send response
f11541 42   if ($OUTPUT->ajax_call)
T 43     $OUTPUT->send();
44 }
4e17e6 45
1971dd 46 if ($OUTPUT->ajax_call)
A 47   exit;
48
4e17e6 49 // go to identities page
f11541 50 rcmail_overwrite_action('identities');
4e17e6 51
ee883a 52 ?>