Skip to content
Snippets Groups Projects
Commit 04cdc802 authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

add IMAP authenticator module (closes #485)

parent 23f36f75
No related branches found
No related tags found
No related merge requests found
<?php
/* Requires php-imap
Put the following options in config.php:
define('IMAP_AUTH_SERVER', 'your.imap.server:port');
define('IMAP_AUTH_OPTIONS', '/tls/novalidate-cert/norsh');
// More about options: http://php.net/manual/ru/function.imap-open.php
*/
class Auth_Imap extends Auth_Base {
function authenticate($login, $password) {
if ($login && $password) {
$imap = imap_open(
"{".IMAP_AUTH_SERVER.IMAP_AUTH_OPTIONS."}INBOX",
$login,
$password);
if ($imap) {
imap_close($imap);
return $this->auto_create_user($login);
}
}
return false;
}
}
?>
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