summaryrefslogtreecommitdiff
path: root/program/steps/settings/delete_identity.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-09-30 13:24:33 +0000
committeralecpl <alec@alec.pl>2010-09-30 13:24:33 +0000
commitce92ba767a9557daf7f18be94882dd7e6f4591fb (patch)
treef018b3c42d2d452948bc240c3d9aa8a7aaff08a3 /program/steps/settings/delete_identity.inc
parent66c674cc5716364cd6b450d8398b0a26aba0a2ae (diff)
- Plugin API: improved 'abort' flag handling, added 'result' item in some hooks: group_*, contact_*, identity_* (#1486914)
Diffstat (limited to 'program/steps/settings/delete_identity.inc')
-rw-r--r--program/steps/settings/delete_identity.inc13
1 files changed, 6 insertions, 7 deletions
diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc
index 4667fd315..81609d622 100644
--- a/program/steps/settings/delete_identity.inc
+++ b/program/steps/settings/delete_identity.inc
@@ -32,12 +32,13 @@ if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid))
{
$plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid));
- if (!$plugin['abort'] && $USER->delete_identity($iid)) {
+ $deleted = !$plugin['abort'] ? $USER->delete_identity($iid) : $plugin['result'];
+
+ if ($deleted)
$OUTPUT->show_message('deletedsuccessfully', 'confirmation', null, false);
- }
- else {
- $OUTPUT->show_message('nodeletelastidentity', 'error', null, false);
- }
+ else
+ $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'nodeletelastidentity', 'error', null, false);
+
// send response
if ($OUTPUT->ajax_call)
$OUTPUT->send();
@@ -48,5 +49,3 @@ if ($OUTPUT->ajax_call)
// go to identities page
rcmail_overwrite_action('identities');
-
-