New get_plugin_version() function, and a couple places to use it.
[squirrelmail.git] / plugins / bug_report / setup.php
index 3247ba4d5041983d44d9051d88d44f2190916ecf..9c1d3ddec2a0dfea6161e19d69743bc93decfe04 100644 (file)
@@ -1,11 +1,8 @@
 <?php
-
 /**
- * setup.php
- *
- * This is a standard SquirrelMail 1.2 API for plugins.
+ * Bug Report plugin - setup script
  *
- * @copyright &copy; 1999-2005 The SquirrelMail Project Team
+ * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -31,9 +28,10 @@ function squirrelmail_plugin_init_bug_report() {
  * @access private
  */
 function bug_report_button() {
+    include_once(SM_PATH.'plugins/bug_report/functions.php');
     global $bug_report_visible;
 
-    if (! $bug_report_visible) {
+    if (! $bug_report_visible || ! bug_report_check_user()) {
         return;
     }
 
@@ -58,19 +56,20 @@ function bug_report_load() {
  * @access private
  */
 function bug_report_block() {
-    global $optpage_data;
-    $optpage_data['grps']['bug_report'] = _("Bug Reports");
-    $optionValues = array();
-    // FIXME: option needs refresh in SMOPT_REFRESH_RIGHT 
-    // (menulink is processed before options are saved/loaded)
-    $optionValues[] = array(
-        'name'    => 'bug_report_visible',
-        'caption' => _("Show button in toolbar"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_ALL,
-        'initial_value' => false
-        );
-    $optpage_data['vals']['bug_report'] = $optionValues;
+    include_once(SM_PATH.'plugins/bug_report/functions.php');
+    if (bug_report_check_user()) {
+        global $optpage_data;
+        $optpage_data['grps']['bug_report'] = _("Bug Reports");
+        $optionValues = array();
+        // FIXME: option needs refresh in SMOPT_REFRESH_RIGHT 
+        // (menulink is processed before options are saved/loaded)
+        $optionValues[] = array(
+            'name'    => 'bug_report_visible',
+            'caption' => _("Show button in toolbar"),
+            'type'    => SMOPT_TYPE_BOOLEAN,
+            'refresh' => SMOPT_REFRESH_ALL,
+            'initial_value' => false
+            );
+        $optpage_data['vals']['bug_report'] = $optionValues;
+    }
 }
-
-?>
\ No newline at end of file