PHP 5.3 deprecated ereg() function (#2820952)
[squirrelmail.git] / plugins / mail_fetch / functions.php
index ca9b0630da68d84d466aaad3d6cff631edd25772..5f1e97184d036015f5451288d0691da1cbb60447 100644 (file)
@@ -9,7 +9,7 @@
  * 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
+ * @copyright &copy; 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -24,6 +24,21 @@ include_once (SM_PATH . 'plugins/mail_fetch/class.mail_fetch.php');
 /** declare plugin globals */
 global $mail_fetch_allow_unsubscribed;
 
+/**
+  * Add link to menu at top of content pane
+  *
+  * @return void
+  *
+  */
+function mail_fetch_link_do() {
+
+    global $oTemplate, $nbsp;
+    $output = makeInternalLink('plugins/mail_fetch/fetch.php', _("Fetch"), '')
+            . $nbsp . $nbsp;
+    return array('menuline' => $output);
+
+}
+
 /**
  * Controls use of unsubscribed folders in plugin
  * @global boolean $mail_fetch_allow_unsubscribed
@@ -64,8 +79,9 @@ function mail_fetch_login_function() {
         $mailfetch_login_[$i_loop] = getPref($data_dir, $username, "mailfetch_login_$i_loop");
         $mailfetch_fref_[$i_loop] = getPref($data_dir, $username, "mailfetch_fref_$i_loop");
         $mailfetch_pass_[$i_loop] = getPref($data_dir, $username, "mailfetch_pass_$i_loop");
-        if( $mailfetch_cypher == 'on' )
+        if( $mailfetch_cypher == 'on' ) {
             $mailfetch_pass_[$i_loop] = decrypt( $mailfetch_pass_[$i_loop] );
+        }
 
         if( $mailfetch_pass_[$i_loop] <> '' &&          // Empty passwords no allowed
                 ( ( $mailfetch_login_[$i_loop] == 'on' &&  $mailfetch_newlog == 'on' ) || $mailfetch_fref_[$i_loop] == 'on' ) ) {