[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/emailadmin/inc/ -> class.defaultpop.inc.php (source)

   1  <?php
   2      /***************************************************************************\
   3      * EGroupWare - EMailAdmin                                                   *
   4      * http://www.egroupware.org                                                 *
   5      * Written by : Lars Kneschke [lkneschke@linux-at-work.de]                   *
   6      * -------------------------------------------------                         *
   7      * This program is free software; you can redistribute it and/or modify it   *
   8      * under the terms of the GNU General Public License as published by the     *
   9      * Free Software Foundation; either version 2 of the License, or (at your    *
  10      * option) any later version.                                                *
  11      \***************************************************************************/
  12      /* $Id: class.defaultpop.inc.php 19408 2005-10-14 10:10:06Z ralfbecker $ */
  13  
  14      class defaultpop
  15      {
  16          var $profileData;
  17          
  18  		function defaultpop($_profileData)
  19          {
  20              $this->profileData = $_profileData;
  21          }
  22          
  23  		function addAccount($_hookValues)
  24          {
  25              return true;
  26          }
  27          
  28  		function deleteAccount($_hookValues)
  29          {
  30              return true;
  31          }
  32          
  33  		function encodeFolderName($_folderName)
  34          {
  35              if($this->mbAvailable)
  36              {
  37                  return mb_convert_encoding( $_folderName, "UTF7-IMAP", "ISO_8859-1" );
  38              }
  39              
  40              // if not
  41              return imap_utf7_encode($_folderName);
  42          }
  43  
  44  		function getMailboxString($_folderName='')
  45          {
  46              if($this->profileData['imapTLSEncryption'] == 'yes' &&
  47                   $this->profileData['imapTLSAuthentication'] == 'yes')
  48              {
  49                  if(empty($this->profileData['imapPort']))
  50                      $port = '995';
  51                  else
  52                      $port = $this->profileData['imapPort'];
  53                      
  54                  $mailboxString = sprintf("{%s:%s/pop3/ssl}%s",
  55                      $this->profileData['imapServer'],
  56                      $port,
  57                      $_folderName);
  58              }
  59              // don't check cert
  60              elseif($this->profileData['imapTLSEncryption'] == 'yes')
  61              {
  62                  if(empty($this->profileData['imapPort']))
  63                      $port = '995';
  64                  else
  65                      $port = $this->profileData['imapPort'];
  66                      
  67                  $mailboxString = sprintf("{%s:%s/pop3/ssl/novalidate-cert}%s",
  68                      $this->profileData['imapServer'],
  69                      $port,
  70                      $_folderName);
  71              }
  72              // no tls
  73              else
  74              {
  75                  if(empty($this->profileData['imapPort']))
  76                      $port = '110';
  77                  else
  78                      $port = $this->profileData['imapPort'];
  79                      
  80                  $mailboxString = sprintf("{%s:%s/pop3}%s",
  81                      $this->profileData['imapServer'],
  82                      $port,
  83                      $_folderName);
  84              }
  85  
  86              return $this->encodeFolderName($mailboxString);
  87          }
  88  
  89  		function updateAccount($_hookValues)
  90          {
  91              return true;
  92          }
  93      }
  94  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7