[ Index ]
 

Code source de IMP H3 (4.1.5)

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/lib/Maintenance/Task/ -> fetchmail_login.php (source)

   1  <?php
   2  /**
   3   * $Horde: imp/lib/Maintenance/Task/fetchmail_login.php,v 1.5.12.8 2007/01/02 13:55:01 jan Exp $
   4   *
   5   * Copyright 2003-2007 Nuno Loureiro <nuno@co.sapo.pt>
   6   * Copyright 2004-2007 Michael Slusarz <slusarz@bigworm.colorado.edu>
   7   *
   8   * See the enclosed file COPYING for license information (GPL). If you
   9   * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  10   *
  11   * Maintenance module that fetch mail upon login
  12   *
  13   * @author  Nuno Loureiro <nuno@co.sapo.pt>
  14   * @author  Michael Slusarz <slusarz@bigworm.colorado.edu>
  15   * @since   IMP 4.0
  16   * @package Horde_Maintenance
  17   */
  18  class Maintenance_Task_fetchmail_login extends Maintenance_Task {
  19  
  20      /**
  21       * The style of the maintenance page output.
  22       *
  23       * @var integer
  24       */
  25      var $_display_type = MAINTENANCE_OUTPUT_CONFIRM;
  26  
  27      /**
  28       * Fetch email from other accounts.
  29       */
  30      function doMaintenance()
  31      {
  32          /* If the user wants to fetch emails from other accounts on login,
  33           * go get those messages now. */
  34          if ($GLOBALS['prefs']->getValue('fm_accounts')) {
  35              require_once  IMP_BASE . '/lib/Fetchmail.php';
  36              $fm_account = &new IMP_Fetchmail_Account();
  37              $fm_list = array();
  38  
  39              foreach ($fm_account->getAll('loginfetch') as $id => $val) {
  40                  if ($val) {
  41                      $fm_list[] = $id;
  42                  }
  43              }
  44  
  45              if (!empty($fm_list)) {
  46                  IMP_Fetchmail::fetchMail($fm_list);
  47              }
  48          }
  49      }
  50  
  51      /**
  52       * Returns the summary of the accounts to fetch email from.
  53       *
  54       * @return string  The summary of the accounts to fetch email from.
  55       */
  56      function describeMaintenance()
  57      {
  58          $str  = _("You are about to fetch email from the following account(s):");
  59          $str .= "\n<blockquote>\n";
  60  
  61          if ($GLOBALS['prefs']->getValue('fm_accounts')) {
  62              require_once  IMP_BASE . '/lib/Fetchmail.php';
  63              $fm_account = &new IMP_Fetchmail_Account();
  64              foreach ($fm_account->getAll('loginfetch') as $id => $val) {
  65                  if ($val) {
  66                      $str .= " - " . $fm_account->getValue('id', $id) . "<br />\n";
  67                  }
  68              }
  69          }
  70  
  71          $str .= "\n</blockquote>\n<strong>" . _("Note that this can take some time") . ".</strong>\n";
  72  
  73          return $str;
  74      }
  75  
  76  }


Généré le : Thu Nov 29 12:30:07 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics