X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_general.php;h=eca66b886dfefb96cd14958dfa3d92ade57ac1d6;hb=887f7f28f8e85139eae7031a63d8c88c4832dfca;hp=319dcac85bc29a5f089a177f5fb07a21fc263726;hpb=1d20443c04896d47c55cdba84b337558e592a9d2;p=squirrelmail.git
diff --git a/functions/imap_general.php b/functions/imap_general.php
index 319dcac8..eca66b88 100755
--- a/functions/imap_general.php
+++ b/functions/imap_general.php
@@ -6,7 +6,7 @@
* 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.
*
* @version $Id$
* @package squirrelmail
@@ -21,7 +21,7 @@ require_once(SM_PATH . 'functions/auth.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'.
@@ -40,15 +40,13 @@ function sqimap_session_id($unique_id = FALSE) {
/**
* Both send a command and accept the result from the command.
* This is to allow proper session number handling.
- * @param resource $imap_stream imap connection resource
+ * @param stream $imap_stream imap connection resource
* @param string $query imap command
* @param boolean $handle_errors see sqimap_retrieve_imap_response()
- * @param mixed $response
- * @param mixed $message
- * @param boolean $unique_id (since 1.3.0) controls use of unique
- * identifiers/message sequence numbers in IMAP commands. See IMAP
- * rfc 'UID command' chapter.
- * @return mixed returns false on imap error. displays error message
+ * @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
* if imap stream is not available.
* @since 1.2.3
*/
@@ -68,7 +66,7 @@ function sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$respon
set_up_language($squirrelmail_language);
require_once(SM_PATH . 'functions/display_messages.php');
$string = "\n" .
- _("ERROR : No available imapstream.") .
+ _("ERROR: No available IMAP stream.") .
"\n";
error_box($string,$color);
return false;
@@ -76,18 +74,16 @@ function sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$respon
}
/**
- * @param resource $imap_stream imap connection resource
+ * @param stream $imap_stream imap connection resource
* @param string $query imap command
* @param boolean $handle_errors see sqimap_retrieve_imap_response()
- * @param mixed $response
- * @param mixed $message
- * @param boolean $unique_id (since 1.3.0) controls use of unique
- * identifiers/message sequence numbers in IMAP commands. See IMAP
- * rfc 'UID command' chapter.
- * @param mixed $filter (since 1.4.1 and 1.5.0)
- * @param mixed $outputstream (since 1.4.1 and 1.5.0)
- * @param mixed $no_return (since 1.4.1 and 1.5.0)
- * @return mixed returns false on imap error. displays error message
+ * @param array $response empty string, if return = false
+ * @param array $message empty string, if return = false
+ * @param boolean $unique_id (since 1.3.0) see sqimap_session_id()
+ * @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
* if imap stream is not available.
* @since 1.2.3
*/
@@ -102,7 +98,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;
@@ -121,7 +117,7 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
set_up_language($squirrelmail_language);
require_once(SM_PATH . 'functions/display_messages.php');
$string = "\n" .
- _("ERROR : No available imapstream.") .
+ _("ERROR: No available IMAP stream.") .
"\n";
error_box($string,$color);
return false;
@@ -132,7 +128,7 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
* @param mixed $new_query
* @param string $tag
* @param array $aQuery
- * @param boolean $unique_id
+ * @param boolean $unique_id see sqimap_session_id()
* @since 1.5.0
*/
function sqimap_prepare_pipelined_query($new_query,&$tag,&$aQuery,$unique_id) {
@@ -144,15 +140,15 @@ function sqimap_prepare_pipelined_query($new_query,&$tag,&$aQuery,$unique_id) {
}
/**
- * @param stream $imap_stream
+ * @param stream $imap_stream imap stream
* @param array $aQueryList
* @param boolean $handle_errors
* @param array $aServerResponse
* @param array $aServerMessage
- * @param boolean $unique_id
- * @param mixed $filter see sqimap_retrieve_imap_response()
- * @param mixed $outputstream see sqimap_retrieve_imap_response()
- * @param mixed $no_return see sqimap_retrieve_imap_response()
+ * @param boolean $unique_id see sqimap_session_id()
+ * @param boolean $filter see sqimap_fread()
+ * @param mixed $outputstream see sqimap_fread()
+ * @param boolean $no_return see sqimap_fread()
* @since 1.5.0
*/
function sqimap_run_pipelined_command ($imap_stream, $aQueryList, $handle_errors,
@@ -161,9 +157,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.
@@ -219,9 +215,9 @@ 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
+ * @param stream $imap_stream the stream to read from
* @return string a line
* @since 1.2.8
*/
@@ -248,9 +244,9 @@ function sqimap_fgets($imap_stream) {
/**
* @param stream $imap_stream
* @param integer $iSize
- * @param mixed $filter see sqimap_retrieve_imap_response()
- * @param mixed $outputstream see sqimap_retrieve_imap_response()
- * @param mixed $no_return see sqimap_retrieve_imap_response()
+ * @param boolean $filter
+ * @param mixed $outputstream stream or 'php://stdout' string
+ * @param boolean $no_return controls data returned by function
* @return string
* @since 1.4.1
*/
@@ -310,6 +306,12 @@ function sqimap_fread($imap_stream,$iSize,$filter=false,
/**
* Obsolete function, inform plugins that use it
+ * @param stream $imap_stream
+ * @param string $tag
+ * @param boolean $handle_errors
+ * @param array $response
+ * @param array $message
+ * @param string $query
* @since 1.1.3
* @deprecated (since 1.5.0) use sqimap_run_command or sqimap_run_command_list instead
*/
@@ -319,7 +321,7 @@ function sqimap_read_data_list($imap_stream, $tag, $handle_errors,
set_up_language($squirrelmail_language);
require_once(SM_PATH . 'functions/display_messages.php');
$string = "\n" .
- _("ERROR : Bad function call.") .
+ _("ERROR: Bad function call.") .
"
\n" .
_("Reason:") . ' '.
'There is a plugin installed which make use of the
' .
@@ -334,7 +336,7 @@ function sqimap_read_data_list($imap_stream, $tag, $handle_errors,
}
/**
- * Function to display an error related to an IMAP-query.
+ * Function to display an error related to an IMAP query.
* @param string title the caption of the error box
* @param string query the query that went wrong
* @param string message_title optional message title
@@ -369,15 +371,15 @@ function sqimap_error_box($title, $query = '', $message_title = '', $message = '
* Reads the output from the IMAP stream. If handle_errors is set to true,
* this will also handle all errors that are received. If it is not set,
* the errors will be sent back through $response and $message.
- * @param stream $imap_stream
- * @param mixed $tag
- * @param boolean $handle_errors
+ * @param stream $imap_stream imap stream
+ * @param string $tag
+ * @param boolean $handle_errors handle errors internally or send them in $response and $message.
* @param array $response
* @param array $message
- * @param mixed $query
- * @param mixed $filter
- * @param mixed $outputstream
- * @param mixed $no_return
+ * @param string $query command that can be printed if something fails
+ * @param boolean $filter see sqimap_fread()
+ * @param mixed $outputstream see sqimap_fread()
+ * @param boolean $no_return see sqimap_fread()
* @since 1.5.0
*/
function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
@@ -547,12 +549,12 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
if (!$handle_errors) {
$query = '';
}
- sqimap_error_box(_("ERROR : Imap server closed the connection."), $query, _("Server responded:"),$sResponse);
+ sqimap_error_box(_("ERROR: IMAP server closed the connection."), $query, _("Server responded:"),$sResponse);
echo '