54 |
|
|
55 |
// select the correct password for the supplied |
// select the correct password for the supplied |
56 |
// node from the DB |
// node from the DB |
57 |
$sql = "SELECT password, confirm from users WHERE username='" . $username . "'"; |
$sql = "SELECT username, admin, password, confirm from users WHERE username='" . $username . "'"; |
58 |
|
|
59 |
$loc_db->query ( $sql ); |
$loc_db->query ( $sql ); |
60 |
|
|
76 |
// if the password from the DB matches the one supplied |
// if the password from the DB matches the one supplied |
77 |
} elseif ($loc_db->f("password") == $password) { |
} elseif ($loc_db->f("password") == $password) { |
78 |
|
|
79 |
$_SESSION["logged_in"] = $loc_db->f("username"); |
$_SESSION["logged_in"] = $loc_db->f("username"); |
80 |
$_SESSION["admin"] = $loc_db->f("admin"); |
$_SESSION["admin"] = $loc_db->f("admin"); |
81 |
|
|
82 |
// user is authenticated |
// user is authenticated |
83 |
return true; |
return true; |