Adding FIXME to comment
[squirrelmail.git] / functions / plugin.php
index 54c85e4f456f8dc676c120b441f615349a053320..adf98accea725bfe8dc001ff896a72d7b7a0eb72 100644 (file)
  *
  * Documentation on how to write plugins might show up some time.
  *
- * $Id$
+ * @version $Id$
  * @package squirrelmail
  */
 
 /** Everything needs global.. */
 require_once(SM_PATH . 'functions/global.php');
+require_once(SM_PATH . 'functions/prefs.php');
 
 global $squirrelmail_plugin_hooks;
 $squirrelmail_plugin_hooks = array();
@@ -169,21 +170,13 @@ function boolean_hook_function($name,$parm=NULL,$priority=0,$tie=false) {
  * This function checks whether the user's USER_AGENT is known to
  * be broken. If so, returns true and the plugin is invisible to the
  * offending browser.
- * This function needs to have its name changed!
+ * *** THIS IS A TEST FOR JAVASCRIPT SUPPORT ***
+ * FIXME: This function needs to have its name changed!
  *
  * @return bool whether this browser properly supports JavaScript
  */
 function soupNazi(){
-
-    $soup_menu = array('Mozilla/3','Mozilla/2','Mozilla/1', 'Opera 4',
-                       'Opera/4', 'OmniWeb', 'Lynx');
-    sqgetGlobalVar('HTTP_USER_AGENT', $user_agent, SQ_SERVER);
-    foreach($soup_menu as $browser) {
-        if(stristr($user_agent, $browser)) {
-            return 1;
-        }
-    }
-    return 0;
+    return !checkForJavascript();
 }
 /*************************************/
 /*** MAIN PLUGIN LOADING CODE HERE ***/
@@ -196,4 +189,4 @@ if (isset($plugins) && is_array($plugins)) {
     }
 }
 
-?>
+?>
\ No newline at end of file