X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fmail_fetch%2Ffetch.php;h=e902182c9838f3715b1ace77cba5cb9ee599e0b4;hp=45807588ae1b202413755fd1190e6a2c760a7ef4;hb=5c89bd6391d2c9527db3145a7b0e8cf9b3190008;hpb=25e2a90e8475917695a1da7453685d13a22c10eb
diff --git a/plugins/mail_fetch/fetch.php b/plugins/mail_fetch/fetch.php
index 45807588..e902182c 100644
--- a/plugins/mail_fetch/fetch.php
+++ b/plugins/mail_fetch/fetch.php
@@ -3,304 +3,324 @@
/**
* 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$
+ * @version $Id$
+ * @package plugins
+ * @subpackage mail_fetch
*/
+/** @ignore */
define('SM_PATH','../../');
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 . 'include/load_prefs.php');
-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 */
+include_once(SM_PATH . 'functions/imap.php');
+include_once(SM_PATH . 'plugins/mail_fetch/class.POP3.php');
+include_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
+
+/* globals */
sqgetGlobalVar('username', $username, SQ_SESSION);
sqgetGlobalVar('key', $key, SQ_COOKIE);
sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
/* end globals */
- function Mail_Fetch_Status($msg) {
- echo html_tag( 'table',
- html_tag( 'tr',
- html_tag( 'td', htmlspecialchars( $msg ) , 'left' )
- ),
- '', '', 'width="90%"' );
- flush();
+function Mail_Fetch_Status($msg) {
+ echo html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', htmlspecialchars( $msg ) , 'left' )
+ ),
+ '', '', 'width="90%"' );
+ flush();
+}
+
+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;
}
-
- function Mail_Fetch_Servers() {
- $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[$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']);
}
- $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'];
- }
+ if ($mailfetch[$i]['pass'] == '') {
+ sqgetGlobalVar("pass_$i", $mailfetch[$i]['pass'], SQ_POST);
}
- return $mailfetch;
- }
-
- function Mail_Fetch_Select_Server($mailfetch) {
- echo '
' .
- "
' . _("No POP3 servers configured yet.") . '
'; + displayInternalLink('plugins/mail_fetch/options.php', + _("Click here to go to the options page.") ); + echo '