renamed sqimap_read_data_list => sqimap_retrieve_imap_response and created a
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 2 Jul 2003 20:55:04 +0000 (20:55 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 2 Jul 2003 20:55:04 +0000 (20:55 +0000)
new function sqimap_read_data_list which will inform plugins that they
should call other functions.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5197 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index 6b6826edc793949e30d4499e06fcb3070bc341b2..f8034018d446c435efb0ca60472681fbb21d5e3a 100755 (executable)
@@ -38,7 +38,7 @@ function sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$respon
         fputs ($imap_stream, $sid . ' ' . $query . "\r\n");
         $tag_uid_a = explode(' ',trim($sid));
         $tag = $tag_uid_a[0];
-        $read = sqimap_read_data_list ($imap_stream, $tag, $handle_errors, $response, $message, $query );
+        $read = sqimap_retrieve_imap_response ($imap_stream, $tag, $handle_errors, $response, $message, $query );
         /* get the response and the message */
         $message = $message[$tag];
         $response = $response[$tag]; 
@@ -137,7 +137,7 @@ function sqimap_run_pipelined_command ($imap_stream, $aQueryList, $handle_errors
    
         foreach($aQuery as $tag => $query) {
             if (!$aResults[$tag]) {
-                $aReturnedResponse = sqimap_read_data_list ($imap_stream, $tag, 
+                $aReturnedResponse = sqimap_retrieve_imap_response ($imap_stream, $tag, 
                                     $handle_errors, $response, $message, $query,
                                     $filter,$outputstream,$no_return);
                 foreach ($aReturnedResponse as $returned_tag => $aResponse) {
@@ -271,8 +271,26 @@ function sqimap_fread($imap_stream,$iSize,$filter=false,
     }
     return $results;       
 }        
-
-
+/* obsolete function, inform plugins that use it */
+function sqimap_read_data_list($imap_stream, $tag, $handle_errors, 
+          &$response, &$message, $query = '') {
+    global $color, $squirrelmail_language;
+    set_up_language($squirrelmail_language);
+    require_once(SM_PATH . 'functions/display_messages.php');
+    $string = "<b><font color=$color[2]>\n" .
+        _("ERROR : Bad function call.") .
+        "</b><br>\n" .
+        _("Reason:") . ' '.
+          'There is a plugin installed which make use of the  <br>' .
+          'SquirrelMail internal function sqimap_read_data_list.<br>'.
+         'Please adapt the installed plugin and let it use<br>'.
+         'sqimap_run_command or sqimap_run_command_list instead<br><br>'.
+         'The following query was issued:<br>'.
+           htmlspecialchars($query) . '<br>' . "</font><br>\n";
+    error_box($string,$color);
+    echo '</body></html>';        
+    exit; 
+}
 
 /*
  * Reads the output from the IMAP stream.  If handle_errors is set to true,
@@ -280,7 +298,7 @@ function sqimap_fread($imap_stream,$iSize,$filter=false,
  * the errors will be sent back through $response and $message
  */
 
-function sqimap_read_data_list ($imap_stream, $tag, $handle_errors, 
+function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors, 
           &$response, &$message, $query = '',
            $filter = false, $outputstream = false, $no_return = false) {
     global $color, $squirrelmail_language;
@@ -538,10 +556,10 @@ function sqimap_read_data ($imap_stream, $tag_uid, $handle_errors,
     $tag_uid_a = explode(' ',trim($tag_uid));
     $tag = $tag_uid_a[0];
 
-    $res = sqimap_read_data_list($imap_stream, $tag, $handle_errors, 
+    $res = sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors, 
               $response, $message, $query,$filter,$outputstream,$no_return); 
     /* sqimap_read_data should be called for one response
-       but since it just calls sqimap_read_data_list which 
+       but since it just calls sqimap_retrieve_imap_response which 
        handles multiple responses we need to check for that
        and merge the $res array IF they are seperated and 
        IF it was a FETCH response. */