- /**
- ** mail_fetch/setup.php
- **
- ** Copyright (c) 1999-2002 The SquirrelMail Project Team
- ** Licensed under the GNU GPL. For full terms see the file COPYING.
- **
- ** Setup of the mailfetch plugin.
- **
- ** $Id$
- **/
-
- require_once( '../plugins/mail_fetch/functions.php' );
-
- function squirrelmail_plugin_init_mail_fetch() {
- global $squirrelmail_plugin_hooks;
- global $mailbox, $imap_stream, $imapConnection;
-
- $squirrelmail_plugin_hooks['menuline']['mail_fetch'] = 'mail_fetch_link';
- $squirrelmail_plugin_hooks['loading_prefs']['mail_fetch'] = 'mail_fetch_load_pref';
- $squirrelmail_plugin_hooks['login_verified']['mail_fetch'] = 'mail_fetch_setnew';
- $squirrelmail_plugin_hooks['left_main_before']['mail_fetch'] = 'mail_fetch_login';
- $squirrelmail_plugin_hooks['optpage_register_block']['mail_fetch'] = 'mailfetch_optpage_register_block';
-
- }
-
- function mail_fetch_link() {
-
- displayInternalLink('plugins/mail_fetch/fetch.php', _("Fetch"), '');
- echo ' ';
-
- }
-
- function mail_fetch_load_pref() {
-
- global $username,$data_dir;
- global $mailfetch_server_number;
- global $mailfetch_cypher;
- global $mailfetch_server_,$mailfetch_alias_,$mailfetch_user_,$mailfetch_pass_;
- global $mailfetch_lmos_, $mailfetch_uidl_, $mailfetch_login_, $mailfetch_fref_;
- global $PHP_SELF;
-
- if( stristr( $PHP_SELF, 'mail_fetch' ) ) {
- $mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number', 0);
- $mailfetch_cypher = getPref($data_dir, $username, 'mailfetch_cypher', 'on' );
- if ($mailfetch_server_number<1) $mailfetch_server_number=0;
- for ($i=0;$i<$mailfetch_server_number;$i++) {
- $mailfetch_server_[$i] = getPref($data_dir, $username, "mailfetch_server_$i");
- $mailfetch_alias_[$i] = getPref($data_dir, $username, "mailfetch_alias_$i");
- $mailfetch_user_[$i] = getPref($data_dir, $username, "mailfetch_user_$i");
- $mailfetch_pass_[$i] = getPref($data_dir, $username, "mailfetch_pass_$i");
- $mailfetch_lmos_[$i] = getPref($data_dir, $username, "mailfetch_lmos_$i");
- $mailfetch_login_[$i] = getPref($data_dir, $username, "mailfetch_login_$i");
- $mailfetch_fref_[$i] = getPref($data_dir, $username, "mailfetch_fref_$i");
- $mailfetch_uidl_[$i] = getPref($data_dir, $username, "mailfetch_uidl_$i");
- if( $mailfetch_cypher == 'on' ) $mailfetch_pass_[$i] = decrypt( $mailfetch_pass_[$i] );
- }
+/**
+ * mail_fetch/setup.php
+ *
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Setup of the mailfetch plugin.
+ *
+ * @version $Id$
+ * @package plugins
+ * @subpackage mail_fetch
+ */
+
+/** */
+require_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
+
+/**
+ * Initialize the plugin
+ */
+function squirrelmail_plugin_init_mail_fetch() {
+ global $squirrelmail_plugin_hooks;
+
+ $squirrelmail_plugin_hooks['menuline']['mail_fetch'] = 'mail_fetch_link';
+ $squirrelmail_plugin_hooks['loading_prefs']['mail_fetch'] = 'mail_fetch_load_pref';
+ $squirrelmail_plugin_hooks['login_verified']['mail_fetch'] = 'mail_fetch_setnew';
+ $squirrelmail_plugin_hooks['left_main_before']['mail_fetch'] = 'mail_fetch_login';
+ $squirrelmail_plugin_hooks['optpage_register_block']['mail_fetch'] = 'mailfetch_optpage_register_block';
+
+}
+
+function mail_fetch_link() {
+
+ displayInternalLink('plugins/mail_fetch/fetch.php', _("Fetch"), '');
+ echo ' ';
+
+}
+
+function mail_fetch_load_pref() {
+
+ global $data_dir;
+ global $mailfetch_server_number;
+ global $mailfetch_cypher, $mailfetch_port_;
+ global $mailfetch_server_,$mailfetch_alias_,$mailfetch_user_,$mailfetch_pass_;
+ global $mailfetch_lmos_, $mailfetch_uidl_, $mailfetch_login_, $mailfetch_fref_;
+ global $PHP_SELF;
+
+ sqgetGlobalVar('username', $username, SQ_SESSION);
+
+ if( stristr( $PHP_SELF, 'mail_fetch' ) ) {
+ $mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number', 0);
+ $mailfetch_cypher = getPref($data_dir, $username, 'mailfetch_cypher', 'on' );
+ if ($mailfetch_server_number<1) $mailfetch_server_number=0;
+ for ($i=0;$i<$mailfetch_server_number;$i++) {
+ $mailfetch_server_[$i] = getPref($data_dir, $username, "mailfetch_server_$i");
+ $mailfetch_port_[$i] = getPref($data_dir, $username, "mailfetch_port_$i");
+ $mailfetch_alias_[$i] = getPref($data_dir, $username, "mailfetch_alias_$i");
+ $mailfetch_user_[$i] = getPref($data_dir, $username, "mailfetch_user_$i");
+ $mailfetch_pass_[$i] = getPref($data_dir, $username, "mailfetch_pass_$i");
+ $mailfetch_lmos_[$i] = getPref($data_dir, $username, "mailfetch_lmos_$i");
+ $mailfetch_login_[$i] = getPref($data_dir, $username, "mailfetch_login_$i");
+ $mailfetch_fref_[$i] = getPref($data_dir, $username, "mailfetch_fref_$i");
+ $mailfetch_uidl_[$i] = getPref($data_dir, $username, "mailfetch_uidl_$i");
+ if( $mailfetch_cypher == 'on' ) $mailfetch_pass_[$i] = decrypt( $mailfetch_pass_[$i] );