All this document.write stuff is overkill when we already have checkForJavascript...
[squirrelmail.git] / plugins / info / options.php
index 5489441e17d9e7a9b9cead3c176296b164508d70..79fa0d18ef8a8e9e9cdcb6112efd57407ba2943d 100644 (file)
@@ -6,20 +6,21 @@
  * This is where it all happens :)
  *
  * @author Jason Munro <jason at stdbev.com>
- * @copyright &copy; 1999-2006 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
  * @subpackage info
  */
 
-/** @ignore */
-define('SM_PATH','../../');
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
+require('../../include/init.php');
 
 /* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/page_header.php');
-require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/imap_general.php');
 require_once(SM_PATH . 'functions/forms.php');
 require_once(SM_PATH . 'plugins/info/functions.php');
 
@@ -34,16 +35,13 @@ $mailbox = 'INBOX';
  * prevent use of plugin if it is not enabled
  */
 if (! is_plugin_enabled('info')) {
-    error_box(_("Plugin is disabled."),$color);
-    echo '</body></html>';
+    error_box(_("Plugin is disabled."));
+    // display footer (closes html) and stop script execution
+    $oTemplate->display('footer.tpl');
     exit;
 }
 
 /* GLOBALS */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
-
 sqgetGlobalVar('submit', $submit, SQ_POST);
 
 for($i = 0; $i <= 9; $i++){
@@ -55,7 +53,7 @@ for($i = 0; $i <= 9; $i++){
 
 /* END GLOBALS */
 
-$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
 $caps_array = get_caps($imap_stream);
 $list = array ('TEST_0',
                'TEST_1',
@@ -205,6 +203,6 @@ sqimap_logout($imap_stream);
  *
  * Hook allows attaching plugin to bottom of info plugin
  */
-do_hook('info_bottom');
+do_hook('info_bottom', $null);
 ?>
-</body></html>
\ No newline at end of file
+</body></html>