]> git.donarmstrong.com Git - roundcube.git/blob - program/steps/settings/delete_identity.inc
4555a6f110029d44e21ab287dc1d1981893245a4
[roundcube.git] / program / steps / settings / delete_identity.inc
1 <?php
2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/steps/settings/delete_identity.inc                            |
6  |                                                                       |
7  | This file is part of the RoundCube Webmail client                     |
8  | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Delete the submitted identities (IIDs) from the database            |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: delete_identity.inc 543 2007-04-28 18:07:12Z thomasb $
19
20 */
21
22 if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids))
23 {
24   $DB->query(
25     "UPDATE ".get_table_name('identities')."
26      SET    del=1
27      WHERE  user_id=?
28      AND    identity_id IN (".$ids.")",
29     $_SESSION['user_id']);
30
31   $count = $DB->affected_rows();
32   if ($count)
33     $OUTPUT->show_message('deletedsuccessfully', 'confirmation');
34
35   // send response
36   if ($OUTPUT->ajax_call)
37     $OUTPUT->send();
38 }
39
40
41 if ($OUTPUT->ajax_call)
42   exit;
43
44
45 // go to identities page
46 rcmail_overwrite_action('identities');
47
48 ?>