/** * Do server side actions on logout */ public function logout_actions() { $config = $this->config->all(); // on logout action we're not connected to imap server if ($config['logout_purge'] && !empty($config['trash_mbox']) || $config['logout_expunge']) { if (!$this->session->check_auth()) { return; } $this->imap_connect(); } if ($config['logout_purge'] && !empty($config['trash_mbox'])) { $this->imap->clear_mailbox($config['trash_mbox']); } if ($config['logout_expunge']) { $this->imap->expunge('INBOX'); } // Try to save unsaved user preferences if (!empty($_SESSION['preferences'])) { $this->user->save_prefs(unserialize($_SESSION['preferences'])); } }