Location: PHPKode > projects > HERMES PHP-Based Business Mgmt > hermes-0.4.1/pam.d/pam_db_table/pam.php
<?
/* PAM login function for the dbtable method.
 *
 * Chris Travers
 * June 12, 2002
 * hide@address.com
 */

include "pam.d/pam_db_tables/config.php";

function login ($username, $password){
	global $debug;
	global $pam_auth_username;
	global $pam_auth_password;
	global $pam_user_account;
	global $pam_user_password;
	global $pam_user_table;

	$password_hash=md5($password);
	$temp_connect=dbconnect($username, $password);
	$UserRow=FetchArray(SQLQuery(
		"SELECT passwd_hash FROM $pam_user_table
		WHERE login='$username'"
	));
	db_disconnect ($temp_connect);
	if ($password_hash==$UserRow["passwd_hash"]){
		$connection=dbconnect($pam_user_account, $pam_user_password);
	}
	return $connection;
	else {
	}
}
Return current item: HERMES PHP-Based Business Mgmt