check for errors before printing
Signed-off-by: Anojh Thayaparan <anojh@hotmail.com>
This commit is contained in:
22
lib/imap.php
22
lib/imap.php
@@ -67,14 +67,20 @@ class OC_User_IMAP extends \OCA\user_external\Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$mbox = @imap_open($this->mailbox, $username, $password, OP_HALFOPEN, 1);
|
$mbox = @imap_open($this->mailbox, $username, $password, OP_HALFOPEN, 1);
|
||||||
OC::$server->getLogger()->error(
|
$imapErrors = imap_errors();
|
||||||
'ERROR: IMAP Error: ' . print_r(imap_errors(), true),
|
$imapAlerts = imap_alerts();
|
||||||
['app' => 'user_external']
|
if (!empty($imapErrors) {
|
||||||
);
|
OC::$server->getLogger()->error(
|
||||||
OC::$server->getLogger()->warning(
|
'ERROR: IMAP Error: ' . print_r($imapErrors, true),
|
||||||
'WARNING: IMAP Warning: ' . print_r(imap_alerts(), true),
|
['app' => 'user_external']
|
||||||
['app' => 'user_external']
|
);
|
||||||
);
|
}
|
||||||
|
if (!empty($imapAlerts)) {
|
||||||
|
OC::$server->getLogger()->warning(
|
||||||
|
'WARNING: IMAP Warning: ' . print_r($imapAlerts, true),
|
||||||
|
['app' => 'user_external']
|
||||||
|
);
|
||||||
|
}
|
||||||
if($mbox !== false) {
|
if($mbox !== false) {
|
||||||
imap_close($mbox);
|
imap_close($mbox);
|
||||||
$uid = mb_strtolower($uid);
|
$uid = mb_strtolower($uid);
|
||||||
|
|||||||
Reference in New Issue
Block a user