diff --git a/Gemfile.lock b/Gemfile.lock index d3195d5..456f729 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,20 +1,20 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.1) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) colorator (1.1.0) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.15.5) + ffi (1.16.3) forwardable-extended (2.6.0) http_parser.rb (0.8.0) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jekyll (4.3.2) + jekyll (4.3.3) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) @@ -56,19 +56,19 @@ GEM mercenary (0.4.0) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (5.0.1) + public_suffix (5.0.4) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - rexml (3.2.5) - rouge (4.0.1) + rexml (3.2.6) + rouge (4.2.0) rubyzip (2.3.2) safe_yaml (1.0.5) sassc (2.4.0) ffi (~> 1.9) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) webrick (1.8.1) PLATFORMS diff --git a/_config.yml b/_config.yml index ff92693..af94498 100644 --- a/_config.yml +++ b/_config.yml @@ -8,6 +8,8 @@ description: >- url: "https://sebsscholarship.org" +repo: sebs-scholarship/Website + baseurl: "" plugins: @@ -33,7 +35,7 @@ defaults: values: sitemap: false -remote_theme: sebs-scholarship/Theme@2023-04-05-1 +remote_theme: sebs-scholarship/Theme@2024-01-04-1 exclude: - .github diff --git a/_includes/common_js.html b/_includes/common_js.html index 6a53d48..9f718e2 100644 --- a/_includes/common_js.html +++ b/_includes/common_js.html @@ -10,6 +10,7 @@ } }, "theme": "edgeless", + "position": "bottom-left", "content": { "href": "https://sebsscholarship.org/privacy_policy.html" } diff --git a/_includes/contact.html b/_includes/contact.html index ea9a042..296266b 100644 --- a/_includes/contact.html +++ b/_includes/contact.html @@ -3,44 +3,22 @@

Get In Touch

-

If you have any questions, please use the form below to contact us. Someone should get back to you in a few business days.

+

If you have any questions, you can reach us using the information below. Someone will get back to you in a few business days.

-
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-

-
+
+
+
+

Email Us

+
-
- +
+
+
+

Phone

+
diff --git a/_includes/footer.html b/_includes/footer.html deleted file mode 100644 index eb28eb4..0000000 --- a/_includes/footer.html +++ /dev/null @@ -1,65 +0,0 @@ -{% assign prefix = "/" %} -{% unless page.title %} -{% assign prefix = "" %} -{% endunless %} -
-
- -
-
- -

Copyright © 2019 - 2023 SEBS Scholarship Foundation. All Rights Reserved.

-

Made with love by volunteer contributors.

-

Uses the SSF-Theme Jekyll theme created by volunteer contributors.

-

Original design based on the Law template by uiCookies.

-
-

- SEBS Scholarship Foundation does not and shall not discriminate on the basis of race, color, - religion (creed), gender, gender expression, age, national origin (ancestry), disability, - marital status, sexual orientation, or military status, in any of its activities or - operations. These activities include, but are not limited to, hiring and firing of staff, - selection of volunteers and vendors, and provision of services. We are committed to - providing an inclusive and welcoming environment for all members of our staff, clients, - volunteers, subcontractors, vendors, and clients. -

-

Tax ID: 84-3017503

