By clicking "Accept All Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.
-
-
-
- ×
+
This website uses cookies to ensure you get the best experience on our website. Learn more.
+
-
-
+
\ No newline at end of file
diff --git a/htdocs/assets/_header.php b/htdocs/assets/_header.php
index 39e58053..c8dcfc6b 100755
--- a/htdocs/assets/_header.php
+++ b/htdocs/assets/_header.php
@@ -10,10 +10,9 @@ if (session_status() === PHP_SESSION_NONE) {
Xeorl
- 4.1.4
+ 4.2.3
-
-
-
+
-
-
+
diff --git a/htdocs/assets/css/_cookies.css b/htdocs/assets/css/_cookies.css
index a9f441c1..9317b850 100644
--- a/htdocs/assets/css/_cookies.css
+++ b/htdocs/assets/css/_cookies.css
@@ -3,45 +3,104 @@
bottom: 0;
left: 0;
width: 100%;
- background: white;
+ background: #ffffff;
box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
- padding: 15px;
+ padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
- font-family: Arial, sans-serif;
z-index: 10;
+ color: #333;
+ border-top: 1px solid #ddd;
+ font-size: 14px;
+ flex-wrap: wrap;
}
#cookieBanner p {
- font-size: 14px;
- color: #333;
+ font-size: 16px;
margin: 0;
flex: 1;
+ margin-left: 1.5em;
+ max-width: 70%;
+ line-height: 1.5;
}
-button {
- padding: 10px 15px;
- border: 1px solid #002147;
- cursor: pointer;
- font-size: 14px;
- border-radius: 4px;
- margin: 0 5px;
-}
-
-.cookie-settings {
- background: white;
- color: #002147;
-}
-
-.reject, .accept {
- background: #002147;
- color: white;
-}
-
-.close {
- font-size: 18px;
+#cookieBanner a {
+ color: #677583;
font-weight: bold;
- cursor: pointer;
- margin-left: 10px;
+ text-decoration: none;
}
+
+.accept {
+ font-family: "Montserrat", sans-serif;
+ padding: 10px 20px;
+ background-color: #4d555cec;
+ margin-right: 3em;
+ color: #ffffff;
+ border: none;
+ border-radius: 20px;
+ cursor: pointer;
+ font-weight: 600;
+ font-size: 14px;
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.082);
+ outline: none;
+ box-sizing: border-box;
+ transition: box-shadow 0.3s ease, background-color 0.3s ease;
+}
+
+.accept:hover {
+ background-color: #171C24;
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.250);
+}
+
+/* Mobile and Tablet Responsive Styles */
+@media (max-width: 720px) {
+ #cookieBanner p {
+ font-size: 16px;
+ margin: 0;
+ flex: 1;
+ margin-left: 1.5em;
+ max-width: 70%;
+ line-height: 1.5;
+ }
+
+ #cookieBanner a {
+ color: #677583;
+ font-weight: bold;
+ text-decoration: none;
+ }
+ .accept {
+ background-color:#171C24 ;
+
+ }
+
+}
+
+@media (max-width: 509px) {
+ #cookieBanner p {
+ font-size: 14px;
+ margin: 0;
+ flex: 1;
+ margin-left: 1.5em;
+ max-width: 70%;
+ line-height: 1.5;
+ }
+
+ #cookieBanner a {
+ text-decoration: none;
+ }
+ .accept {
+ font-size: 12px;
+ background-color:#171C24 ;
+ padding: 9px 18px;
+ }
+}
+
+@media (max-width: 409px){
+
+ .accept {
+ font-size: 12px;
+ background-color:#171C24 ;
+ padding: 8px 16px;
+ }
+}
\ No newline at end of file
diff --git a/htdocs/assets/css/_unzipper.css b/htdocs/assets/css/_unzipper.css
index 0c5ce844..3e0defb4 100644
--- a/htdocs/assets/css/_unzipper.css
+++ b/htdocs/assets/css/_unzipper.css
@@ -52,7 +52,6 @@ h2 {
.countdown {
font-size: 16px;
font-weight: 400;
- margin-top: -px;
color: rgb(70, 41, 204);
text-align: center;
}
@@ -83,17 +82,19 @@ button:active {
box-shadow: rgba(68, 68, 68, 0.572) 3px 2px 10px 0px;
cursor: pointer;
}
-@media (max-width: 1170px){
- .container{
+@media (max-width: 1170px) {
+ .container {
width: 650px;
}
}
-@media (max-width: 1024px){
- .container{
+
+@media (max-width: 1024px) {
+ .container {
width: 500px;
}
}
+
@media (max-width: 768px) {
.container {
padding: 40px 20px;
@@ -129,7 +130,6 @@ button:active {
font-size: 22px;
}
-
.countdown span {
font-size: 18px;
}
diff --git a/htdocs/assets/js/_cookies.js b/htdocs/assets/js/_cookies.js
new file mode 100644
index 00000000..b01afb26
--- /dev/null
+++ b/htdocs/assets/js/_cookies.js
@@ -0,0 +1,12 @@
+function acceptCookies() {
+ document.cookie = "user_cookies=accepted; path=/; max-age=" + 60*60*24*30;
+ document.getElementById("cookieBanner").style.display = "none";
+}
+
+window.onload = function() {
+ if (document.cookie.indexOf("user_cookies") === -1) {
+ document.getElementById("cookieBanner").style.display = "flex";
+ } else {
+ document.getElementById("cookieBanner").style.display = "none";
+ }
+};
diff --git a/htdocs/assets/js/_developer_tools.js b/htdocs/assets/js/_developer_tools.js
new file mode 100755
index 00000000..d5150047
--- /dev/null
+++ b/htdocs/assets/js/_developer_tools.js
@@ -0,0 +1,23 @@
+(function() {
+ function checkDevTools() {
+ console.clear();
+ console.log('%cSTOP!', 'color: red; font-size: 50px; font-weight: bold;');
+ console.log('%cThis is a browser feature intended for developers.', 'color: white; background: red; font-size: 16px; padding: 5px;');
+ console.log('%cIf someone told you to copy-paste something here to enable a premium feature or "hack" someone\'s account, it is a scam and will give them access to your Xeorl account.', 'color: white; background: black; font-size: 14px; padding: 5px;');
+ }
+
+ function detectDevTools() {
+ const threshold = 160;
+ const widthThreshold = 400;
+
+ if (
+ window.outerHeight - window.innerHeight > threshold ||
+ window.outerWidth - window.innerWidth > widthThreshold
+ ) {
+ checkDevTools();
+ }
+ }
+
+ window.addEventListener('resize', detectDevTools);
+ setInterval(detectDevTools, 1000);
+})();
diff --git a/htdocs/assets/js/_email.js b/htdocs/assets/js/_email.js
index 66529b05..477b7517 100644
--- a/htdocs/assets/js/_email.js
+++ b/htdocs/assets/js/_email.js
@@ -1,13 +1,7 @@
function storeEmailAndContinue() {
- // Get the email entered by the user
var email = document.getElementById('email').value;
-
- // Store the email in sessionStorage
sessionStorage.setItem('userEmail', email);
-
- // Redirect to the next step
location.href = 'forgot_pass_step_two.php';
}
- // Retrieve the email from sessionStorage and display it
- document.getElementById('userEmail').textContent = sessionStorage.getItem('userEmail') || 'hygeonhealth@example.com';
+document.getElementById('userEmail').textContent = sessionStorage.getItem('userEmail') || 'supportxeorl@example.com';
diff --git a/htdocs/assets/js/_forgot_pass.js b/htdocs/assets/js/_forgot_pass.js
index ee53ca16..eea2e0a4 100644
--- a/htdocs/assets/js/_forgot_pass.js
+++ b/htdocs/assets/js/_forgot_pass.js
@@ -1,66 +1,33 @@
-// // Array of background image sources
-// const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg', 'assets/images/dna3.jpg', 'assets/images/dna4.jpg'];
-// let currentIndex = 0;
-
-// function changeBackgroundImage() {
-// const imgElement = document.getElementById('background-image');
-// // Fade out
-// imgElement.style.opacity = 0;
-
-// setTimeout(() => {
-// // Change image source
-// currentIndex = (currentIndex + 1) % images.length;
-// imgElement.src = images[currentIndex];
-
-// // Fade in
-// imgElement.style.opacity = 1;
-// }, 800); // Match this timeout with the CSS transition duration
-// }
-
-// // Change image every 5 seconds
-// setInterval(changeBackgroundImage, 5000);
-
-
-// Password visibility toggle logic
const passwordField = document.getElementById('password-field');
const togglePassword = document.getElementById('toggle-password');
togglePassword.addEventListener('click', function () {
- // Toggle between 'password' and 'text'
const type = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
passwordField.setAttribute('type', type);
-
- // Optionally toggle the eye icon image (if different images are needed)
this.src = type === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
});
-// Password Reset Function
function togglePasswordVisibility() {
const confirmPasswordInput = document.getElementById('confirmPassword');
- if (confirmPasswordInput.type === 'password') {
- confirmPasswordInput.type = 'text'; // Show password
- } else {
- confirmPasswordInput.type = 'password'; // Hide password
- }
+ confirmPasswordInput.type = confirmPasswordInput.type === 'password' ? 'text' : 'password';
}
-// Conform Password Seen Function
+
function resetPassword() {
const newPassword = document.getElementById('newPassword').value;
const confirmPassword = document.getElementById('confirmPassword').value;
const validationMessage = document.getElementById('validation-message');
if (newPassword.length < 8) {
- showMessage('Password must be at least 8 characters long.', '#FF0000'); // Red color for error
+ showMessage('Password must be at least 8 characters long.', '#FF0000');
return;
}
if (newPassword !== confirmPassword) {
- showMessage('Passwords do not match. Please try again.', '#FF0000'); // Red color for error
+ showMessage('Passwords do not match. Please try again.', '#FF0000');
return;
}
- // Redirect or submit form after validation
- location.href = 'password_reset_success.php'; // Change this to your success page
+ location.href = 'password_reset_success.php';
}
function showMessage(message, color) {
@@ -69,8 +36,7 @@ function showMessage(message, color) {
validationMessage.style.color = color;
validationMessage.style.display = 'block';
- // Hide the message after 5 seconds (5000ms)
setTimeout(function() {
validationMessage.style.display = 'none';
}, 5000);
-}
\ No newline at end of file
+}
diff --git a/htdocs/assets/js/_header.js b/htdocs/assets/js/_header.js
index 5f2fecb6..09686cd3 100644
--- a/htdocs/assets/js/_header.js
+++ b/htdocs/assets/js/_header.js
@@ -2,7 +2,6 @@ document.addEventListener("DOMContentLoaded", function () {
const burgerToggle = document.getElementById("burger-toggle");
const sidebar = document.querySelector(".sidebar");
- // Ensure sidebar is hidden initially
sidebar.style.display = "none";
burgerToggle.addEventListener("click", function () {
@@ -17,12 +16,11 @@ document.addEventListener("DOMContentLoaded", function () {
});
window.addEventListener('scroll', function () {
- const header = document.querySelector('.header'); // Get the header element
+ const header = document.querySelector('.header');
- // Check if the page has been scrolled
if (window.scrollY > 0) {
- header.classList.add('scrolled'); // Add the "scrolled" class
+ header.classList.add('scrolled');
} else {
- header.classList.remove('scrolled'); // Remove the "scrolled" class
+ header.classList.remove('scrolled');
}
});
diff --git a/htdocs/assets/js/_home.js b/htdocs/assets/js/_home.js
index a8e8b6d7..c2ebb62d 100755
--- a/htdocs/assets/js/_home.js
+++ b/htdocs/assets/js/_home.js
@@ -3,7 +3,6 @@ const form = document.querySelector(".shorten-form"),
shortenBtn = document.querySelector("#shorten-btn"),
linksList = document.querySelector("#links-list");
-// Clear the list and show the "You don't have any shortened links" message
function resetLinksList() {
linksList.innerHTML = `
@@ -18,7 +17,6 @@ function resetLinksList() {
`;
}
-// Check session storage for existing links on page load
document.addEventListener("DOMContentLoaded", () => {
const savedLinks = sessionStorage.getItem("shortenedLinks");
if (savedLinks) {
@@ -35,17 +33,15 @@ shortenBtn.onclick = () => {
if (xhr.readyState == 4 && xhr.status == 200) {
let data = xhr.response;
if (data.length <= 5) {
- //This is your domain name
- const domain = "xeorl.buzz/";
+ // This is your shoeten domain name
+ const domain = "http://localhost/Php-Projects/xeorl/htdocs//";
let shortenURL = domain + data;
- // Remove the default message if it exists
const defaultMessage = document.getElementById("default-message");
if (defaultMessage) {
defaultMessage.remove();
}
- // Add the new link to the list
let newRow = `
@@ -58,12 +54,9 @@ shortenBtn.onclick = () => {
`;
- // Append the new link to the list and update session storage
linksList.insertAdjacentHTML('afterbegin', newRow);
sessionStorage.setItem("shortenedLinks", linksList.innerHTML);
-
- // Clear the input field
- urlInput.value = "";
+ urlInput.value = "";
} else {
alert(data);
}
@@ -74,7 +67,6 @@ shortenBtn.onclick = () => {
xhr.send(formData);
};
-// Handle copy button clicks
document.addEventListener('click', function(e) {
if (e.target.closest('.copy-btn')) {
const linkInfo = e.target.closest('li').querySelector('.short-link').textContent;
@@ -84,13 +76,13 @@ document.addEventListener('click', function(e) {
}
});
-// Handle members only delete button clicks!!
document.addEventListener('click', function(e) {
if (e.target.closest('.delete-btn')) {
alert("This feature is available for members only.");
}
});
+
// Handle delete button clicks
/*
document.addEventListener('click', function(e) {
@@ -118,5 +110,3 @@ document.addEventListener('click', function(e) {
}
});*/
-
-
diff --git a/htdocs/assets/js/_login.js b/htdocs/assets/js/_login.js
index 6213243a..b2d623ae 100644
--- a/htdocs/assets/js/_login.js
+++ b/htdocs/assets/js/_login.js
@@ -1,6 +1,3 @@
-// script.js
-
-// Add any form validation or interactivity here, like checking if the fields are filled
document.querySelector("form").addEventListener("submit", function(event) {
const inputs = document.querySelectorAll(".input-field");
let valid = true;
@@ -15,40 +12,14 @@ document.querySelector("form").addEventListener("submit", function(event) {
});
if (!valid) {
- event.preventDefault(); // Prevent form submission if validation fails
+ event.preventDefault();
alert("Please fill all the fields.");
}
});
-
document.getElementById('toggle-password').addEventListener('click', function () {
const passwordField = document.getElementById('password-field');
const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
passwordField.setAttribute('type', passwordType);
-
- // Optionally, you can change the eye icon to an "eye-off" icon when the password is visible
this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
});
-
- // // Array of background image sources
- // const images = ['assets/images/wire.jpg', 'assets/images/internet.jpg','assets/images/redworld.jpg','assets/images/travel.jpg'];
- // let currentIndex = 0;
-
- // function changeBackgroundImage() {
- // const imgElement = document.getElementById('background-image');
- // // Fade out
- // imgElement.style.opacity = 0;
-
- // setTimeout(() => {
- // // Change image source
- // currentIndex = (currentIndex + 1) % images.length;
- // imgElement.src = images[currentIndex];
-
- // // Fade in
- // imgElement.style.opacity = 1;
- // }, 800); // Match this timeout with the CSS transition duration
- // }
-
- // // Change image every 5 seconds
- // setInterval(changeBackgroundImage, 5000);
-
\ No newline at end of file
diff --git a/htdocs/assets/js/_register.js b/htdocs/assets/js/_register.js
index ccb44675..b19459e5 100644
--- a/htdocs/assets/js/_register.js
+++ b/htdocs/assets/js/_register.js
@@ -1,10 +1,7 @@
-// script.js
-
-// Add any form validation or interactivity here, like checking if the fields are filled
document.querySelector("form").addEventListener("submit", function(event) {
const inputs = document.querySelectorAll(".input-field");
let valid = true;
-
+
inputs.forEach(input => {
if (input.value === "") {
valid = false;
@@ -15,39 +12,29 @@ document.querySelector("form").addEventListener("submit", function(event) {
});
if (!valid) {
- event.preventDefault(); // Prevent form submission if validation fails
+ event.preventDefault();
alert("Please fill all the fields.");
}
});
-
-document.getElementById('toggle-password').addEventListener('click', function () {
+document.getElementById('toggle-password').addEventListener('click', function() {
const passwordField = document.getElementById('password-field');
const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
passwordField.setAttribute('type', passwordType);
-
- // Optionally, you can change the eye icon to an "eye-off" icon when the password is visible
this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
});
- // // Array of background image sources
- // const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg','assets/images/dna3.jpg','assets/images/dna4.jpg'];
- // let currentIndex = 0;
+function toggleSubmitButton() {
+ const checkbox = document.getElementById("agree");
+ const submitBtn = document.getElementById("submit-btn");
+ const errorMessage = document.getElementById("error-message");
- // function changeBackgroundImage() {
- // const imgElement = document.getElementById('background-image');
- // // Fade out
- // imgElement.style.opacity = 0;
+ if (checkbox.checked) {
+ submitBtn.disabled = false;
+ errorMessage.style.display = "none";
+ } else {
+ submitBtn.disabled = true;
+ }
+}
- // setTimeout(() => {
- // // Change image source
- // currentIndex = (currentIndex + 1) % images.length;
- // imgElement.src = images[currentIndex];
-
- // // Fade in
- // imgElement.style.opacity = 1;
- // }, 800); // Match this timeout with the CSS transition duration
- // }
-
- // // Change image every 5 seconds
- // setInterval(changeBackgroundImage, 5000);
\ No newline at end of file
+document.addEventListener("DOMContentLoaded", toggleSubmitButton);
diff --git a/htdocs/assets/js/_unzipper.js b/htdocs/assets/js/_unzipper.js
index cde65ce2..a8c88bf1 100644
--- a/htdocs/assets/js/_unzipper.js
+++ b/htdocs/assets/js/_unzipper.js
@@ -1,4 +1,3 @@
-// Countdown logic
let countdown = 10;
let countdownInterval;
const timerElement = document.getElementById("timer");
@@ -10,15 +9,15 @@ function updateCountdown() {
timerElement.textContent = countdown;
}
if (countdown <= 0) {
- button.disabled = false; // Enable the button when countdown ends
- button.classList.add("active"); // Optional, if you use active class for style
- button.style.cursor = "pointer"; // Enable cursor
- setTimeout(function () {
- button.textContent = "Getting links..."; // Change text before enabling
- }, 300); // 0.3 seconds delay
- setTimeout(function () {
- button.textContent = "Get link"; // Final button text
- }, 600); // After another 0.3 seconds
+ button.disabled = false;
+ button.classList.add("active");
+ button.style.cursor = "pointer";
+ setTimeout(() => {
+ button.textContent = "Getting links...";
+ }, 300);
+ setTimeout(() => {
+ button.textContent = "Get link";
+ }, 600);
clearInterval(countdownInterval);
}
}
@@ -32,14 +31,12 @@ function stopCountdown() {
}
function init() {
- // Initialize countdown value and button state
countdown = 10;
timerElement.textContent = countdown;
button.disabled = true;
button.classList.remove("active");
button.style.cursor = "not-allowed";
button.textContent = "PLEASE WAIT...";
-
startCountdown();
}
@@ -52,11 +49,11 @@ document.addEventListener("visibilitychange", () => {
});
window.addEventListener("beforeunload", () => {
- init(); // Reset state when the page is about to be unloaded
+ init();
});
-init(); // Call init to initialize the countdown when the page loads
+init();
function redirect() {
- window.location.href = redirectUrl; // Redirect to the full URL
+ window.location.href = redirectUrl;
}
diff --git a/htdocs/assets/js/developer_tools.js b/htdocs/assets/js/developer_tools.js
deleted file mode 100755
index 7459ca03..00000000
--- a/htdocs/assets/js/developer_tools.js
+++ /dev/null
@@ -1,23 +0,0 @@
-//Right-click disable
-document.addEventListener('contextmenu', event => event.preventDefault());
-
-// Disable common keyboard shortcuts for developer tools
- document.addEventListener('keydown', function(event) {
- if (event.ctrlKey && (event.key === 'I' || event.key === 'i' || event.key === 'J' || event.key === 'j' || event.key === 'U' || event.key === 'u')) {
- event.preventDefault();
- }
- if (event.key === 'F12') {
- event.preventDefault();
- }
- });
-
- // Detect developer tools opening
- (function() {
- const element = new Image();
- Object.defineProperty(element, 'id', {
- get: function() {
- alert('Developer tools opened!');
- }
- });
- console.log(element);
- })();
\ No newline at end of file
diff --git a/htdocs/core/config.php b/htdocs/core/config.php
index 7236c456..5afc8008 100755
--- a/htdocs/core/config.php
+++ b/htdocs/core/config.php
@@ -1,18 +1,15 @@
load();
-// Database configuration
$host = $_ENV['DB_HOST'];
$user = $_ENV['DB_USER'];
$pass = $_ENV['DB_PASS'];
$db = $_ENV['DB_NAME'];
-// Establish database connection
$conn = mysqli_connect($host, $user, $pass, $db);
if (!$conn) {
die("Database connection error: " . mysqli_connect_error());
diff --git a/htdocs/core/forgot_pass_action_one.php b/htdocs/core/forgot_pass_action_one.php
index c83a6141..87885a5f 100644
--- a/htdocs/core/forgot_pass_action_one.php
+++ b/htdocs/core/forgot_pass_action_one.php
@@ -1,10 +1,8 @@
load();
-// Database connection
require_once 'config.php';
$email = $_POST['email'];
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
- // Generate a 6-digit OTP
- $otp = rand(100000, 999999); // 6-digit OTP
+ $otp = rand(100000, 999999);
- // Update the OTP in the database using mysqli
$sql = "UPDATE user SET user_otp = '$otp' WHERE user_email = '$email'";
if ($conn->query($sql) === TRUE) {
- // Send OTP email
$mail = new PHPMailer(true);
try {
- // Server settings
$mail->isSMTP();
- $mail->Host = $_ENV['SMTP_HOST']; // Set the SMTP server to send through
+ $mail->Host = $_ENV['SMTP_HOST'];
$mail->SMTPAuth = true;
- $mail->Username = $_ENV['SMTP_USER']; // SMTP username
- $mail->Password = $_ENV['SMTP_PASS']; // SMTP password
+ $mail->Username = $_ENV['SMTP_USER'];
+ $mail->Password = $_ENV['SMTP_PASS'];
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = $_ENV['SMTP_PORT'];
- // Recipients
$mail->setFrom($_ENV['SMTP_USER'], 'Xeorl Support');
- $mail->addAddress($email); // Add a recipient
+ $mail->addAddress($email);
- // Content
$mail->isHTML(true);
$mail->Subject = 'Password Reset - Xeorl';
$mail->Body =
@@ -62,11 +53,11 @@ if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$mail->AltBody = 'Your OTP code is ' . $otp;
$mail->send();
- // Redirect to ../forgot_pass_step_two.php
- session_start(); // Start the session
- $_SESSION['email'] = $email; // Store the email in the session
- header('Location: ../forgot_pass_step_two.php'); // Redirect to the next page
- exit; // Ensure no further script execution after redirection
+
+ session_start();
+ $_SESSION['email'] = $email;
+ header('Location: ../forgot_pass_step_two.php');
+ exit;
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
diff --git a/htdocs/core/forgot_pass_action_three.php b/htdocs/core/forgot_pass_action_three.php
index 4613ce28..3e86dd4e 100644
--- a/htdocs/core/forgot_pass_action_three.php
+++ b/htdocs/core/forgot_pass_action_three.php
@@ -1,10 +1,9 @@
query($sql); // Execute the query
+ $sql = "SELECT user_otp FROM user WHERE user_email = ?";
+ $stmt = $conn->prepare($sql);
+ $stmt->bind_param('s', $email);
+ $stmt->execute();
+ $result = $stmt->get_result();
if ($result && $result->num_rows > 0) {
$row = $result->fetch_assoc();
- $dbOtp = $row['user_otp']; // Fetch the OTP from the result set
+ $dbOtp = $row['user_otp'];
- // Check if the OTP entered by the user matches the one in the database
if ($userOtp == $dbOtp) {
- // OTP is correct, redirect to the next step
header('Location: ../forgot_pass_step_three.php');
exit;
} else {
- // OTP is incorrect, set error message
$_SESSION['error_message'] = "Invalid OTP. Please double-check the OTP.";
header('Location: ../forgot_pass_step_two.php');
exit;
}
} else {
- // Query failed or no result, set error message
$_SESSION['error_message'] = "Failed to retrieve OTP from the database.";
header('Location: ../forgot_pass_step_two.php');
exit;
}
} else {
- // If email or OTP is empty, set error message
$_SESSION['error_message'] = "Please fill out the OTP.";
header('Location: ../forgot_pass_step_two.php');
exit;
diff --git a/htdocs/core/get_session_links.php b/htdocs/core/get_session_links.php
index 73d00474..c731d986 100644
--- a/htdocs/core/get_session_links.php
+++ b/htdocs/core/get_session_links.php
@@ -4,12 +4,10 @@ include "config.php";
error_reporting(E_ALL);
ini_set('display_errors', 1);
-// Check if the session variable for storing shortened links exists
if (!isset($_SESSION['shortened_links'])) {
$_SESSION['shortened_links'] = array();
}
-// Retrieve and return the list of shortened links for the current session
$links = array();
foreach ($_SESSION['shortened_links'] as $link_id) {
$sql = mysqli_query($conn, "SELECT * FROM url WHERE id = '{$link_id}'");
diff --git a/htdocs/core/get_statistics.php b/htdocs/core/get_statistics.php
index 8f277ce2..bde87281 100644
--- a/htdocs/core/get_statistics.php
+++ b/htdocs/core/get_statistics.php
@@ -1,16 +1,12 @@
diff --git a/htdocs/core/login_action.php b/htdocs/core/login_action.php
index 667dc418..a4ce3eff 100644
--- a/htdocs/core/login_action.php
+++ b/htdocs/core/login_action.php
@@ -8,7 +8,6 @@ if (isset($_POST['login_btn'])) {
$email = mysqli_real_escape_string($conn, $_POST['user_email']);
$password = $_POST['user_pass'];
- // Check if the email exists
$stmt = mysqli_prepare($conn, "SELECT * FROM user WHERE user_email = ?");
mysqli_stmt_bind_param($stmt, "s", $email);
mysqli_stmt_execute($stmt);
@@ -17,22 +16,18 @@ if (isset($_POST['login_btn'])) {
if (mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
- // Check if the user is banned
if ($row['user_type'] == 4) {
$_SESSION['error'] = "Your account is banned. Please contact support.";
header('Location: ../login.php');
exit();
}
- // Verify the password
if (password_verify($password, $row['user_pass'])) {
- // Set session variables
$_SESSION['user_id'] = $row['id'];
$_SESSION['user_name'] = $row['user_name'];
$_SESSION['user_email'] = $row['user_email'];
$_SESSION['user_type'] = $row['user_type'];
- // Redirect to monetization after successful login
header('Location: ../monetization.php');
exit();
} else {
@@ -46,4 +41,4 @@ if (isset($_POST['login_btn'])) {
exit();
}
}
-?>
\ No newline at end of file
+?>
diff --git a/htdocs/core/process.php b/htdocs/core/process.php
index 273cac1b..b3505891 100644
--- a/htdocs/core/process.php
+++ b/htdocs/core/process.php
@@ -1,57 +1,42 @@
load();
-// Retrieve environment variables
$host = $_ENV['DB_HOST'];
$user = $_ENV['DB_USER'];
$pass = $_ENV['DB_PASS'];
$db = $_ENV['DB_NAME'];
-// Establish database connection
$conn = mysqli_connect($host, $user, $pass, $db);
if (!$conn) {
die("Database connection error: " . mysqli_connect_error());
}
-// Initialize the shortened URL variable
$new_url = "";
-// Check if there's a GET request and process the shortened URL
if (isset($_GET)) {
foreach ($_GET as $key => $val) {
$u = mysqli_real_escape_string($conn, $key);
$new_url = str_replace('/', '', $u);
}
- // Query the database for the full URL associated with the shortened URL
$sql = mysqli_query($conn, "SELECT full_url FROM url WHERE shorten_url = '{$new_url}'");
if (mysqli_num_rows($sql) > 0) {
- // Increment the click count for the shortened URL
$sql2 = mysqli_query($conn, "UPDATE url SET clicks = clicks + 1 WHERE shorten_url = '{$new_url}'");
if ($sql2) {
- // Fetch the full URL and store it in the session
$full_url = mysqli_fetch_assoc($sql);
$_SESSION['redirect_url'] = $full_url['full_url'];
-
- // Instead of header redirect, include the unzipper.php page here
- include 'unzipper.php'; // Include the unzipper.php page in this URL
- exit(); // Exit to ensure the rest of the script doesn't run
+ include 'unzipper.php';
+ exit();
}
- } else {
-
}
}
?>
diff --git a/htdocs/core/redirect_google.php b/htdocs/core/redirect_google.php
index 6ad4c156..3e61579f 100644
--- a/htdocs/core/redirect_google.php
+++ b/htdocs/core/redirect_google.php
@@ -1,17 +1,14 @@
load();
error_reporting(E_ALL);
ini_set('display_errors', 1);
-// Database configuration
$clientID = $_ENV['CLIENT_ID'];
$clientSecret = $_ENV['CLIENT_SECRET'];
$redirectUri = $_ENV['REDIRECT_URI'];
@@ -34,33 +31,28 @@ if (isset($_GET['code'])) {
$name = $google_account_info->name;
$email = $google_account_info->email;
- // Check if user exists in database
$stmt = $conn->prepare("SELECT id, user_name, user_email, user_type FROM user WHERE google_id = ? OR user_email = ?");
$stmt->bind_param("ss", $google_id, $email);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows == 0) {
- // Insert new user
- $default_user_type = 3; // Default user type
+ $default_user_type = 3;
$stmt = $conn->prepare("INSERT INTO user (google_id, user_email, user_name, user_type) VALUES (?, ?, ?, ?)");
$stmt->bind_param("sssi", $google_id, $email, $name, $default_user_type);
$stmt->execute();
$user_id = $stmt->insert_id;
} else {
- // User exists, fetch user ID
$row = $result->fetch_assoc();
$user_id = $row['id'];
$name = $row['user_name'];
$email = $row['user_email'];
}
- // Store user session
$_SESSION['user_id'] = $user_id;
$_SESSION['user_name'] = $name;
$_SESSION['user_email'] = $email;
- // Redirect to monetization
header("Location: ../monetization.php");
exit();
} else {
diff --git a/htdocs/core/register_action.php b/htdocs/core/register_action.php
index 1a618778..7b744ab7 100644
--- a/htdocs/core/register_action.php
+++ b/htdocs/core/register_action.php
@@ -1,57 +1,52 @@
query($checkEmail);
+ if (isset($_POST['submit_btn'])) {
+ $fName = mysqli_real_escape_string($conn, $_POST['f_name']);
+ $lName = mysqli_real_escape_string($conn, $_POST['l_name']);
+ $email = mysqli_real_escape_string($conn, $_POST['user_email']);
+ $password = mysqli_real_escape_string($conn, $_POST['user_pass']);
+ $uName = $fName . " " . $lName;
+ $uType = 3;
- if ($result->num_rows > 0) {
- // Store the error message in the session
- $_SESSION['error'] = "Email already exists. Please use a different email.";
- header('Location: ../register.php'); // Redirect to the register page
- exit();
- } else {
- // Hash the password before storing it
- $hashedPassword = password_hash($password, PASSWORD_BCRYPT);
-
- // Insert the user data with hashed password
- $sql = "INSERT INTO user (`user_name`, `user_email`, `user_pass`, `user_type`, `user_otp`)
- VALUES ('$uName', '$email', '$hashedPassword', '$uType', NULL)";
-
- if ($conn->query($sql) === TRUE) {
- // Get the user ID of the newly registered user
- $userId = $conn->insert_id;
-
- // Optionally, send an email or OTP for verification here
-
- // Redirect to login page after successful registration
- header('Location: ../login.php');
- exit();
- } else {
- $_SESSION['error'] = "Error: " . $sql . " " . $conn->error;
+ if (strlen($password) < 8) {
+ $_SESSION['error'] = "Password must be at least 8 characters long.";
header('Location: ../register.php');
exit();
}
- }
-}
-$conn->close();
+ $checkEmail = "SELECT * FROM user WHERE user_email = '$email'";
+ $result = $conn->query($checkEmail);
+
+ if ($result->num_rows > 0) {
+ $_SESSION['error'] = "Email already exists. Please use a different email.";
+ header('Location: ../register.php');
+ exit();
+ } else {
+ $hashedPassword = password_hash($password, PASSWORD_BCRYPT);
+ $sql = "INSERT INTO user (`user_name`, `user_email`, `user_pass`, `user_type`, `user_otp`)
+ VALUES ('$uName', '$email', '$hashedPassword', '$uType', NULL)";
+
+ if ($conn->query($sql) === TRUE) {
+ $userId = $conn->insert_id;
+ header('Location: ../login.php');
+ exit();
+ } else {
+ $_SESSION['error'] = "Error: " . $sql . " " . $conn->error;
+ header('Location: ../register.php');
+ exit();
+ }
+ }
+ }
+
+ $conn->close();
+}
?>
diff --git a/htdocs/core/resend.php b/htdocs/core/resend.php
index cef22d0f..6be517be 100644
--- a/htdocs/core/resend.php
+++ b/htdocs/core/resend.php
@@ -1,70 +1,46 @@
load();
-// Check if the email is stored in the session
if (isset($_SESSION['email'])) {
$email = $_SESSION['email'];
+ $otp = rand(100000, 999999);
- // Generate a new 6-digit OTP
- $otp = rand(100000, 999999); // Change this to generate a 6-digit OTP
-
- // Update the OTP in the database for the user using mysqli
$sql = "UPDATE user SET user_otp = '$otp' WHERE user_email = '$email'";
if (mysqli_query($conn, $sql)) {
- // Send the OTP to the user's email
$mail = new PHPMailer(true);
try {
- // Server settings
$mail->isSMTP();
- $mail->Host = $_ENV['SMTP_HOST']; // SMTP server
- $mail->SMTPAuth = true;
- $mail->Username = $_ENV['SMTP_USER']; // SMTP username
- $mail->Password = $_ENV['SMTP_PASS']; // SMTP password
+ $mail->Host = $_ENV['SMTP_HOST'];
+ $mail->SMTPAuth = true;
+ $mail->Username = $_ENV['SMTP_USER'];
+ $mail->Password = $_ENV['SMTP_PASS'];
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
- $mail->Port = $_ENV['SMTP_PORT'];
+ $mail->Port = $_ENV['SMTP_PORT'];
- // Recipients
$mail->setFrom($_ENV['SMTP_USER'], 'Xeorl Support');
- $mail->addAddress($email); // Add a recipient
+ $mail->addAddress($email);
- // Content
$mail->isHTML(true);
$mail->Subject = 'Password Reset - Xeorl';
- $mail->Body =
- 'Hello User,
- Your one time password: ' . $otp . '.
-
- Your one-time password (OTP) is valid for a single session. If you refresh the page or exit the Next Step portal, you will need to regenerate a new OTP.
-
- If you did not request this OTP, please contact us immediately at www.xeorl.buzz
Your one-time password (OTP) is valid for a single session. If you refresh the page or exit the Next Step portal, you will need to regenerate a new OTP.
If you did not request this OTP, please contact us immediately at www.xeorl.buzz