Added support for imap-ssl for the gui import

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2022-04-18 12:59:53 +02:00
parent 828964ec4c
commit a31f5b7a26
2 changed files with 9 additions and 6 deletions

View File

@ -48,11 +48,15 @@ class ControllerImportTest extends Controller {
} }
else if($this->request->post['type'] == 'imap') { else if($this->request->post['type'] == 'imap' || $this->request->post['type'] == 'imap-ssl') {
$ssl = false;
if($this->request->post['type'] == 'imap-ssl') {
$ssl = 'SSL';
}
try { try {
$conn = new Zend_Mail_Protocol_Imap($this->request->post['server'], '143', false); $conn = new Zend_Mail_Protocol_Imap($this->request->post['server'], null, $ssl);
$login = $conn->login($this->request->post['username'], $this->request->post['password']); $login = $conn->login($this->request->post['username'], $this->request->post['password']);
@ -76,5 +80,3 @@ class ControllerImportTest extends Controller {
} }
?>

View File

@ -31,6 +31,7 @@
<select name="type" id="type"> <select name="type" id="type">
<option value="pop3"<?php if(isset($a['type']) && $a['type'] == 'pop3') { ?> selected="selected"<?php } ?>>pop3</option> <option value="pop3"<?php if(isset($a['type']) && $a['type'] == 'pop3') { ?> selected="selected"<?php } ?>>pop3</option>
<option value="imap"<?php if(isset($a['type']) && $a['type'] == 'imap') { ?> selected="selected"<?php } ?>>imap</option> <option value="imap"<?php if(isset($a['type']) && $a['type'] == 'imap') { ?> selected="selected"<?php } ?>>imap</option>
<option value="imap-ssl"<?php if(isset($a['type']) && $a['type'] == 'imap-ssl') { ?> selected="selected"<?php } ?>>imap-ssl</option>
</select> </select>
</div> </div>
</div> </div>
@ -43,7 +44,7 @@
</div> </div>
</div> </div>
<div class="control-group<?php if(isset($errors['username'])){ print " error"; } ?>"> <div class="control-group<?php if(isset($errors['username'])){ print " error"; } ?>">
<label class="control-label" for="username"><?php print $text_username; ?>:</label> <label class="control-label" for="username"><?php print $text_username; ?>:</label>
<div class="controls"> <div class="controls">
<input type="text" class="text" name="username" id="username" placeholder="" value="<?php if(isset($a['username'])) { print $a['username']; } ?>" /> <input type="text" class="text" name="username" id="username" placeholder="" value="<?php if(isset($a['username'])) { print $a['username']; } ?>" />
<?php if ( isset($errors['username']) ) { ?><span class="help-inline"><?php print $errors['username']; ?></span><?php } ?> <?php if ( isset($errors['username']) ) { ?><span class="help-inline"><?php print $errors['username']; ?></span><?php } ?>