Skip to content
Snippets Groups Projects
Commit faf089df authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

email: Simplify select of mail box protocol

parent b50d6e61
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,10 @@ class Email {
$this->ht=db_fetch_array($res);
$this->ht['mail_proto'] = $this->ht['mail_protocol'];
if ($this->ht['mail_encryption'] == 'SSL')
$this->ht['mail_proto'] .= "/".$this->ht['mail_encryption'];
$this->id=$this->ht['email_id'];
$this->address=$this->ht['name']?($this->ht['name'].'<'.$this->ht['email'].'>'):$this->ht['email'];
......@@ -261,6 +265,9 @@ class Email {
$errors['passwd'] = 'Unable to encrypt password - get technical support';
}
list($vars['mail_protocol'], $encryption) = explode('/', $vars['mail_proto']);
$vars['mail_encryption'] = $encryption ?: 'NONE';
if($vars['mail_active']) {
//Check pop/imapinfo only when enabled.
if(!function_exists('imap_open'))
......
......@@ -723,6 +723,15 @@ class MailFetcher {
return $ticket;
}
static function getSupportedProtos() {
return array(
'IMAP/SSL' => 'IMAP + SSL',
'IMAP' => 'IMAP',
'POP/SSL' => 'POP + SSL',
'POP' => 'POP',
);
}
function fetchEmails() {
......
......@@ -25,6 +25,12 @@ if($email && $_REQUEST['a']!='add'){
$info['ispublic']=isset($info['ispublic'])?$info['ispublic']:1;
$info['ticket_auto_response']=isset($info['ticket_auto_response'])?$info['ticket_auto_response']:1;
$info['message_auto_response']=isset($info['message_auto_response'])?$info['message_auto_response']:1;
if (!$info['mail_fetchfreq'])
$info['mail_fetchfreq'] = 5;
if (!$info['mail_fetchmax'])
$info['mail_fetchmax'] = 10;
if (!isset($info['smtp_auth']))
$info['smtp_auth'] = 1;
$qstr.='&a='.$_REQUEST['a'];
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment