Facebook ID instead of Facebook email

This commit is contained in:
Joey Lai
2017-02-01 12:25:13 +01:00
parent 8e98001217
commit 2b893fc283
11 changed files with 148 additions and 138 deletions

View File

@@ -72,7 +72,7 @@ function validateLogin($username, $password){
}
}
function fbLogin($email) {
function fbLogin($fbID) {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`email`,
@@ -81,16 +81,16 @@ function fbLogin($email) {
FROM
`user`
WHERE
`email` LIKE :email
`facebookID` LIKE :facebookID
");
$stmt->bindValue(":email", $email);
$stmt->bindValue(":facebookID", $fbID);
$stmt->execute();
return $stmt->rowCount();
}
function getfbUserID($email) {
function getfbUserID($fbID) {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`userID`,
@@ -98,10 +98,10 @@ function getfbUserID($email) {
FROM
`user`
WHERE
`email` LIKE :email
`facebookID` LIKE :facebookID
");
$stmt->bindValue(":email", $email);
$stmt->bindValue(":facebookID", $fbID);
$stmt->execute();
return $stmt->fetch(PDO::FETCH_ASSOC);
}