From e6d7030e7d71fe88301ed234d5d126353e6899e5 Mon Sep 17 00:00:00 2001 From: xodivorce Date: Sat, 1 Feb 2025 21:20:23 +0530 Subject: [PATCH] v4.1.1 --- README.md | 2 +- htdocs/.env.example | 9 ++++++++- htdocs/core/login_action.php | 2 +- htdocs/core/redirect_google.php | 13 +++++++++---- htdocs/login.php | 1 + 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 29f2a98f..466d5d1d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Xeorl - The All-In-One, Fully Free to Use Advanced Link Shortener and Management Tool - Powered by [@xodivorce](https://instagram.com/xodivorce) ✨ [![status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) -[![version](https://img.shields.io/badge/version-v4.1.0-yellow.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) +[![version](https://img.shields.io/badge/version-v4.1.1-yellow.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) [![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/)

diff --git a/htdocs/.env.example b/htdocs/.env.example index eee94684..64a3af32 100644 --- a/htdocs/.env.example +++ b/htdocs/.env.example @@ -4,4 +4,11 @@ DOMAIN = "Your Domain Name Here" DB_HOST = "Your Database Host Name Her" DB_USER = "Your Database Username Here" DB_PASS = "Your Database Password Here" -DB_NAME = "Your Database Name Here" \ No newline at end of file +DB_NAME = "Your Database Name Here" +SMTP_HOST = "Your SMTP Host Name Here" +SMTP_USER = "Your SMTP Username Here" +SMTP_PASS = "Your SMTP Password Here" +SMTP_PORT= "Your SMTP Port Here" +CLIENT_ID = "Your Google Client ID Here" +CLIENT_SECRET = "Your Google Client Secret Here" +REDIRECT_URI = "Your Google Redirect URI Here" diff --git a/htdocs/core/login_action.php b/htdocs/core/login_action.php index 10e476b7..92f824de 100644 --- a/htdocs/core/login_action.php +++ b/htdocs/core/login_action.php @@ -46,4 +46,4 @@ if (isset($_POST['login_btn'])) { exit(); } } -?> +?> \ No newline at end of file diff --git a/htdocs/core/redirect_google.php b/htdocs/core/redirect_google.php index 7ec5e748..a96dfdb3 100644 --- a/htdocs/core/redirect_google.php +++ b/htdocs/core/redirect_google.php @@ -3,13 +3,18 @@ session_start(); // Load Composer's autoloader require_once __DIR__ . '/vendor/autoload.php'; // Correct path for vendor directory in core require_once 'config.php'; + +// Initialize dotenv and load environment variables +$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../'); // Adjusted to point to htdocs/.env +$dotenv->load(); + error_reporting(E_ALL); ini_set('display_errors', 1); -// Google OAuth Configuration -$clientID = '1087400250877-qmns5ehmke31cd19p2cfm8111oovlnf8.apps.googleusercontent.com'; -$clientSecret = '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'; -$redirectUri = 'http://localhost/Php-Projects/xeorl/htdocs/core/redirect_google.php'; +// Database configuration +$clientID = $_ENV['CLIENT_ID']; +$clientSecret = $_ENV['CLIENT_SECRET']; +$redirectUri = $_ENV['REDIRECT_URI']; $client = new Google_Client(); $client->setClientId($clientID); diff --git a/htdocs/login.php b/htdocs/login.php index 3bf98ad7..6cc1ed04 100644 --- a/htdocs/login.php +++ b/htdocs/login.php @@ -1,6 +1,7 @@ +