X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=auth%2Fpop3%2Flib.php;h=d6eee07f3b7101d116b13af9a8f0d11faf63ba42;hp=6582c979c364f3946c93a33aea60ee50101ba198;hb=a7514c09e6f3b8ee252825a587e9aff6ad616eea;hpb=98bc913c2cf0c50850c4aaa27622ea018aea7639 diff --git a/auth/pop3/lib.php b/auth/pop3/lib.php index 6582c979c36..d6eee07f3b7 100644 --- a/auth/pop3/lib.php +++ b/auth/pop3/lib.php @@ -1,14 +1,6 @@ auth_pop3host = "127.0.0.1"; // Should be IP number -$CFG->auth_pop3type = "pop3"; // pop3, pop3cert -$CFG->auth_pop3port = "110"; // 110 is most common - - function auth_user_login ($username, $password) { // Returns true if the username and password work // and false if they are wrong or don't exist. @@ -17,14 +9,18 @@ function auth_user_login ($username, $password) { switch ($CFG->auth_pop3type) { case "pop3": - $host = "{$CFG->auth_pop3host:$CFG->auth_pop3port/pop3}INBOX"; + $host = "{".$CFG->auth_pop3host.":$CFG->auth_pop3port/pop3}INBOX"; break; case "pop3cert": - $host = "{$CFG->auth_pop3host:$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX"; + $host = "{".$CFG->auth_pop3host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX"; break; } - if ($connection = imap_open($host, $username, $password, OP_HALFOPEN)) { + error_reporting(0); + $connection = imap_open($host, $username, $password, OP_HALFOPEN); + error_reporting($CFG->debug); + + if ($connection) { imap_close($connection); return true;