thomascube
2007-11-25 d5342aabcfeddb959cc286befe6de5bf35fe9d76
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                     |
f11541 8  | Copyright (C) 2005-2007, 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
b3ce79 22 if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids))
f11541 23 {
T 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']);
4e17e6 30
T 31   $count = $DB->affected_rows();
32   if ($count)
f11541 33     $OUTPUT->show_message('deletedsuccessfully', 'confirmation');
4e17e6 34
T 35   // send response
f11541 36   if ($OUTPUT->ajax_call)
T 37     $OUTPUT->send();
38 }
4e17e6 39
T 40
f11541 41 if ($OUTPUT->ajax_call)
4e17e6 42   exit;
T 43
44
45 // go to identities page
f11541 46 rcmail_overwrite_action('identities');
4e17e6 47
ee883a 48 ?>