display disabled,TLS,STARTTLS instead of 0,1,2 in menu
[squirrelmail.git] / plugins / mail_fetch / fetch.php
index 88de7464bc9c63f27964b13d02ac2abed91a0739..7bf720b14269536124b85bbfdfe2dfb3b196569f 100644 (file)
@@ -1,22 +1,23 @@
 <?php
+
 /**
  * mail_fetch/fetch.php
  *
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
  * Fetch code.
  *
+ * @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 */
-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 . 'functions/imap_general.php');
 include_once(SM_PATH . 'plugins/mail_fetch/class.POP3.php');
 include_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
 
@@ -109,7 +110,7 @@ function Mail_Fetch_Select_Server($mailfetch) {
 $mailfetch = Mail_Fetch_Servers();
 displayPageHeader($color, 'None');
 
-echo '<br /><center>';
+echo '<br /><div style="text-align: center;">';
 
 echo html_tag( 'table',
          html_tag( 'tr',
@@ -156,8 +157,9 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
     echo '<br />' .
         html_tag( 'table',
             html_tag( 'tr',
-                html_tag( 'td', '<b>' . _("Fetching from ") .
-                    htmlspecialchars($mailfetch[$i_loop]['alias']) .
+                html_tag( 'td', '<b>' .
+                    sprintf(_("Fetching from %s"),
+                        htmlspecialchars($mailfetch[$i_loop]['alias'])) .
                     '</b>',
                 'center' ) ,
             '', $color[9] ) ,
@@ -166,7 +168,7 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
     flush();
 
     if (!$pop3->connect($mailfetch_server,$mailfetch_port)) {
-        Mail_Fetch_Status(_("Oops, ") . $pop3->ERROR );
+        Mail_Fetch_Status($pop3->ERROR );
         continue;
     }
 
@@ -227,7 +229,7 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
     }
 
     for (; $i <= $Count; $i++) {
-        Mail_Fetch_Status(_("Fetching message ") . "$i" );
+        Mail_Fetch_Status(sprintf(_("Fetching message %s."), $i));
 
         if (!ini_get('safe_mode'))
             set_time_limit(20); // 20 seconds per message max
@@ -235,13 +237,13 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
         $MessArray = $pop3->get($i);
 
         while ( (!$MessArray) or (gettype($MessArray) != "array")) {
-            Mail_Fetch_Status(_("Oops, ") . $pop3->ERROR);
+            Mail_Fetch_Status($pop3->ERROR);
             // re-connect pop3
             Mail_Fetch_Status(_("Server error. Disconnect"));
             $pop3->quit();
             Mail_Fetch_Status(_("Reconnect from dead connection"));
             if (!$pop3->connect($mailfetch_server)) {
-                Mail_Fetch_Status(_("Oops, ") . $pop3->ERROR );
+                Mail_Fetch_Status($pop3->ERROR );
                 Mail_Fetch_Status(_("Saving UIDL"));
                 setPref($data_dir,$username,"mailfetch_uidl_$i_loop", $mailfetch_uidl[$i-1]);
 
@@ -255,7 +257,7 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
 
                 continue;
             }
-            Mail_Fetch_Status(_("Refetching message ") . "$i" );
+            Mail_Fetch_Status(sprintf(_("Refetching message %s."), $i));
             $MessArray = $pop3->get($i);
 
         } // end while
@@ -320,6 +322,6 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
     Mail_Fetch_Status(_("Done"));
 }
 ?>
-</center>
+</div>
 </body>
 </html>
\ No newline at end of file