3 * functions for info plugin
5 * Here are two functions for the info plugin
6 * The first gets the CAPABILITY response from your IMAP server.
7 * The second runs the passed IMAP test and returns the results
8 * The third prints the results of the IMAP command
11 * @copyright (c) 1999-2004 The SquirrelMail Project Team
12 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
13 * @author Jason Munro jason@stdbev.com
20 * Get the IMAP capabilities
22 * @param mixed $imap_stream
26 function get_caps($imap_stream) {
27 return sqimap_run_command_list($imap_stream, 'CAPABILITY',false, $responses, $message,false);
31 * Run an IMAP test and return the results
33 * @param mixed $imap_stream
34 * @param string $string imap command
35 * @return array Response from the IMAP server
38 function imap_test($imap_stream, $string) {
39 global $default_charset;
40 print "<tr><td>".htmlspecialchars($string)."</td></tr>";
41 $response = sqimap_run_command_list($imap_stream, trim($string),false, $responses, $message,false);
42 array_push($response, $responses . ' ' .$message);
47 * Print the IMAP response to options.php
49 * @param array $response results of imap command
52 function print_response($response) {
53 foreach($response as $index=>$value) {
54 if (is_array($value)) {
55 print_response($value);
58 print htmlspecialchars($value)."<br />\n";
64 * Check if plugin is enabled
65 * @param string $plugin_name plugin name
68 function is_plugin_enabled($plugin_name) {
70 if ( in_array($plugin_name,$plugins) ) {