X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_general.php;h=0485a3c9bc7850700e5e12a862473fa3870f51e6;hb=7e6bff9bf696f683a8f8a65a642965a9b80de984;hp=4bf4151e25b5ff63ca3779c47349f22fca7374bb;hpb=95e3afc10733faf1aa0f5c70fc1633ff1e0daea0;p=squirrelmail.git
diff --git a/functions/imap_general.php b/functions/imap_general.php
index 4bf4151e..0485a3c9 100755
--- a/functions/imap_general.php
+++ b/functions/imap_general.php
@@ -3,25 +3,24 @@
/**
* 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.
+ * This implements all functions that do general IMAP functions.
*
+ * @copyright © 1999-2009 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');
/**
* Generates a new session ID by incrementing the last one used;
* this ensures that each command has a unique ID.
- * @param bool $unique_id (since 1.3.0) controls use of unique
+ * @param bool $unique_id (since 1.3.0) controls use of unique
* identifiers/message sequence numbers in IMAP commands. See IMAP
* rfc 'UID command' chapter.
* @return string IMAP session id of the form 'A000'.
@@ -46,7 +45,7 @@ function sqimap_session_id($unique_id = FALSE) {
* @param array $response
* @param array $message
* @param boolean $unique_id (since 1.3.0) see sqimap_session_id().
- * @return mixed returns false on imap error. displays error message
+ * @return mixed returns false on imap error. displays error message
* if imap stream is not available.
* @since 1.2.3
*/
@@ -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 imapstream.") .
+ _("ERROR: No available IMAP stream.") .
+//FIXME: NO HTML IN CORE!
"\n";
- error_box($string,$color);
+ error_box($string);
return false;
}
}
@@ -83,7 +84,7 @@ function sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$respon
* @param boolean $filter (since 1.4.1 and 1.5.0) see sqimap_fread()
* @param mixed $outputstream (since 1.4.1 and 1.5.0) see sqimap_fread()
* @param boolean $no_return (since 1.4.1 and 1.5.0) see sqimap_fread()
- * @return mixed returns false on imap error. displays error message
+ * @return mixed returns false on imap error. displays error message
* if imap stream is not available.
* @since 1.2.3
*/
@@ -98,7 +99,7 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
$read = sqimap_read_data ($imap_stream, $tag, $handle_errors, $response,
$message, $query,$filter,$outputstream,$no_return);
- if (empty($read)) { //Imap server dropped its connection
+ if (empty($read)) { //IMAP server dropped its connection
$response = '';
$message = '';
return false;
@@ -112,14 +113,16 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
} 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 imapstream.") .
+ _("ERROR: No available IMAP stream.") .
+//FIXME: NO HTML IN CORE!
"\n";
- error_box($string,$color);
+ error_box($string);
return false;
}
}
@@ -157,9 +160,9 @@ function sqimap_run_pipelined_command ($imap_stream, $aQueryList, $handle_errors
$aResponse = false;
/*
- Do not fire all calls at once to the imap-server but split the calls up
+ Do not fire all calls at once to the IMAP server but split the calls up
in portions of $iChunkSize. If we do not do that I think we misbehave as
- IMAP client or should handle BYE calls if the IMAP-server drops the
+ IMAP client or should handle BYE calls if the IMAP server drops the
connection because the number of queries is to large. This isn't tested
but a wild guess how it could work in the field.
@@ -215,7 +218,7 @@ function sqimap_run_pipelined_command ($imap_stream, $aQueryList, $handle_errors
}
/**
- * Custom fgets function: gets a line from the IMAP-server,
+ * Custom fgets function: gets a line from the IMAP server,
* no matter how big it may be.
* @param stream $imap_stream the stream to read from
* @return string a line
@@ -246,7 +249,7 @@ function sqimap_fgets($imap_stream) {
* @param integer $iSize
* @param boolean $filter
* @param mixed $outputstream stream or 'php://stdout' string
- * @param boolean $no_return controls data returned by function
+ * @param boolean $no_return controls data returned by function
* @return string
* @since 1.4.1
*/
@@ -317,11 +320,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.") .
+ _("ERROR: Bad function call.") .
+//FIXME: NO HTML IN CORE!
"
\n" .
_("Reason:") . ' '.
'There is a plugin installed which make use of the
' .
@@ -329,14 +333,15 @@ 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:
'.
+//FIXME: NO HTML IN CORE!
htmlspecialchars($query) . '
' . "
\n";
- error_box($string,$color);
- echo '