diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-04-11 13:34:19 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-04-11 13:34:19 +0000 |
| commit | 8f7e0321de7c9e2ebc1ad581c0336d5c0fb6ab51 (patch) | |
| tree | 25c57f10d3427f56907650c2ce51bee46a281464 /roundcubemail/program/include | |
| parent | 10b3fc144e42871961f70d5ccb4fe32ad7abb6dd (diff) | |
#1483863: empty trash and expunge inbox on logout
git-svn-id: https://svn.roundcube.net/trunk@1282 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index 5b82640f7..649dd25e9 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/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 |
