X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_general.php;h=227bce28627f0c22783fb635f0a1cfa5678d8453;hb=821d1f1424ce74d60ae3b6e357a148658f17424e;hp=c3e3b0e1820535efbb741dc1c67e82fbffb482c6;hpb=0493ed1186b2b5393e29facef012b1a028e8e52d;p=squirrelmail.git
diff --git a/functions/imap_general.php b/functions/imap_general.php
index c3e3b0e1..227bce28 100755
--- a/functions/imap_general.php
+++ b/functions/imap_general.php
@@ -3,19 +3,18 @@
/**
* imap_general.php
*
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* This implements all functions that do general IMAP functions.
*
+ * @copyright 1999-2012 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
* @subpackage imap
*/
/** Includes.. */
-require_once(SM_PATH . 'functions/page_header.php');
-require_once(SM_PATH . 'functions/auth.php');
+
+require_once(SM_PATH . 'functions/rfc822address.php');
/**
@@ -61,14 +60,16 @@ function sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$respon
$message = $message[$tag];
$response = $response[$tag];
return $read[$tag];
+//FIXME: obey $handle_errors below!
} else {
global $squirrelmail_language, $color;
set_up_language($squirrelmail_language);
- require_once(SM_PATH . 'functions/display_messages.php');
+//FIXME: NO HTML IN CORE!
$string = "\n" .
_("ERROR: No available IMAP stream.") .
+//FIXME: NO HTML IN CORE!
"\n";
- error_box($string,$color);
+ error_box($string);
return false;
}
}
@@ -108,18 +109,35 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
$message = $message[$tag];
if (!empty($read[$tag])) {
+ /* sqimap_read_data should be called for one response
+ but since it just calls sqimap_retrieve_imap_response
+ which handles multiple responses we need to check for
+ that and merge the $read[$tag] array IF they are
+ separated and IF it was a FETCH response. */
+
+ if (isset($read[$tag][1]) && is_array($read[$tag][1]) && isset($read[$tag][1][0])
+ && preg_match('/^\* \d+ FETCH/', $read[$tag][1][0])) {
+ $result = array();
+ foreach($read[$tag] as $index => $value) {
+ $result = array_merge($result, $read[$tag]["$index"]);
+ }
+ return $result;
+ }
+
return $read[$tag][0];
} else {
return $read[$tag];
}
+//FIXME: obey $handle_errors below!
} else {
global $squirrelmail_language, $color;
set_up_language($squirrelmail_language);
- require_once(SM_PATH . 'functions/display_messages.php');
+//FIXME: NO HTML IN CORE!
$string = "\n" .
_("ERROR: No available IMAP stream.") .
+//FIXME: NO HTML IN CORE!
"\n";
- error_box($string,$color);
+ error_box($string);
return false;
}
}
@@ -317,11 +335,12 @@ function sqimap_fread($imap_stream,$iSize,$filter=false,
*/
function sqimap_read_data_list($imap_stream, $tag, $handle_errors,
&$response, &$message, $query = '') {
- global $color, $squirrelmail_language;
+ global $color, $oTemplate, $squirrelmail_language;
set_up_language($squirrelmail_language);
- require_once(SM_PATH . 'functions/display_messages.php');
+//FIXME: NO HTML IN CORE!
$string = "\n" .
_("ERROR: Bad function call.") .
+//FIXME: NO HTML IN CORE!
"
\n" .
_("Reason:") . ' '.
'There is a plugin installed which make use of the
' .
@@ -329,9 +348,10 @@ function sqimap_read_data_list($imap_stream, $tag, $handle_errors,
'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 '