imap : if there is an authentication, return an exception with 401 code
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2376 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
3
imap.php
3
imap.php
@@ -63,6 +63,9 @@ class imap
|
||||
{
|
||||
// imap_errors() takes the errors and clear the error stack
|
||||
$errors = imap_errors();
|
||||
if (substr ($e->getMessage (), 0, 35) ===
|
||||
"Can not authenticate to IMAP server")
|
||||
throw new Exception ("IMAP error : ".$e->getMessage(), 401);
|
||||
throw new Exception ("IMAP error : ".$e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user