Source for file functions.php

Documentation is available at functions.php

  1. <?php
  2. /* functions for info plugin
  3. * Copyright (c) 1999-2020 The SquirrelMail Project Team
  4. * Licensed under the GNU GPL. For full terms see the file COPYING.
  5. *
  6. * Here are two functions for the info plugin
  7. * The first gets the CAPABILITY response from your IMAP server.
  8. * The second runs the passed IMAP test and returns the results
  9. * The third prints the results of the IMAP command
  10. * to options.php.
  11. * by: Jason Munro [email protected]
  12. *
  13. * $Id: functions.php 14840 2020年01月07日 07:42:38Z pdontthink $
  14. *
  15. */
  16. function get_caps ($imap_stream) {
  17. $sid = sqimap_session_id ();
  18. $query = "$sid CAPABILITY\r\n";
  19. fputs ($imap_stream, $query);
  20. $responses = sqimap_read_data_list ($imap_stream, $sid, true, $responses, $message);
  21. return $responses;
  22. }
  23. function imap_test ($imap_stream, $string) {
  24. $message = '';
  25. $responses = array ();
  26. $sid = sqimap_session_id ();
  27. $results = array();
  28. $query = "$sid ".trim ($string)."\r\n";
  29. print "<tr><td>".sm_encode_html_special_chars ($query)."</td></tr>";
  30. fputs ($imap_stream, $query);
  31. $response = sqimap_read_data_list ($imap_stream, $sid, false, $responses, $message);
  32. array_push ($response, $message);
  33. return $response;
  34. }
  35. function print_response ($response) {
  36. foreach($response as $index=>$value) {
  37. if (is_array ($value)) {
  38. print_response ($value);
  39. }
  40. else {
  41. print sm_encode_html_special_chars ($value)."<br>\n";
  42. }
  43. }
  44. }
  45. /**
  46. * Check if plugin is enabled
  47. * @param string $plugin_name plugin name
  48. * @return boolean
  49. */
  50. function info_is_plugin_enabled ($plugin_name) {
  51. global $plugins;
  52. if (empty($plugins) || ! is_array ($plugins))
  53. return false;
  54. if ( in_array ($plugin_name,$plugins) ) {
  55. return true;
  56. } else {
  57. return false;
  58. }
  59. }

Documentation generated on 2020年1月13日 04:24:39 +0100 by phpDocumentor 1.4.3

AltStyle によって変換されたページ (->オリジナル) /