squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

functions.php
Go to the documentation of this file.
1 <?php
2 
3 /* functions for info plugin
4  * Copyright (c) 1999-2011 The SquirrelMail Project Team
5  * Licensed under the GNU GPL. For full terms see the file COPYING.
6  *
7  * Here are two functions for the info plugin
8  * The first gets the CAPABILITY response from your IMAP server.
9  * The second runs the passed IMAP test and returns the results
10  * The third prints the results of the IMAP command
11  * to options.php.
12  * by: Jason Munro jason@stdbev.com
13  *
14  * $Id: functions.php 14084 2011-01-06 02:44:03Z pdontthink $
15  *
16  */
17 
19  $sid = sqimap_session_id();
20  $query = "$sid CAPABILITY\r\n";
21  fputs ($imap_stream, $query);
22  $responses = sqimap_read_data_list($imap_stream, $sid, true, $responses, $message);
23  return $responses;
24 }
25 
26 function imap_test($imap_stream, $string) {
27  global $default_charset;
28  $message = '';
29  $responses = array ();
30  $sid = sqimap_session_id();
31  $results = array();
32  $query = "$sid ".trim($string)."\r\n";
33  print "<tr><td>".htmlspecialchars($query)."</td></tr>";
34  fputs ($imap_stream, $query);
35  $response = sqimap_read_data_list($imap_stream, $sid, false, $responses, $message);
36  array_push($response, $message);
37  return $response;
38 }
39 
40 function print_response($response) {
41  foreach($response as $index=>$value) {
42  if (is_array($value)) {
43  print_response($value);
44  }
45  else {
46  print htmlspecialchars($value)."<br>\n";
47  }
48  }
49 }
50 
56 function info_is_plugin_enabled($plugin_name) {
57  global $plugins;
58 
59  if (empty($plugins) || ! is_array($plugins))
60  return false;
61 
62  if ( in_array($plugin_name,$plugins) ) {
63  return true;
64  } else {
65  return false;
66  }
67 }
get_caps
get_caps($imap_stream)
Definition: functions.php:18
sqimap_session_id
sqimap_session_id($unique_id=FALSE)
Definition: imap_general.php:26
$imap_stream
$imap_stream
Definition: bug_report.php:119
$plugins
global $plugins
Definition: plugin.php:196
sqimap_read_data_list
sqimap_read_data_list($imap_stream, $tag_uid, $handle_errors, &$response, &$message, $query='', $filter=false, $outputstream=false, $no_return=false)
Definition: imap_general.php:201
$message
$message
Definition: download.php:54
print_response
print_response($response)
Definition: functions.php:40
$default_charset
$default_charset
Definition: config_default.php:1027
imap_test
imap_test($imap_stream, $string)
Definition: functions.php:26
info_is_plugin_enabled
info_is_plugin_enabled($plugin_name)
Definition: functions.php:56