diff options
author | Andrew Dolgov <[email protected]> | 2013-04-07 19:27:34 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-07 19:27:34 +0400 |
commit | db77016fc8245d01a5dbe63ccc308258c794e7f2 (patch) | |
tree | 4e01c9516f31cde20aa4d7c7b8ffa5d188cfa335 /plugins/auth_imap/init.php | |
parent | a905d89e86b303dc00738b3045ebf4ad9e32bfed (diff) |
move service-dependent auth plugins to contrib repo
Diffstat (limited to 'plugins/auth_imap/init.php')
-rw-r--r-- | plugins/auth_imap/init.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/plugins/auth_imap/init.php b/plugins/auth_imap/init.php deleted file mode 100644 index cca279cb3..000000000 --- a/plugins/auth_imap/init.php +++ /dev/null @@ -1,51 +0,0 @@ -<?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 Plugin implements IAuthModule { - - private $link; - private $host; - private $base; - - function about() { - return array(1.0, - "Authenticates against an IMAP server (configured in config.php)", - "fox", - true); - } - - function init($host) { - $this->link = $host->get_link(); - $this->host = $host; - $this->base = new Auth_Base($this->link); - - $host->add_hook($host::HOOK_AUTH_USER, $this); - } - - 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->base->auto_create_user($login); - } - } - - return false; - } - -} - -?> |