summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-04-11 13:34:19 +0000
committeralecpl <alec@alec.pl>2008-04-11 13:34:19 +0000
commiteaa39477bd53130e68bfb26d63308cc9b6af9369 (patch)
tree84e278a4b3e813693dc6b9a92232434da0daca40 /program/include
parentcb6b51ee7647924403a81cf5b9443936f7c5a901 (diff)
#1483863: empty trash and expunge inbox on logout
Diffstat (limited to 'program/include')
-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