2 // Authentication by looking up an IMAP, POP or NNTP server
4 // This code is completely untested so far - IT NEEDS TESTERS!
5 // Looks like it should work though ...
7 $CFG->auth_imaphost = "127.0.0.1"; // Should be IP number
8 $CFG->auth_imaptype = "imap"; // imap, imapssl, imapcert, pop3, pop3cert, nntp
9 $CFG->auth_imapport = "143"; // 143, 993, 100, 119
12 function auth_user_login ($username, $password) {
13 // Returns true if the username and password work
14 // and false if they are wrong or don't exist.
18 switch ($CFG->auth_imaptype) {
20 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport}INBOX";
23 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl}INBOX";
26 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/imap/ssl/novalidate-cert}INBOX";
29 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3}INBOX";
32 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/pop3/ssl/novalidate-cert}INBOX";
35 $host = "{$CFG->auth_imaphost:$CFG->auth_imapport/nntp}";
39 if ($connection = imap_open($host, $username, $password, OP_HALFOPEN)) {
40 imap_close($connection);