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)  

bug_report.php
Go to the documentation of this file.
1 <?php
2 
24 define('SM_PATH','../../');
25 
26 require_once(SM_PATH . 'include/validate.php');
27 
28 
29 // if this plugin is not enabled, don't continue
30 //
31 global $plugins, $color;
32 if (!in_array('bug_report', $plugins)) {
33  plain_error_message(_("Plugin is not enabled"), $color);
34  exit;
35 }
36 
37 
38 
39 /* load sqimap_get_user_server() */
40 include_once(SM_PATH . 'functions/imap_general.php');
41 // loading form functions
42 require_once(SM_PATH . 'functions/forms.php');
43 
44 displayPageHeader($color, 'None');
45 
46 function Show_Array($array) {
47  $str = '';
48  foreach ($array as $key => $value) {
49  if ($key != 0 || $value != '') {
50  $str .= " * $key = $value\n";
51  }
52  }
53  if ($str == '') {
54  return " * Nothing listed\n";
55  }
56  return $str;
57 }
58 
59 $browscap = ini_get('browscap');
60 if(!empty($browscap)) {
61  $browser = get_browser();
62 }
63 
64 sqgetGlobalVar('HTTP_USER_AGENT', $HTTP_USER_AGENT, SQ_SERVER);
65 if ( ! sqgetGlobalVar('HTTP_USER_AGENT', $HTTP_USER_AGENT, SQ_SERVER) )
66  $HTTP_USER_AGENT="Browser information is not available.";
67 
68 $body_top = "I subscribe to the squirrelmail-users mailing list.\n" .
69  " [ ] True - No need to CC me when replying\n" .
70  " [ ] False - Please CC me when replying\n" .
71  "\n" .
72  "This bug occurs when I ...\n" .
73  " ... view a particular message\n" .
74  " ... use a specific plugin/function\n" .
75  " ... try to do/view/use ....\n" .
76  "\n\n\n" .
77  "The description of the bug:\n\n\n" .
78  "I can reproduce the bug by:\n\n\n" .
79  "(Optional) I got bored and found the bug occurs in:\n\n\n" .
80  "(Optional) I got really bored and here's a fix:\n\n\n" .
81  "----------------------------------------------\n" .
82  "\nMy browser information:\n" .
83  ' '.$HTTP_USER_AGENT . "\n" ;
84  if(isset($browser)) {
85  $body_top .= " get_browser() information (List)\n" .
86  Show_Array((array) $browser);
87  }
88  $body_top .= "\nMy web server information:\n" .
89  " PHP Version " . phpversion() . "\n" .
90  " PHP Extensions (List)\n" .
91  Show_Array(get_loaded_extensions()) .
92  "\nSquirrelMail-specific information:\n" .
93  " Version: $version\n" .
94  " Plugins (List)\n" .
96 if (isset($ldap_server) && $ldap_server[0] && ! extension_loaded('ldap')) {
97  $warning = 1;
98  $warnings['ldap'] = "LDAP server defined in SquirrelMail config, " .
99  "but the module is not loaded in PHP";
100  $corrections['ldap'][] = "Reconfigure PHP with the option '--with-ldap'";
101  $corrections['ldap'][] = "Then recompile PHP and reinstall";
102  $corrections['ldap'][] = "-- OR --";
103  $corrections['ldap'][] = "Reconfigure SquirrelMail to not use LDAP";
104 }
105 
106 $body = "\nMy IMAP server information:\n" .
107  " Server type: $imap_server_type\n";
108 
109 /* check imap server's mapping */
111 
112 /*
113  * add tls:// prefix, if tls is used.
114  * No need to check for openssl.
115  * User can't use SquirrelMail if this part is misconfigured
116  */
117 if ($use_imap_tls == true) $imapServerAddress = 'tls://' . $imapServerAddress;
118 
119 $imap_stream = fsockopen ($imapServerAddress, $imapPort, $error_number, $error_string);
120 $server_info = fgets ($imap_stream, 1024);
121 if ($imap_stream) {
122  // SUPRESS HOST NAME
123  $list = explode(' ', $server_info);
124  $list[2] = '[HIDDEN]';
125  $server_info = implode(' ', $list);
126  $body .= " Server info: $server_info";
127  fputs ($imap_stream, "a001 CAPABILITY\r\n");
128  $read = fgets($imap_stream, 1024);
129  $list = explode(' ', $read);
130  array_shift($list);
131  array_shift($list);
132  $read = implode(' ', $list);
133  $body .= " Capabilities: $read";
134  fputs ($imap_stream, "a002 LOGOUT\r\n");
135  fclose($imap_stream);
136 } else {
137  $body .= " Unable to connect to IMAP server to get information.\n";
138  $warning = 1;
139  $warnings['imap'] = "Unable to connect to IMAP server";
140  $corrections['imap'][] = "Make sure you specified the correct mail server";
141  $corrections['imap'][] = "Make sure the mail server is running IMAP, not POP";
142  $corrections['imap'][] = "Make sure the server responds to port $imapPort";
143 }
146 if (isset($warning) && $warning) {
147  foreach ($warnings as $key => $value) {
148  if ($warning_num == 0) {
149  $body_top .= "WARNINGS WERE REPORTED WITH YOUR SETUP:\n";
150  $body_top = "WARNINGS WERE REPORTED WITH YOUR SETUP -- SEE BELOW\n\n$body_top";
151  $warning_html = "<h1>Warnings were reported with your setup:</h1>\n<dl>\n";
152  }
153  $warning_num ++;
154  $warning_html .= "<dt><b>$value</b></dt>\n";
155  $body_top .= "\n$value\n";
156  foreach ($corrections[$key] as $corr_val) {
157  $body_top .= " * $corr_val\n";
158  $warning_html .= "<dd>* $corr_val</dd>\n";
159  }
160  }
161  $warning_html .= "</dl>\n<p>$warning_num warning(s) reported.</p>\n<hr />\n";
162  $body_top .= "\n$warning_num warning(s) reported.\n";
163  $body_top .= "----------------------------------------------\n";
164 }
165 
166 $body = htmlspecialchars($body_top . $body);
167 
168 ?>
169  <br />
170  <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0"><tr>
171  <?php echo html_tag('td','<b>'._("Submit a Bug Report").'</b>','center',$color[0]); ?>
172  </tr></table>
173 
174 <?php
175 echo $warning_html;
176 
177 echo '<p><big>';
178 echo _("Before you send your bug report, please make sure to check this checklist for any common problems.");
179 echo "</big></p>\n";
180 
181 echo '<ul>';
182 echo '<li>';
183 printf(_("Make sure that you are running the most recent copy of %s. You are currently using version %s."), '<a href="http://squirrelmail.org/" target="_blank">SquirrelMail</a>', $version);
184 echo "</li>\n";
185 
186 echo '<li>';
187 printf(_("Check to see if your bug is already listed in the %sBug List%s on SourceForge. If it is, we already know about it and are trying to fix it."), '<a href="http://sourceforge.net/bugs/?group_id=311" target="_blank">', '</a>');
188 echo "</li>\n";
189 
190 echo '<li>';
191 echo _("Try to make sure that you can repeat it. If the bug happens sporatically, try to document what you did when it happened. If it always occurs when you view a specific message, keep that message around so maybe we can see it.");
192 echo "</li>\n";
193 
194 echo '<li>';
195 printf(_("If there were warnings displayed above, try to resolve them yourself. Read the guides in the %s directory where SquirrelMail was installed."), '<tt>doc/</tt>');
196 echo "</li>\n";
197 echo "</ul>\n";
198 
199 echo '<p>';
200 echo _("Pressing the button below will start a mail message to the developers of SquirrelMail that will contain a lot of information about your system, your browser, how SquirrelMail is set up, and your IMAP server. It will also prompt you for information. Just fill out the sections at the top. If you like, you can scroll down in the message to see what else is being sent.");
201 echo "</p>\n";
202 
203 echo '<p>';
204 echo _("Please make sure to fill out as much information as you possibly can to give everyone a good chance of finding and removing the bug. Submitting your bug like this will not have it automatically added to the bug list on SourceForge, but someone who gets your message may add it for you.");
205 echo "</p>\n";
206 ?>
207  <form action="../../src/compose.php" method=post>
208  <table align="center" border="0">
209  <tr>
210  <td>
211  <?php echo _("This bug involves:"); ?> <select name="send_to">
212  <option value="squirrelmail-users@lists.sourceforge.net"><?php
213  echo _("the general program"); ?></option>
214  <option value="squirrelmail-plugins@lists.sourceforge.net"><?php
215  echo _("a specific plugin"); ?></option>
216  </select>
217  </td>
218  </tr>
219  <tr>
220  <td align="center">
221 <?php
222 echo addHidden("send_to_cc","");
223 echo addHidden("send_to_bcc","");
224 echo addHidden("subject","Bug Report");
225 echo addHidden("body",$body);
226 echo addSubmit(_("Start Bug Report Form"));
227 ?>
228  </td>
229  </tr>
230  </table>
231  </form>
232  </body>
233 </html>
plain_error_message
plain_error_message($message, $color)
Definition: display_messages.php:40
$body
if(isset($ldap_server) && $ldap_server[0] &&! extension_loaded('ldap')) $body
Definition: bug_report.php:106
sqgetGlobalVar
sqgetGlobalVar($name, &$value, $search=SQ_INORDER)
Definition: global.php:344
html_tag
html_tag( $tag, $val='', $align='', $bgcolor='', $xtra='')
Definition: html.php:27
$color
global $color
Definition: bug_report.php:26
$imap_stream
$imap_stream
Definition: bug_report.php:119
displayPageHeader
displayPageHeader($color, $mailbox, $xtra='', $session=false)
Definition: page_header.php:105
$browscap
$browscap
Definition: bug_report.php:59
html
Definition: html.class.php:18
$use_imap_tls
$use_imap_tls
Definition: config_default.php:240
$username
global $username
Definition: validate.php:55
$imapServerAddress
$imapServerAddress
Definition: bug_report.php:110
sqimap_get_user_server
sqimap_get_user_server($imap_server, $username)
Definition: imap_general.php:1001
$warning
$warning
Definition: bug_report.php:138
$warning_num
$warning_num
Definition: bug_report.php:145
$list
$list
Definition: options.php:60
$body_top
$body_top
Definition: bug_report.php:68
addSubmit
addSubmit($value, $name=null, $extra_attributes='')
Definition: forms.php:112
Show_Array
Show_Array($array)
Definition: bug_report.php:46
addHidden
addHidden($name, $value)
Definition: forms.php:58
$warnings
$warnings['imap']
Definition: bug_report.php:139
SQ_SERVER
const SQ_SERVER
Definition: global.php:20
exit
exit
Definition: help.php:128
_
_($str)
Definition: gettext.php:160
$read
$read
Definition: message_details_bottom.php:75
$version
global $version
Definition: config_default.php:26
SM_PATH
const SM_PATH
Definition: bug_report.php:24
$imapPort
$imapPort
Definition: config_default.php:210
$server_info
$server_info
Definition: bug_report.php:120
$warning_html
$warning_html
Definition: bug_report.php:144
$plugins
global $plugins
Definition: bug_report.php:26
$corrections
$corrections['imap'][]
Definition: bug_report.php:140