Remove another obsoleted function.
[squirrelmail.git] / src / move_messages.php
index 0e7f51d1e170a0cd87cb02e806cf0f3c38f863fc..3095fde7b6df8c3d5f237645ae2b1bf3231049e2 100644 (file)
@@ -16,6 +16,7 @@ define('SM_PATH','../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/display_messages.php');
 require_once(SM_PATH . 'functions/imap.php');
 require_once(SM_PATH . 'functions/html.php');
@@ -26,30 +27,8 @@ if ( !sqgetGlobalVar('composesession', $composesession, SQ_SESSION) ) {
   $composesession = 0;
 }
 
-/* obsolete ?? */
-function putSelectedMessagesIntoString($msg) {
-    $j = 0;
-    $i = 0;
-    $firstLoop = true;
-    // If they have selected nothing msg is size one still, but will
-    // be an infinite loop because we never increment j. so check to
-    // see if msg[0] is set or not to fix this.
-    while (($j < count($msg)) && ($msg[0])) {
-        if ($msg[$i]) {
-            if ($firstLoop != true) {
-                $selectedMessages .= "&amp;";
-            } else {
-                $firstLoop = false;
-            }
-            $selectedMessages .= "selMsg[$j]=$msg[$i]";
-            $j++;
-        }
-        $i++;
-    }
-}
-
 function attachSelectedMessages($msg, $imapConnection) {
-    global $username, $attachment_dir,  
+    global $username, $attachment_dir, $startMessage,
            $data_dir, $composesession, $uid_support,
           $msgs, $thread_sort_messages, $allow_server_sort, $show_num,
           $compose_messages;
@@ -88,7 +67,7 @@ function attachSelectedMessages($msg, $imapConnection) {
         if (isset($msg[$i])) {
            $id = $msg[$i];
            $body_a = sqimap_run_command($imapConnection, "FETCH $id RFC822",true, $response, $readmessage, $uid_support);
-           if ($response = 'OK') {
+           if ($response == 'OK') {
                $k = $i + $start_index;
                $subject = $msgs[$k]['SUBJECT'];
     
@@ -160,6 +139,9 @@ if ($targetMailbox != $lastTargetMailbox) {
     sqsession_register($lastTargetMailbox, 'lastTargetMailbox');
 }
 $exception = false;
+
+do_hook('move_before_move');
+
 // expunge-on-demand if user isn't using move_to_trash or auto_expunge
 if(isset($expungeButton)) {
     $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);