Added exception handling for gui imap auth

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-09-09 14:35:18 +00:00
parent 4efe39b5f3
commit 1ea62b8446

View File

@ -362,6 +362,7 @@ class ModelUserAuth extends Model {
private function checkLoginAgainstIMAP($imap_server = array(), $username = '', $password = '', $data = array()) {
$rc = 0;
$session = Registry::get('session');
$emails = array($username);
@ -378,6 +379,7 @@ class ModelUserAuth extends Model {
$login = $a[0];
}
try {
$imap = new Zend_Mail_Protocol_Imap($imap_server['IMAP_HOST'], $imap_server['IMAP_PORT'], $imap_server['IMAP_SSL']);
if($imap->login($login, $password)) {
$imap->logout();
@ -398,10 +400,12 @@ class ModelUserAuth extends Model {
$session->set("password", $password);
return 1;
$rc = 1;
}
}
catch (Zend_Mail_Protocol_Exception $e) {}
return 0;
return $rc;
}