X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fmail_fetch%2Ffetch.php;h=95bb9b57354e8e2a77ffdc4e80da3c0d9ba99125;hp=ecfdad68e06f9ca6f574aaa329db3751e1895116;hb=3d8a60fb4803e3d965716b04e60a8733aeca4a71;hpb=47ccfad452e8d345542d09e59112cac317cffed8
diff --git a/plugins/mail_fetch/fetch.php b/plugins/mail_fetch/fetch.php
index ecfdad68..95bb9b57 100644
--- a/plugins/mail_fetch/fetch.php
+++ b/plugins/mail_fetch/fetch.php
@@ -5,28 +5,33 @@
*
* Fetch code.
*
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright © 1999-2009 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package plugins
* @subpackage mail_fetch
*/
-/** @ignore */
-define('SM_PATH','../../');
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../../include/init.php');
-require_once(SM_PATH . 'include/validate.php');
-include_once(SM_PATH . 'functions/imap.php');
-include_once(SM_PATH . 'plugins/mail_fetch/class.POP3.php');
+include_once(SM_PATH . 'functions/imap_general.php');
include_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
+// don't load this page if this plugin is not enabled
+//
+global $plugins;
+if (!in_array('mail_fetch', $plugins)) exit;
+
/* globals */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
/* end globals */
+/**
+ * @param string $msg mail
+ */
function Mail_Fetch_Status($msg) {
echo html_tag( 'table',
html_tag( 'tr',
@@ -36,14 +41,19 @@ function Mail_Fetch_Status($msg) {
flush();
}
+/**
+ * @return array
+ */
function Mail_Fetch_Servers() {
global $data_dir, $username;
+ $mailfetch = array();
$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");
@@ -63,10 +73,17 @@ function Mail_Fetch_Servers() {
if($mailfetch[$i]['alias'] == '') {
$mailfetch[$i]['alias'] == $mailfetch[$i]['server'];
}
+ // Authentication type (added in 1.5.2)
+ $mailfetch[$i]['auth'] = getPref($data_dir, $username, "mailfetch_auth_$i",MAIL_FETCH_AUTH_USER);
+ // Connection type (added in 1.5.2)
+ $mailfetch[$i]['type'] = getPref($data_dir, $username, "mailfetch_type_$i",MAIL_FETCH_USE_PLAIN);
}
- return $mailfetch;
+ return $mailfetch;
}
+/**
+ * @param array $mailfetch
+ */
function Mail_Fetch_Select_Server($mailfetch) {
global $PHP_SELF;
@@ -107,9 +124,9 @@ function Mail_Fetch_Select_Server($mailfetch) {
}
$mailfetch = Mail_Fetch_Servers();
-displayPageHeader($color, 'None');
+displayPageHeader($color);
-echo '
' . _("No POP3 servers configured yet.") . '
'; - displayInternalLink('plugins/mail_fetch/options.php', + echo makeInternalLink('plugins/mail_fetch/options.php', _("Click here to go to the options page.") ); - echo '