4 Commits

Author SHA1 Message Date
a4ae987f94 Move break rule in footer (#124)
* Update footer.php

* Change line break to pipe

* Remove full stop

Co-authored-by: Alexander Davis <alex@adcm.uk>
2020-08-18 17:58:07 +01:00
Alexander Davis
26c4f801d3 Broken login (#122)
* Fixing Login Die

* Fix Broken Login 2

* Update footer

* Try Somethin New Today
2020-08-17 17:04:34 +01:00
Alexander Davis
49581da52c Broken login (#121)
* Fixing Login Die

* Fix Broken Login 2
2020-08-17 16:48:13 +01:00
57faf21a67 Fixing Login Die 2020-08-17 16:37:41 +01:00
3 changed files with 10 additions and 7 deletions

View File

@@ -12,13 +12,16 @@
$sql = $db->prepare("SELECT uuid FROM users WHERE uuid=:uuid");
$sql->bindParam(':uuid', $uuid);
$sql->execute();
$sql->setFetchMode(PDO::FETCH_ASSOC);
$result = $sql->fetchAll();
} catch (PDOException $e) {
$alert = array("danger", "Error during check for user record: " . $e->getMessage());
die();
}
if (empty($sql)) {
return false;
if (empty($result)) {
return false;
} else {
return true;
return true;
}
}

View File

@@ -3,7 +3,7 @@
<?php
echo($_ENV['APP_NAME'] . " " . get_version());
if ($_ENV['APP_NAME'] != "FHeD") {
echo(", powered by FHeD");
echo("| Powered by FHeD");
};
?><br>
<?php if (is_signed_in()) {

View File

@@ -17,7 +17,7 @@
$alert = array("danger", "Error during OpenID Connect authentication: " . $e->getMessage());
}
if (!user_exists($db, $uuid)) {
if (user_exists($db, $oidc_user['sub']) == false) {
// User doesn't already exist
try {
$stmt = "INSERT INTO users (uuid, uid, given_name, family_name, email) VALUES (:sub, :username, :given, :family, :email)";
@@ -28,7 +28,7 @@
$sql->bindParam(':family', $oidc_user['family_name']);
$sql->bindParam(':email', $oidc_user['email']);
$sql->execute();
} catch (Jumbojett\PDOException $e) {
} catch (PDOException $e) {
echo("Error during creation of new user record: " . $e->getMessage());
die();
$alert = array("danger", "Error during creation of new user record: " . $e->getMessage());
@@ -44,7 +44,7 @@
$sql->bindParam(':family', $oidc_user['family_name']);
$sql->bindParam(':email', $oidc_user['email']);
$sql->execute();
} catch (Jumbojett\PDOException $e) {
} catch (PDOException $e) {
echo("Error during existing user record update: " . $e->getMessage());
die();
$alert = array("danger", "Error during existing user record update: " . $e->getMessage());