[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
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.defaultimap.inc.php 19408 2005-10-14 10:10:06Z ralfbecker $ */ 13 14 class defaultimap 15 { 16 var $profileData; 17 18 function defaultimap($_profileData) 19 { 20 $this->profileData = $_profileData; 21 if (function_exists('mb_convert_encoding')) $this->mbAvailable = TRUE; 22 } 23 24 function addAccount($_hookValues) 25 { 26 return true; 27 } 28 29 function deleteAccount($_hookValues) 30 { 31 return true; 32 } 33 34 function encodeFolderName($_folderName) 35 { 36 if($this->mbAvailable) 37 { 38 return mb_convert_encoding( $_folderName, "UTF7-IMAP", $GLOBALS['egw']->translation->charset()); 39 } 40 41 // if not 42 // can encode only from ISO 8859-1 43 return imap_utf7_encode($_folderName); 44 } 45 46 function getMailboxString($_folderName='') 47 { 48 if($this->profileData['imapTLSEncryption'] == 'yes' && 49 $this->profileData['imapTLSAuthentication'] == 'yes') 50 { 51 if(empty($this->profileData['imapPort'])) 52 $port = '993'; 53 else 54 $port = $this->profileData['imapPort']; 55 56 $mailboxString = sprintf("{%s:%s/imap/ssl}%s", 57 $this->profileData['imapServer'], 58 $port, 59 $_folderName); 60 } 61 // don't check cert 62 elseif($this->profileData['imapTLSEncryption'] == 'yes') 63 { 64 if(empty($this->profileData['imapPort'])) 65 $port = '993'; 66 else 67 $port = $this->profileData['imapPort']; 68 69 $mailboxString = sprintf("{%s:%s/imap/ssl/novalidate-cert}%s", 70 $this->profileData['imapServer'], 71 $port, 72 $_folderName); 73 } 74 // no tls 75 else 76 { 77 if(empty($this->profileData['imapPort'])) 78 $port = '143'; 79 else 80 $port = $this->profileData['imapPort']; 81 82 if($this->profileData['imapoldcclient'] == 'yes') 83 { 84 $mailboxString = sprintf("{%s:%s/imap}%s", 85 $this->profileData['imapServer'], 86 $port, 87 $_folderName); 88 } 89 else 90 { 91 $mailboxString = sprintf("{%s:%s/imap/notls}%s", 92 $this->profileData['imapServer'], 93 $port, 94 $_folderName); 95 } 96 } 97 98 return $this->encodeFolderName($mailboxString); 99 } 100 101 function updateAccount($_hookValues) 102 { 103 return true; 104 } 105 } 106 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |