login.class.php
525 Bytes
<?
class userdetail {
function __construct($dbobj, $uid=NULL) {
$this->db = $dbobj;
$this->uid = $uid;
}
function login($username, $password) {
$username = strtolower($username);
$row = $this->db->fetchRow("SELECT NICK, PASSWORD FROM USER WHERE lower(NICK) = '$username'");
if (strtolower($row['NICK']) == strtolower($username) AND $row['PASSWORD'] == sha1($password)) {
return TRUE;
} else {
return FALSE;
}
}
}
?>