moodle/auth/nntp/lib.php

31 lines
659 B
PHP
Raw Normal View History

<?PHP // $Id$
2002-11-16 03:56:00 +00:00
// Authentication by looking up an NNTP server
// This code is completely untested so far - IT NEEDS TESTERS!
// Looks like it should work though ...
function auth_user_login ($username, $password) {
// Returns true if the username and password work
// and false if they are wrong or don't exist.
global $CFG;
2002-11-17 09:57:34 +00:00
$host = "{".$CFG->auth_nntphost.":$CFG->auth_nntpport/nntp}";
error_reporting(0);
$connection = imap_open($host, $username, $password, OP_HALFOPEN);
error_reporting(7);
if ($connection) {
imap_close($connection);
return true;
} else {
return false;
}
}
?>