Thijs Kinkhorst 23 tahun lalu
induk
melakukan
4c47a0653c
1 mengubah file dengan 51 tambahan dan 11 penghapusan
  1. 51 11
      plugins/delete_move_next/setup.php

+ 51 - 11
plugins/delete_move_next/setup.php

@@ -101,21 +101,31 @@ function delete_move_expunge_from_all($id) {
             arsort($msort);
         }
     }
-    session_register('msgs');
-    session_register('msort');
+    sqsession_register($msgs, 'msgs');
+    sqsession_register($msort, 'msort');
 
     sqimap_mailbox_expunge($imapConnection, $mailbox, true);
 }
 
 function delete_move_next_action() {
 
-    global $PHP_SELF,
-           $delete_id, $move_id;
+    global $PHP_SELF;
 
-    if ($delete_id) {
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_GET, $_POST;
+    }
+
+    if (isset($_GET['delete_id'])) {
+        $delete_id = $_GET['delete_id'];
+    }
+    if (isset($_POST['move_id'])) {
+        $move_id = $_POST['move_id'];
+    }       
+
+    if (isset($delete_id)) {
         delete_move_next_delete();
         fix_sort_array();
-    } elseif ($move_id) {
+    } elseif (isset($move_id)) {
         delete_move_next_move();
         fix_sort_array();
     }
@@ -284,7 +294,14 @@ function delete_move_next_moveRightMainForm() {
 
 
 function delete_move_next_delete() {
-    global $imapConnection, $delete_id, $mailbox, $auto_expunge;
+    global $imapConnection, $auto_expunge;
+
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_GET;
+    }
+
+    $delete_id = $_GET['delete_id'];
+    $mailbox = $_GET['mailbox'];
 
     sqimap_messages_delete($imapConnection, $delete_id, $delete_id, $mailbox);
     if ($auto_expunge) {
@@ -294,7 +311,15 @@ function delete_move_next_delete() {
 }
 
 function delete_move_next_move() {
-    global $imapConnection, $move_id, $targetMailbox, $auto_expunge, $mailbox;
+    global $imapConnection, $mailbox;
+
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_POST;
+    }
+
+    $move_id = $_POST['move_id'];
+    $mailbox = $_POST['mailbox'];
+    $targetMailbox = $_POST['targetMailbox'];
 
     // Move message
     sqimap_messages_copy($imapConnection, $move_id, $move_id, $targetMailbox);
@@ -341,9 +366,24 @@ function delete_move_next_display_inside() {
 
 function delete_move_next_display_save() {
 
-    global $username,$data_dir,
-           $delete_move_next_ti, $delete_move_next_formATtopi,
-           $delete_move_next_bi, $delete_move_next_formATbottomi;
+    global $username,$data_dir;
+
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_POST;
+    }
+
+    if (isset($_POST['delete_move_next_ti'])) {
+        $delete_move_next_ti = $_POST['delete_move_next_ti'];
+    }
+    if (isset($_POST['delete_move_next_bi'])) {
+        $delete_move_next_bi = $_POST['delete_move_next_bi'];
+    }
+    if (isset($_POST['delete_move_next_formATtopi'])) {
+        $delete_move_next_formATtopi = $_POST['delete_move_next_formATtopi'];
+    }
+    if (isset($_POST['delete_move_next_formATbottomi'])) {
+        $delete_move_next_formATbottomi = $_POST['delete_move_next_formATbottomi'];
+    }
 
     if (isset($delete_move_next_ti)) {
         setPref($data_dir, $username, 'delete_move_next_t', 'on');