source: trunk/emailadmin/inc/class.defaultpop.inc.php @ 2

Revision 2, 2.4 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
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
13        class defaultpop
14        {
15                var $profileData;
16               
17                function defaultpop($_profileData)
18                {
19                        $this->profileData = $_profileData;
20                }
21               
22                function addAccount($_hookValues)
23                {
24                        return true;
25                }
26               
27                function deleteAccount($_hookValues)
28                {
29                        return true;
30                }
31               
32                function encodeFolderName($_folderName)
33                {
34                        if($this->mbAvailable)
35                        {
36                                return mb_convert_encoding( $_folderName, "UTF7-IMAP", "ISO_8859-1" );
37                        }
38                       
39                        // if not
40                        return imap_utf7_encode($_folderName);
41                }
42
43                function getMailboxString($_folderName='')
44                {
45                        if($this->profileData['imapTLSEncryption'] == 'yes' &&
46                           $this->profileData['imapTLSAuthentication'] == 'yes')
47                        {
48                                if(empty($this->profileData['imapPort']))
49                                        $port = '995';
50                                else
51                                        $port = $this->profileData['imapPort'];
52                                       
53                                $mailboxString = sprintf("{%s:%s/pop3/ssl}%s",
54                                        $this->profileData['imapServer'],
55                                        $port,
56                                        $_folderName);
57                        }
58                        // don't check cert
59                        elseif($this->profileData['imapTLSEncryption'] == 'yes')
60                        {
61                                if(empty($this->profileData['imapPort']))
62                                        $port = '995';
63                                else
64                                        $port = $this->profileData['imapPort'];
65                                       
66                                $mailboxString = sprintf("{%s:%s/pop3/ssl/novalidate-cert}%s",
67                                        $this->profileData['imapServer'],
68                                        $port,
69                                        $_folderName);
70                        }
71                        // no tls
72                        else
73                        {
74                                if(empty($this->profileData['imapPort']))
75                                        $port = '110';
76                                else
77                                        $port = $this->profileData['imapPort'];
78                                       
79                                $mailboxString = sprintf("{%s:%s/pop3}%s",
80                                        $this->profileData['imapServer'],
81                                        $port,
82                                        $_folderName);
83                        }
84
85                        return $this->encodeFolderName($mailboxString);
86                }
87
88                function updateAccount($_hookValues)
89                {
90                        return true;
91                }
92        }
93?>
Note: See TracBrowser for help on using the repository browser.