X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fbug_report%2Fbug_report.php;h=2e4354c12f459b3811102bccbe560d8093c4aa3c;hp=bf398944edd73d4eb36e7a04b950439f1c161ec3;hb=c69bc63529c64510bdccbfb74bfcecc1d9d0d07b;hpb=7a0d72ee11f06b834a39576063225d287c44bbae diff --git a/plugins/bug_report/bug_report.php b/plugins/bug_report/bug_report.php index bf398944..2e4354c1 100644 --- a/plugins/bug_report/bug_report.php +++ b/plugins/bug_report/bug_report.php @@ -1,5 +1,4 @@ $value) { - if ($key != 0 || $value != '') { - $str .= " * $key = $value\n"; - } - } - if ($str == '') { - return " * Nothing listed\n"; - } - return $str; -} -$browser = get_browser(); -$body_top .= "I subscribe to the squirrelmail-list mailing list.\n" . - " [ ] True - No need to CC me when replying\n" . - " [ ] False - Please CC me when replying\n" . - "\n" . - "This bug occurs when I ...\n" . - " ... view a particular message\n" . - " ... use a specific plugin/function\n" . - " ... try to do/view/use ....\n" . - "\n\n\n" . - "The description of the bug:\n\n\n" . - "I can reproduce the bug by:\n\n\n" . - "(Optional) I got bored and found the bug occurs in:\n\n\n" . - "(Optional) I got really bored and here's a fix:\n\n\n" . - "----------------------------------------------\n" . - "\nMy browser information:\n" . - " $HTTP_USER_AGENT\n" . - " get_browser() information (List)\n" . - Show_Array((array) $browser) . - "\nMy web server information:\n" . - " PHP Version " . phpversion() . "\n" . - " PHP Extensions (List)\n" . - Show_Array(get_loaded_extensions()) . - "\nSquirrelMail-specific information:\n" . - " Version: $version\n" . - " Plugins (List)\n" . - Show_Array($plugins); -if ($ldap_server[0] && ! extension_loaded('ldap')) { - $warning = 1; - $warnings['ldap'] = "LDAP server defined in SquirrelMail config, " . - "but the module is not loaded in PHP"; - $corrections['ldap'][] = "Reconfigure PHP with the option '--with-ldap'"; - $corrections['ldap'][] = "Then recompile PHP and reinstall"; - $corrections['ldap'][] = "-- OR --"; - $corrections['ldap'][] = "Reconfigure SquirrelMail to not use LDAP"; -} +// This is the bug_report options page +// +define('PAGE_NAME', 'bug_report_options'); + + +// Include the SquirrelMail initialization file. +// +require('../../include/init.php'); -$body .= "\nMy IMAP server information:\n" . - " Server type: $imap_server_type\n"; -$imap_stream = fsockopen ($imapServerAddress, $imapPort, $error_number, $error_string); -$server_info = fgets ($imap_stream, 1024); -if ($imap_stream) { - // SUPRESS HOST NAME - $list = explode(' ', $server_info); - $list[2] = '[HIDDEN]'; - $server_info = implode(' ', $list); - $body .= " Server info: $server_info"; - fputs ($imap_stream, "a001 CAPABILITY\r\n"); - $read = fgets($imap_stream, 1024); - $list = explode(' ', $read); - array_shift($list); - array_shift($list); - $read = implode(' ', $list); - $body .= " Cabailities: $read"; - fputs ($imap_stream, "a002 LOGOUT\r\n"); - fclose($imap_stream); -} else { - $body .= " Unable to connect to IMAP server to get information.\n"; - $warning = 1; - $warnings['imap'] = "Unable to connect to IMAP server"; - $corrections['imap'][] = "Make sure you specified the correct mail server"; - $corrections['imap'][] = "Make sure the mail server is running IMAP, not POP"; - $corrections['imap'][] = "Make sure the server responds to port $imapPort"; + +// load plugin functions +// +require_once(SM_PATH . 'plugins/bug_report/functions.php'); + + +displayPageHeader($color); + + +// error out when bug_report plugin is disabled +// or is called by the wrong user +// +if (! is_plugin_enabled('bug_report') || ! bug_report_check_user()) { + error_box(_("Plugin is disabled.")); + $oTemplate->display('footer.tpl'); + exit(); } -$warning_num = 0; -if ($warning) { - foreach ($warnings as $key => $value) { - if ($warning_num == 0) { - $body_top .= "WARNINGS WERE REPORTED WITH YOUR SETUP:\n"; - $body_top = "WARNINGS WERE REPORTED WITH YOUR SETUP -- SEE BELOW\n\n$body_top"; - $warning_html = "

Warnings were reported with your setup:

\n
\n"; - } - $warning_num ++; - $warning_html .= "
$value
\n"; - $body_top .= "\n$value\n"; - foreach ($corrections[$key] as $corr_val) { - $body_top .= " * $corr_val\n"; - $warning_html .= "
* $corr_val
\n"; - } - } - $warning_html .= "
\n

$warning_num warning(s) reported.

\n
\n"; - $body_top .= "\n$warning_num warning(s) reported.\n"; - $body_top .= "----------------------------------------------\n"; + +// get system specs +// +require_once(SM_PATH . 'plugins/bug_report/system_specs.php'); +list($body, $warnings, $corrections) = get_system_specs(); + +$body_top = "I am subscribed to the this mailing list.\n" . + " (applies when you are sending email to SquirrelMail mailing list)\n". + " [ ] True - No need to CC me when replying\n" . + " [ ] False - Please CC me when replying\n" . + "\n" . + "This bug occurs when I ...\n" . + " ... view a particular message\n" . + " ... use a specific plugin/function\n" . + " ... try to do/view/use ....\n" . + "\n\n\n" . + "The description of the bug:\n\n\n" . + "I can reproduce the bug by:\n\n\n" . + "(Optional) I got bored and found the bug occurs in:\n\n\n" . + "(Optional) I got really bored and here's a fix:\n\n\n" . + "----------------------------------------------\n\n"; + +$body = $body_top . $body; + +global $oTemplate, $bug_report_admin_email; +if (!empty($bug_report_admin_email)) { + $oTemplate->assign('admin_email', $bug_report_admin_email); } +$oTemplate->assign('message_body', $body); +$oTemplate->assign('title_bg_color', $color[0]); +$oTemplate->assign('warning_messages', $warnings); +$oTemplate->assign('correction_messages', $corrections); +$oTemplate->assign('warning_count', sizeof($warnings)); +$oTemplate->assign('version', SM_VERSION); +$oTemplate->display('plugins/bug_report/usage.tpl'); +$oTemplate->display('footer.tpl'); -$body = htmlspecialchars($body_top . $body); - -?> -
-
-
Submit a Bug Report
-
- - - -

Before you send your bug report, please make sure to - check this checklist for any common problems.

- - - -

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.

- -

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.

- -
- - - - - - - -
- This bug involves: -
- - - - - -
-
-