Back out support for using SM without Frames
[squirrelmail.git] / plugins / info / functions.php
index 92f666dcc69f8b36e7d5c8bfda429e2296620503..95c779cf6b42e859891ccc16512ad00d091febe9 100644 (file)
@@ -1,7 +1,8 @@
 <?PHP
 
-/* functions for info plugin
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+/**
+ * functions for info plugin
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Here are two functions for the info plugin
  * The third prints the results of the IMAP command
  * to options.php.
  * by: Jason Munro jason@stdbev.com
+ *
+ * $Id$ 
+ * @package plugins
+ * @subpackage info
  */
 
+/**
+ * Get the IMAP capabilities
+ * @return array
+ */
 function get_caps($imap_stream) {
-    $sid = sqimap_session_id();
-    $query = "$sid CAPABILITY\r\n";
-    fputs ($imap_stream, $query);
-    $responses = sqimap_read_data_list($imap_stream, $sid, true, $responses, $message);
-    return $responses;
+    return sqimap_run_command_list($imap_stream, 'CAPABILITY',false, $responses, $message,false);
 }
 
+/**
+ * Run an IMAP test and return the results
+ * @return array Response from the IMAP server
+ */
 function imap_test($imap_stream, $string) {
     global $default_charset;
-    $message = '';
-    $responses = array ();
-    $sid = sqimap_session_id();
-    $results = array();
-    $query = "$sid ".trim($string)."\r\n";
-    print "<TR><TD>".$query."</TD></TR>";
-    fputs ($imap_stream, $query);
-    $response = sqimap_read_data_list($imap_stream, $sid, false, $responses, $message);
-    array_push($response, $message);
+    print "<TR><TD>".$string."</TD></TR>";
+    $response = sqimap_run_command_list($imap_stream, trim($string),false, $responses, $message,false);
+    array_push($response, $responses . ' ' .$message);
     return $response;
 }
 
+/**
+ * Print the IMAP response to options.php
+ */
 function print_response($response) {
     foreach($response as $index=>$value) {
         if (is_array($value)) {