From e9f1b8477a583d07bd49092447bea2c82af86993 Mon Sep 17 00:00:00 2001 From: "restyled-io[bot]" <32688539+restyled-io[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2020 16:43:48 +0100 Subject: [PATCH] Restyle Updates (#135) * Restyled by jq * Restyled by php-cs-fixer * Restyled by whitespace Co-authored-by: Restyled.io --- app/.env.sample | 2 +- app/composer.json | 12 ++++++------ app/includes/app_functions.php | 28 ++++++++++++++-------------- app/includes/prereqs.php | 18 ++++++++++-------- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/app/.env.sample b/app/.env.sample index 9435306..410a96e 100644 --- a/app/.env.sample +++ b/app/.env.sample @@ -14,4 +14,4 @@ OIDC_CLIENT_ID = "" OIDC_CLIENT_SECRET = "" OIDC_DISABLE_SSL = "" -SENTRY_ENVIRONMENT = "" \ No newline at end of file +SENTRY_ENVIRONMENT = "" diff --git a/app/composer.json b/app/composer.json index 514f2bc..5f7c95a 100644 --- a/app/composer.json +++ b/app/composer.json @@ -1,8 +1,8 @@ { - "require": { - "ramsey/uuid": "^4.0", - "vlucas/phpdotenv": "^5.0", - "jumbojett/openid-connect-php": "^0.9.0", - "sentry/sdk": "^2.1" - } + "require": { + "ramsey/uuid": "^4.0", + "vlucas/phpdotenv": "^5.0", + "jumbojett/openid-connect-php": "^0.9.0", + "sentry/sdk": "^2.1" + } } diff --git a/app/includes/app_functions.php b/app/includes/app_functions.php index 4cc589a..61ceeaf 100644 --- a/app/includes/app_functions.php +++ b/app/includes/app_functions.php @@ -8,21 +8,21 @@ function oidc_set_vars($sub, $uid, $fname, $lname, $email) { - $_SESSION['uuid'] = $sub; - $_SESSION['username'] = $uid; - $_SESSION['given_name'] = $fname; - $_SESSION['family_name'] = $lname; - $_SESSION['full_name'] = $fname . " " . $lname; - $_SESSION['email'] = $email; + $_SESSION['uuid'] = $sub; + $_SESSION['username'] = $uid; + $_SESSION['given_name'] = $fname; + $_SESSION['family_name'] = $lname; + $_SESSION['full_name'] = $fname . " " . $lname; + $_SESSION['email'] = $email; } - + function is_signed_in() { - if (isset($_SESSION['is_signed_in'])) { - return true; - } else { - return false; - } + if (isset($_SESSION['is_signed_in'])) { + return true; + } else { + return false; + } } function user_exists($db, $uuid) @@ -38,9 +38,9 @@ die(); } if (empty($result)) { - return false; + return false; } else { - return true; + return true; } } diff --git a/app/includes/prereqs.php b/app/includes/prereqs.php index 10b4c45..45d0bab 100644 --- a/app/includes/prereqs.php +++ b/app/includes/prereqs.php @@ -18,15 +18,16 @@ Sentry\init([ // Database auto-generation if (file_exists("/../includes/install.php")) { - return; - add_action('run_db_populate'); + return; + add_action('run_db_populate'); } -function run_db_populate() { +function run_db_populate() +{ // all my glorious one-time-magic. - include( "/../includes/install.php" ); - // after all execution rename your file; - rename( "/../includes/install.php", "/../includes/install-backup.php"); + include("/../includes/install.php"); + // after all execution rename your file; + rename("/../includes/install.php", "/../includes/install-backup.php"); } // Session @@ -38,8 +39,9 @@ $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // OpenID Connect use Jumbojett\OpenIDConnectClient; + $oidc = new OpenIDConnectClient($_ENV['OIDC_HOST'], $_ENV['OIDC_CLIENT_ID'], $_ENV['OIDC_CLIENT_SECRET']); if ($_ENV['OIDC_DISABLE_SSL'] == "true") { - $oidc->setVerifyHost(false); - $oidc->setVerifyPeer(false); + $oidc->setVerifyHost(false); + $oidc->setVerifyPeer(false); }