Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26c4f801d3 | ||
|
|
49581da52c | ||
| 57faf21a67 |
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<footer class="footer mt-auto py-3">
|
||||
<div class="text-center text-muted">
|
||||
<?php
|
||||
echo($_ENV['APP_NAME'] . " " . get_version());
|
||||
echo($_ENV['APP_NAME'] . " " . get_version() . "<br>");
|
||||
if ($_ENV['APP_NAME'] != "FHeD") {
|
||||
echo(", powered by FHeD");
|
||||
echo("Powered by FHeD.");
|
||||
};
|
||||
?><br>
|
||||
<?php if (is_signed_in()) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user