Happy New Year
[squirrelmail.git] / src / empty_trash.php
index 604b860753e5f1b93b39bd8f762d17dfa619f544..87f3c4549ee158ce292f4565029e22fea85d82b5 100644 (file)
@@ -6,12 +6,15 @@
  * Handles deleting messages from the trash folder without
  * deleting subfolders.
  *
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2020 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  */
 
+/** This is the empty_trash page */
+define('PAGE_NAME', 'empty_trash');
+
 /**
  * Include the SquirrelMail initialization file.
  */
@@ -27,7 +30,12 @@ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 
 /* finished globals */
 
-$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+// first do a security check
+sqgetGlobalVar('smtoken', $submitted_token, SQ_GET, '');
+sm_validate_security_token($submitted_token, -1, TRUE);
+
+global $imap_stream_options; // in case not defined in config
+$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options);
 
 $mailbox = $trash_folder;
 $boxes = sqimap_mailbox_list($imap_stream);
@@ -71,4 +79,3 @@ session_write_close();
 $location = get_location();
 header ("Location: $location/left_main.php");
 
-?>