-
-
-
-
diff --git a/_includes/footer_links.html b/_includes/footer_links.html new file mode 100644 index 0000000..65754d5 --- /dev/null +++ b/_includes/footer_links.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/_includes/home_js.html b/_includes/home_js.html index ae8b6b7..430821f 100644 --- a/_includes/home_js.html +++ b/_includes/home_js.html @@ -200,40 +200,4 @@ console.log("Are you a SEBS graduate interested in helping work on our website? Please visit the link below to fill out our interest form!"); console.log("https://forms.gle/r7PGCqciGPRyn2PA6"); }); - - - function contactSubmit() { - grecaptcha.execute(); - } - - function contact(token) { - const name = document.getElementById("name").value; - const email = document.getElementById("email").value; - const message = document.getElementById("message").value; - document.getElementById("status").innerHTML = ""; - const send = document.getElementById("send"); - send.value = "Sending..."; - send.disabled = true; - - const xhttp = new XMLHttpRequest(); - xhttp.onreadystatechange = function () { - if (this.readyState === 4) { - if (this.status === 200) { - document.getElementById("name").value = ""; - document.getElementById("email").value = ""; - document.getElementById("message").value = ""; - document.getElementById("status").innerHTML = "Message has been sent!"; - } else { - document.getElementById("status").innerHTML = "There was an error sending your message. Please try again and email help@sebsscholarship.org directly if the issue persists."; - } - - const send = document.getElementById("send"); - send.value = "Send Message"; - send.disabled = false; - } - }; - xhttp.open("POST", "/email/contact.php", true); - xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - xhttp.send("name=" + name + "&email=" + email + "&message=" + message + "&token=" + token); - } \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index cdf5995..74d1ecd 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -10,7 +10,7 @@ {% include_cached loader.html %} {% include navbar.html %} {{ content }} - {% include footer.html %} + {% include_cached footer.html prefix="/" %} {% include_cached common_js.html %} \ No newline at end of file diff --git a/_layouts/home.html b/_layouts/home.html index e3945de..8d26d01 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -1,21 +1,21 @@ - - - - {% include_cached preconnect.html %} - {% include_cached analytics.html id="G-DCKNB7HP7R" %} - {% include meta.html %} - {% include links.html %} - - - {% include_cached loader.html %} - {% include navbar.html %} - {{ content }} - {% include footer.html %} - {% include_cached common_js.html %} - {% include_cached home_js.html %} - - - + + + + {% include_cached preconnect.html %} + {% include_cached analytics.html id="G-DCKNB7HP7R" %} + {% include meta.html %} + {% include links.html %} + + + {% include_cached loader.html %} + {% include navbar.html %} + {{ content }} + {% include footer.html prefix="" %} + {% include_cached common_js.html %} + {% include_cached home_js.html %} + + + \ No newline at end of file diff --git a/composer.json b/composer.json index 4e7fba2..30ecea9 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,8 @@ { - "require": { - "firebase/php-jwt": "v6.10.0", - "ext-json": "*", - "ext-curl": "*" - }, "name": "sebs-scholarship/website", - "description": "Website for the SEBS Scholarship Foundation" + "description": "Website for the SEBS Scholarship Foundation", + "require": { + "ext-curl": "*", + "ext-json": "*" + } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index e07958b..0f3953e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,72 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "172bfa03c221e384a1195c0cc35358b5", - "packages": [ - { - "name": "firebase/php-jwt", - "version": "v6.10.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", - "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", - "shasum": "" - }, - "require": { - "php": "^7.4||^8.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0" - }, - "suggest": { - "ext-sodium": "Support EdDSA (Ed25519) signatures", - "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" - }, - "type": "library", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ], - "support": { - "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" - }, - "time": "2023-12-01T16:26:39+00:00" - } - ], + "content-hash": "f149aa18693ffc5321a614d00d5e8890", + "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "stable", @@ -77,8 +13,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "ext-json": "*", - "ext-curl": "*" + "ext-curl": "*", + "ext-json": "*" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/composer.phar b/composer.phar index 76d6ceb..4723b1b 100755 Binary files a/composer.phar and b/composer.phar differ diff --git a/email/contact.php b/email/contact.php deleted file mode 100644 index 1b0b863..0000000 --- a/email/contact.php +++ /dev/null @@ -1,169 +0,0 @@ - 0 && isset($_POST["email"]) - && strlen($_POST["email"]) > 0 && isset($_POST["message"]) && strlen($_POST["message"]) > 0 - && isset($_POST["token"]) && strlen($_POST["token"]) > 0; -} - -function verifyRecaptcha($endpoint, $config): int { - $data = "secret=" . $config["rc-key"] . "&response=" . $_POST["token"]; - - $ch = curl_init($endpoint); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($ch); - $code = 0; - - if (curl_errno($ch) || curl_getinfo($ch, CURLINFO_RESPONSE_CODE) !== 200) { - $code = 1; - } elseif (json_decode($response, true)["success"] === false) { - $code = 2; - } - - curl_close($ch); - return $code; -} - -function getToken($endpoint, $config, $privateKey) { - $payload = array( - "iss" => $config['sfClientId'], - "aud" => "https://login.salesforce.com", - "sub" => $config['sfUser'], - "exp" => strval(time() + (3 * 60)) - ); - - $jwt = JWT::encode($payload, $privateKey, 'RS256'); - - $data = http_build_query(array( - 'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer', - 'assertion' => $jwt - )); - - $ch = curl_init($endpoint); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - 'Content-Type: application/x-www-form-urlencoded', - 'Content-Length: ' . strlen($data) - )); - $response = curl_exec($ch); - $token = null; - - if (!curl_errno($ch) && curl_getinfo($ch, CURLINFO_RESPONSE_CODE) === 200) { - $token = json_decode($response, true); - } - - curl_close($ch); - return $token; -} - -function createCase($endpoint, $token) { - $data = json_encode(array( - 'SuppliedName' => $_POST["name"], - 'SuppliedEmail' => $_POST["email"], - 'Subject' => "Contact Form Submission", - 'Description' => $_POST["message"], - 'Origin' => 'Contact Form' - )); - - $ch = curl_init($endpoint); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - 'Authorization: Bearer ' . $token, - 'Content-Type: application/json', - 'Content-Length: ' . strlen($data) - )); - $response = curl_exec($ch); - - $id = null; - if (!curl_errno($ch) && curl_getinfo($ch, CURLINFO_RESPONSE_CODE) == 201) { - $id = json_decode($response, true)["id"]; - } - - curl_close($ch); - return $id; -} - -function notifyRecipient($endpoint, $token, $id): bool { - $data = json_encode(array( - 'inputs' => array( - array('SObjectRowId' => $id) - ) - )); - - $ch = curl_init($endpoint); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - 'Authorization: Bearer ' . $token, - 'Content-Type: application/json', - 'Content-Length: ' . strlen($data) - )); - curl_exec($ch); - - $status = false; - if (!curl_errno($ch) && curl_getinfo($ch, CURLINFO_RESPONSE_CODE) == 200) { - $status = true; - } - - curl_close($ch); - return $status; -} - -$config = include('../../config.php'); - -$recaptchaEndpoint = "https://www.google.com/recaptcha/api/siteverify"; // reCAPTCHA API -$oauthEndpoint = "https://login.salesforce.com/services/oauth2/token"; // OAuth 2.0 Token API - -if (!validate()) { // Check if request had all required info - http_response_code(400); - exit('We\'re missing some required information! Please fill out all fields and email help@sebsscholarship.org directly if the issue persists.'); -} - -$recaptcha = verifyRecaptcha($recaptchaEndpoint, $config); // Check if reCAPTCHA verification passed -if ($recaptcha === 1) { - http_response_code(500); - exit('There was an error verifying your request.'); -} elseif ($recaptcha === 2) { - http_response_code(401); - exit('reCAPTCHA verification failed. Are you a robot?'); -} - -$response = getToken($oauthEndpoint, $config, file_get_contents('../../private')); -if (is_null($response)) { // Check if application is OAuth authenticated - http_response_code(500); - exit('There was an error authenticating your request.'); -} - -$token = $response["access_token"]; -$caseEndpoint = $response["instance_url"] . "/services/data/v53.0/sobjects/Case/"; // Authenticated Case API -$notifyEndpoint = $response["instance_url"] . "/services/data/v53.0/actions/custom/emailAlert/Case/Auto_Response/"; - -$id = createCase($caseEndpoint, $token); // Submit the case to Salesforce -if (is_null($id)) { - http_response_code(500); - exit('There was an error submitting your message.'); -} - -if (!notifyRecipient($notifyEndpoint, $token, $id)) { - http_response_code(500); - exit('There was an error sending your confirmation message.'); -} - -exit('Message has been sent!'); - - diff --git a/email/subscribe.html b/email/subscribe.html index e4d3f54..f829582 100644 --- a/email/subscribe.html +++ b/email/subscribe.html @@ -8,7 +8,7 @@

Subscribe to Our Newsletter

-

Use the form below to sign up for our quarterly newsletter! We will never share your email address, and you can always unsubscribe here.

+

Use the form below to sign up for our bi-annual newsletter! We will never share your email address, and you can always unsubscribe here.