From e938b1de117cfde17a5773fe0c6fc92185c873fe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 30 Dec 2012 13:36:40 +0400 Subject: rename plugin main class files --- plugins/auth_imap/init.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 plugins/auth_imap/init.php (limited to 'plugins/auth_imap/init.php') diff --git a/plugins/auth_imap/init.php b/plugins/auth_imap/init.php new file mode 100644 index 000000000..cca279cb3 --- /dev/null +++ b/plugins/auth_imap/init.php @@ -0,0 +1,51 @@ +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; + } + +} + +?> -- cgit v1.2.3