]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/steps/settings/delete_identity.inc
Imported Upstream version 0.1
[roundcube.git] / program / steps / settings / delete_identity.inc
index 4555a6f110029d44e21ab287dc1d1981893245a4..8b0b0be3357e720d22dfeb26e6b383103ec9ba79 100644 (file)
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: delete_identity.inc 543 2007-04-28 18:07:12Z thomasb $
+ $Id: delete_identity.inc 1035 2008-02-10 17:08:40Z till $
 
 */
 
 if (($ids = get_input_value('_iid', RCUBE_INPUT_GET)) && preg_match('/^[0-9]+(,[0-9]+)*$/', $ids))
 {
-  $DB->query(
-    "UPDATE ".get_table_name('identities')."
-     SET    del=1
-     WHERE  user_id=?
-     AND    identity_id IN (".$ids.")",
-    $_SESSION['user_id']);
-
-  $count = $DB->affected_rows();
-  if ($count)
-    $OUTPUT->show_message('deletedsuccessfully', 'confirmation');
 
+  if ($USER->delete_identity($ids))
+  {
+    $OUTPUT->show_message('deletedsuccessfully', 'confirmation');
+  }
+  else 
+  {
+    $OUTPUT->show_message('nodeletelastidentity', 'error');
+  }
   // send response
   if ($OUTPUT->ajax_call)
     $OUTPUT->send();