X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fmail_fetch%2Ffetch.php;h=898cecc0275c33c2f3c46c34e569af001278703d;hb=6c84ba1ec45ab854c37b6f65c5b4d84ab1c7aad4;hp=1ac19ee54ddc899ee7f70bf1228b1f10eed25907;hpb=22476f18b2ff4ae81fd4a52e9f335691e31b7750;p=squirrelmail.git
diff --git a/plugins/mail_fetch/fetch.php b/plugins/mail_fetch/fetch.php
index 1ac19ee5..898cecc0 100644
--- a/plugins/mail_fetch/fetch.php
+++ b/plugins/mail_fetch/fetch.php
@@ -3,14 +3,17 @@
/**
* mail_fetch/fetch.php
*
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Fetch code.
*
* $Id$
+ * @package plugins
+ * @subpackage mail_fetch
*/
+/** @ignore */
define('SM_PATH','../../');
require_once(SM_PATH . 'include/validate.php');
@@ -21,7 +24,7 @@ require_once(SM_PATH . 'plugins/mail_fetch/class.POP3.php');
require_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
require_once(SM_PATH . 'functions/html.php' );
-/* globals */
+/* globals */
sqgetGlobalVar('username', $username, SQ_SESSION);
sqgetGlobalVar('key', $key, SQ_COOKIE);
sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
@@ -37,55 +40,51 @@ sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
flush();
}
- displayPageHeader($color, 'None');
+ function Mail_Fetch_Servers() {
+ global $data_dir, $username;
- $mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number');
- if (!isset($mailfetch_server_number) || ($mailfetch_server_number < 1)) {
- $mailfetch_server_number = 0;
- }
- $mailfetch_cypher = getPref($data_dir, $username, 'mailfetch_cypher');
- 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");
- if($mailfetch_alias_[$i] == '') {
- $mailfetch_alias_[$i] = $mailfetch_server_[$i];
+ $mailfetch['server_number'] = getPref($data_dir, $username, "mailfetch_server_number");
+ if (!isset($mailfetch['server_number']) || ($mailfetch['server_number'] < 1)) {
+ $mailfetch['server_number'] = 0;
}
- $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_uidl_[$i] = getPref($data_dir, $username, "mailfetch_uidl_$i");
- $mailfetch_subfolder_[$i] = getPref($data_dir, $username, "mailfetch_subfolder_$i");
- if($mailfetch_cypher == 'on') {
- $mailfetch_pass_[$i] = decrypt( $mailfetch_pass_[$i] );
- }
- if ($mailfetch_pass_[$i] == '') {
- sqgetGlobalVar("pass_$i", $mailfetch_pass_[$i], SQ_POST);
+ $mailfetch['cypher'] = getPref($data_dir, $username, "mailfetch_cypher");
+ for ($i = 0; $i < $mailfetch['server_number']; $i++) {
+ $mailfetch[$i]['server'] = getPref($data_dir, $username, "mailfetch_server_$i");
+ $mailfetch[$i]['port'] = getPref($data_dir, $username, "mailfetch_port_$i");
+ $mailfetch[$i]['alias'] = getPref($data_dir, $username, "mailfetch_alias_$i");
+ $mailfetch[$i]['user'] = getPref($data_dir, $username, "mailfetch_user_$i");
+ $mailfetch[$i]['pass'] = getPref($data_dir, $username, "mailfetch_pass_$i");
+ if($mailfetch['cypher'] == 'on') {
+ $mailfetch[$i]['pass'] = decrypt($mailfetch[$i]['pass']);
+ }
+ if ($mailfetch[$i]['pass'] == '') {
+ sqgetGlobalVar("pass_$i", $mailfetch[$i]['pass'], SQ_POST);
+ }
+ $mailfetch[$i]['lmos'] = getPref($data_dir, $username, "mailfetch_lmos_$i");
+ $mailfetch[$i]['login'] = getPref($data_dir, $username, "mailfetch_login_$i");
+ $mailfetch[$i]['uidl'] = getPref($data_dir, $username, "mailfetch_uidl_$i");
+ $mailfetch[$i]['subfolder'] = getPref($data_dir, $username, "mailfetch_subfolder_$i");
+ if($mailfetch[$i]['alias'] == '') {
+ $mailfetch[$i]['alias'] == $mailfetch[$i]['server'];
+ }
}
+ return $mailfetch;
}
- echo '
' . _("No POP3 servers configured yet.") . '
'; + displayInternalLink('plugins/mail_fetch/options.php', + _("Click here to go to the options page.") ); + echo '