added display of plugin versions to bug report.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Mar 2005 13:02:18 +0000 (13:02 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Mar 2005 13:02:18 +0000 (13:02 +0000)
added doctype to independent spec. page. Page needs some security test,
that prevents access to it, when bug_report plugin is not enabled.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8958 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/bug_report/show_system_specs.php
plugins/bug_report/system_specs.php

index 7184f722c0eb2088171aeaf604eeb2262c9e21eb..8f856939a47b1dffea1ba7613370bb4a2f36d9ce 100644 (file)
@@ -20,6 +20,7 @@ define('SM_PATH','../../');
 include_once(SM_PATH . 'include/validate.php');
 
 ?>
 include_once(SM_PATH . 'include/validate.php');
 
 ?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <body>
 <pre>
 <html>
 <body>
 <pre>
index 2ca2217cdc7158d3cb4d453e24ca06588208af68..5783e3e7f397391ef2129dd2e89f7d3e182109b5 100644 (file)
@@ -40,6 +40,42 @@ function Show_Array($array) {
     return $str;
 }
 
     return $str;
 }
 
+/**
+ * converts plugin's array to string and adds version numbers
+ * @return string preformated text with installed plugin's information
+ * @access private
+ */
+function br_show_plugins() {
+    global $plugins;
+    $str = '';
+    if (is_array($plugins) && $plugins!=array()) {
+        foreach ($plugins as $key => $value) {
+            if ($key != 0 || $value != '') {
+                $str .= "    * $key = $value";
+                // add plugin version
+                if (function_exists($value . '_version')) {
+                    $str.= ' ' . call_user_func($value . '_version');
+                }
+                $str.="\n";
+            }
+        }
+        // compatibility plugin can be used without need to enable it in sm config
+        if (file_exists(SM_PATH . 'plugins/compatibility/setup.php') 
+            && ! in_array('compatibility',$plugins)) {
+            $str.= '    * compatibility';
+            include_once(SM_PATH . 'plugins/compatibility/setup.php');
+            if (function_exists('compatibility_version')) {
+                $str.= ' ' . call_user_func('compatibility_version');
+            }
+            $str.="\n";
+        }
+    }
+    if ($str == '') {
+        return "    * Nothing listed\n";
+    }
+    return $str;
+}
+
 $browscap = ini_get('browscap');
 if(!empty($browscap)) {
     $browser = get_browser();
 $browscap = ini_get('browscap');
 if(!empty($browscap)) {
     $browser = get_browser();
@@ -62,7 +98,7 @@ $body_top = "My browser information:\n" .
             "\nSquirrelMail-specific information:\n" .
             "  Version:  $version\n" .
             "  Plugins (List)\n" .
             "\nSquirrelMail-specific information:\n" .
             "  Version:  $version\n" .
             "  Plugins (List)\n" .
-            Show_Array($plugins);
+            br_show_plugins();
 if (isset($ldap_server) && $ldap_server[0] && ! extension_loaded('ldap')) {
     $warning = 1;
     $warnings['ldap'] = "LDAP server defined in SquirrelMail config, " .
 if (isset($ldap_server) && $ldap_server[0] && ! extension_loaded('ldap')) {
     $warning = 1;
     $warnings['ldap'] = "LDAP server defined in SquirrelMail config, " .