summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc24
1 files changed, 24 insertions, 0 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 5b82640f7..649dd25e9 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -352,6 +352,30 @@ function rcmail_kill_session()
$USER->reset();
}
+/**
+ * Do server side actions on logout
+ */
+function rcmail_logout_actions()
+ {
+ global $CONFIG, $IMAP;
+
+ // on logout action we're not connected to imap server
+ if (($CONFIG['logout_purge'] && !empty($CONFIG['trash_mbox']))
+ || $CONFIG['logout_expunge'])
+ {
+ if (!rcmail_authenticate_session())
+ return;
+
+ rcmail_imap_init(true);
+ }
+
+ if ($CONFIG['logout_purge'] && !empty($CONFIG['trash_mbox']))
+ $IMAP->clear_mailbox($CONFIG['trash_mbox']);
+
+ if ($CONFIG['logout_expunge'])
+ $IMAP->expunge('INBOX');
+ }
+
/**
* Return correct name for a specific database table