Update user.php
This commit is contained in:
parent
55e67129d7
commit
2aa58cc97a
|
|
@ -15,13 +15,13 @@ class User {
|
||||||
public function isLoggedIn() {
|
public function isLoggedIn() {
|
||||||
if(isset($_SESSION["user"])) {
|
if(isset($_SESSION["user"])) {
|
||||||
$q = $this->con->prepare("SELECT * FROM users WHERE id = :id");
|
$q = $this->con->prepare("SELECT * FROM users WHERE id = :id");
|
||||||
$q->bindParam(':id',$this->sqlData["id"],PDO::PARAM_INT);
|
$q->bindParam(':id',$_SESSION["user"],PDO::PARAM_INT);
|
||||||
$q->execute();
|
$q->execute();
|
||||||
$usr = $q->fetch();
|
$usr = $q->fetch();
|
||||||
if($usr) {
|
if(!$usr) {
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue