Fix some inputvalidation and functionnames

This commit is contained in:
Mark Schouten 2014-06-23 09:55:52 +02:00
parent 59183064da
commit aa37139301
4 changed files with 55 additions and 38 deletions

View file

@ -40,7 +40,10 @@ function logout() {
function try_login() {
if (isset($_POST['username']) and isset($_POST['password'])) {
$db = _get_db();
if (valid_user($_POST['username']) === FALSE) {
return FALSE;
}
$db = get_db();
$userinfo = $db->querySingle("SELECT * FROM users WHERE emailaddress = '".$_POST['username']."'", 1);
if (isset($userinfo['password']) and (crypt($_POST['password'], $userinfo['password']) == $userinfo['password'])) {
set_logged_in($_POST['username']);