mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-07-22 19:33:34 +03:00
Fix the other queries too
This commit is contained in:
parent
340d297f71
commit
ca6c953818
2 changed files with 21 additions and 5 deletions
|
@ -44,7 +44,10 @@ function try_login() {
|
|||
return FALSE;
|
||||
}
|
||||
$db = get_db();
|
||||
$userinfo = $db->querySingle("SELECT * FROM users WHERE emailaddress = '".$_POST['username']."'", 1);
|
||||
$q = $db->prepare('SELECT * FROM users WHERE emailaddress = ?');
|
||||
$q->bindValue(1, $_POST['username']);
|
||||
$result = $q->execute();
|
||||
$userinfo = $result->fetchArray(SQLITE3_ASSOC);
|
||||
if (isset($userinfo['password']) and (crypt($_POST['password'], $userinfo['password']) == $userinfo['password'])) {
|
||||
set_logged_in($_POST['username']);
|
||||
if (isset($userinfo['isadmin']) && $userinfo['isadmin'] == 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue