+/**
+ * spamcop.php -- SpamCop plugin -- main page
+ *
+ * @copyright 1999-2014 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage spamcop
+ */
+
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../../include/init.php');
+/* IMAP functions depend on date and mime */
+include_once(SM_PATH . 'functions/date.php');
+include_once(SM_PATH . 'functions/mime.php');
+/* IMAP functions */
+include_once(SM_PATH . 'functions/imap_general.php');
+include_once(SM_PATH . 'functions/imap_messages.php');
+/* plugin functions */
+include_once(SM_PATH . 'plugins/spamcop/functions.php');
+
+include_once(SM_PATH . 'functions/compose.php');
+
+/* GLOBALS */
+
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
+sqgetGlobalVar('js_web', $js_web, SQ_GET);
+
+if (! sqgetGlobalVar('startMessage', $startMessage, SQ_GET) ) {
+ $startMessage = 1;
+}
+if (! sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) {
+ $passed_ent_id = 0;
+}
+if (! sqgetGlobalVar('js_web', $js_web, SQ_GET) ) {
+ $js_web = 0;
+}
+
+sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
+
+if(! sqgetGlobalVar('composesession', $composesession, SQ_SESSION) ) {
+ $composesession = 0;
+ sqsession_register($composesession, 'composesession');
+}
+/* END GLOBALS */
+
+// js_web variable is 1 only when link opens web based report page in new window
+// and in new window menu line or extra javascript code is not needed.
+if ($js_web) {
+ displayHTMLHeader(_("SpamCop reporting"));
+ echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n";
+} else {
+ displayPageHeader($color,$mailbox);
+}
+
+/** is spamcop plugin disabled */
+if (! is_plugin_enabled('spamcop')) {
+ error_box(_("Plugin is disabled."));
+ // display footer (closes html tags) and stop script execution
+ $oTemplate->display('footer.tpl');
+ exit();
+}
+
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);