From 0dc05a812a0fad81bf9a2322f1912a8f3f234869 Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 2 Jul 2003 20:55:04 +0000 Subject: [PATCH] renamed sqimap_read_data_list => sqimap_retrieve_imap_response and created a 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 | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 6b6826ed..f8034018 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -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 = "\n" . + _("ERROR : Bad function call.") . + "
\n" . + _("Reason:") . ' '. + 'There is a plugin installed which make use of the
' . + 'SquirrelMail internal function sqimap_read_data_list.
'. + 'Please adapt the installed plugin and let it use
'. + 'sqimap_run_command or sqimap_run_command_list instead

'. + 'The following query was issued:
'. + htmlspecialchars($query) . '
' . "

\n"; + error_box($string,$color); + echo ''; + 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. */ -- 2.25.1