display disabled,TLS,STARTTLS instead of 0,1,2 in menu
[squirrelmail.git] / plugins / mail_fetch / functions.php
index 6b3d9a2eee894d28040762ade85d42f11fb3e34e..8022396751ae5b55ce8791437ff6cb8a75df5b55 100644 (file)
@@ -1,23 +1,21 @@
 <?php
+
 /**
  * mail_fetch/functions.php
  *
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
  * Functions for the mail_fetch plugin.
  *
  * Original code from LexZEUS <lexzeus@mifinca.com>
  * and josh@superfork.com (extracted from php manual)
  * Adapted for MailFetch by Philippe Mingo <mingo@rotedic.com>
  *
+ * @copyright &copy; 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  * @subpackage mail_fetch
  */
 
-/** @ignore */
-if (! defined('SM_PATH')) define('SM_PATH','../../');
 
 /** pop3 class */
 include_once (SM_PATH . 'plugins/mail_fetch/class.POP3.php');
@@ -81,9 +79,9 @@ function  mail_fetch_load_pref_function() {
  * @private
  */
 function mail_fetch_login_function() {
-    include_once (SM_PATH . 'include/validate.php');
-    include_once (SM_PATH . 'functions/imap.php');
-    
+    //include_once (SM_PATH . 'include/validate.php');
+    include_once (SM_PATH . 'functions/imap_general.php');
+
     global $data_dir, $imapServerAddress, $imapPort;
 
     sqgetGlobalVar('username', $username, SQ_SESSION);
@@ -134,7 +132,7 @@ function mail_fetch_login_function() {
             $pop3 = new POP3($mailfetch_server, 60);
 
             if (!$pop3->connect($mailfetch_server,$mailfetch_port)) {
-                $outMsg .= _("Warning, ") . $pop3->ERROR;
+                $outMsg .= _("Warning:") . ' ' . $pop3->ERROR;
                 continue;
             }
 
@@ -142,7 +140,7 @@ function mail_fetch_login_function() {
 
             $Count = $pop3->login($mailfetch_user, $mailfetch_pass);
             if (($Count == false || $Count == -1) && $pop3->ERROR != '') {
-                $outMsg .= _("Login Failed:") . $pop3->ERROR;
+                $outMsg .= _("Login Failed:") . ' ' . $pop3->ERROR;
                 continue;
             }
 
@@ -180,7 +178,7 @@ function mail_fetch_login_function() {
                 $MessArray = $pop3->get($i);
 
                 if ( (!$MessArray) or (gettype($MessArray) != "array")) {
-                    $outMsg .= _("Warning, ") . $pop3->ERROR;
+                    $outMsg .= _("Warning:") . ' ' . $pop3->ERROR;
                     continue 2;
                 }
 
@@ -232,9 +230,6 @@ function mail_fetch_login_function() {
 function mail_fetch_setnew_function() {
     global $data_dir;
 
-    // FIXME: check if function is already loaded in login_verified hook
-    include_once(SM_PATH . 'functions/prefs.php');
-
     sqgetGlobalVar('username', $username, SQ_SESSION);
     setPref( $data_dir, $username, 'mailfetch_newlog', 'on' );
 }
@@ -256,7 +251,7 @@ function mailfetch_optpage_register_block_function() {
 }
 
 /**
- * Internal function used to update mail_fetch settings 
+ * Internal function used to update mail_fetch settings
  * when folders are renamed or deleted.
  * @since 1.5.1
  * @private
@@ -400,4 +395,3 @@ function mail_fetch_check_noselect($imap_stream,$imap_folder) {
     }
     return false;
 }
-?>
\ No newline at end of file