check_login_pass.php 520 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<?php
/*
 * Copyright (C) 2004 Roberto Lumbreras <rover@debian.org>
 * License: public domain.
 */
function check_login_pass($username, $password) {
	require("/usr/share/php-radius/radius_authentication.inc.php");

	$retval = RADIUS_AUTHENTICATION($username, $password);
	switch ($retval) {
		case 2:
			/* 2 -> Access-Accept */
			return TRUE;
			break;
		case 3:
			/* 3 -> Access-Reject */
			echo "login incorrect";
			break;
		default:
			echo "temporally failure or other error";
			break;
	}
	return FALSE;
}

?>