]> git.wh0rd.org - tt-rss.git/blame - classes/auth/imap.php
fix duplicate RCHK check while appending headlines
[tt-rss.git] / classes / auth / imap.php
CommitLineData
04cdc802
AD
1<?php
2/* Requires php-imap
3 Put the following options in config.php:
4
5 define('IMAP_AUTH_SERVER', 'your.imap.server:port');
6 define('IMAP_AUTH_OPTIONS', '/tls/novalidate-cert/norsh');
7 // More about options: http://php.net/manual/ru/function.imap-open.php
8
9 */
10
11class Auth_Imap extends Auth_Base {
12
13 function authenticate($login, $password) {
14
15 if ($login && $password) {
16 $imap = imap_open(
17 "{".IMAP_AUTH_SERVER.IMAP_AUTH_OPTIONS."}INBOX",
18 $login,
19 $password);
20
21 if ($imap) {
22 imap_close($imap);
23
24 return $this->auto_create_user($login);
25 }
26 }
27
28 return false;
29 }
30
31}
32?>