moodle/auth/nntp/lib.php
moodler 35a48c9ae4 A significant new system for authentication configuration that
exposes the wide array of authentication possibilities.

Authentication now has it's own page separate from other variables.

Most of this work was done by Petri Asikainen <paca@sci.fi>, who started
these changes off.

I've done some cleanups and additions which is why I'm checking it in.

It's all working pretty well at the moment but could use some testing.

Thanks, Petri!  :-)
2002-11-19 08:51:33 +00:00

31 lines
659 B
PHP

<?PHP // $Id$
// 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;
$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;
}
}
?>