if ($var['func'] == "logout") { require_once 'Session.php'; session_start(); $auth =& $atmail->getAuthObj(); // Find the users current settings, if to delete the trash on logout //$atmail->cookie_read($auth); //$auth->getuser(); $atmail->username = $auth->username; $atmail->pop3host = $auth->pop3host; $atmail->SessionID = $auth->SessionID; //$atmail->cookie_header_delete(); if (!$pref['opensource']) { $var['ErrorHead'] = $atmail->parse("html/{$atmail->Language}/msg/logoff.html"); $var['ErrorHead'] .= "<script language='Javascript'>window.focus();</script>"; } $atmail->clean_tmp(); // clear tmp directory if ($handle = opendir($pref['install_dir'] . '/tmp/')) { while (false !== ($file_name = readdir($handle))) { if ($file_name != "." && $file_name != ".." && $file_name != '.htaccess' && is_file($file_name)) { if (strtotime("+ 180 seconds") > fileatime($file_name)) { unlink($file_name); } } } closedir($handle); } // If we have expunge on logout ( e.g PDMF IMAP server) if ($pref['expunge_logout'] == '1') { $atmail->status = $auth->getuser($atmail->SessionID); $atmail->loadprefs(1);