| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/metrics.elancointeractives.com/elanco-metrics/app/controller/ |
Upload File : |
<?php
if (isset($_GET['logout'])) {
$auth->logOut();
}
// Required CSS and JS
$required_css = array('index');
$required_js = array('index' => 1);
// Chnage default meta details
$pagedata['title'] = "Elanco - Admin";
$pagedata['description'] = "Elanco - Admin";
$pagedata['og:title'] = "Elanco - Admin";
$pagedata['og:description'] = "Elanco - Admin";
// Create a user
/*
$new_email = 'chris.fairhurst@wondermakr.com';
$new_password = 'elanco1954';
$new_username = 'admin2025';
try {
$userId = $auth->admin()->createUser( $new_email, $new_password, $new_username );
echo 'We have signed up a new user with the ID ' . $userId;
} catch ( \Delight\Auth\InvalidEmailException $e ) {
die( 'Invalid email address' );
} catch ( \Delight\Auth\InvalidPasswordException $e ) {
die( 'Invalid password' );
} catch ( \Delight\Auth\UserAlreadyExistsException $e ) {
die( 'User already exists' );
}
try {
$auth->admin()->addRoleForUserById($userId, \Delight\Auth\Role::ADMIN);
} catch (\Delight\Auth\UnknownIdException $e) {
die('Unknown user ID');
}
exit();
*/
$error = '';
if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
try {
$auth->loginWithUsername($_POST['user-name'], $_POST['password']);
header('Location: dashboard');
exit();
} catch (\Delight\Auth\UnknownUsernameException $e) {
$error = 'Unknown username';
} catch (\Delight\Auth\AmbiguousUsernameException $e) {
$error = 'Unknown username';
} catch (\Delight\Auth\InvalidPasswordException $e) {
$error = 'Wrong password';
} catch (\Delight\Auth\EmailNotVerifiedException $e) {
$error = 'Email not verified';
} catch (\Delight\Auth\TooManyRequestsException $e) {
$error = 'Too many requests';
}
}
// Load the view
require ($cfg['server_path'].'/view/v-index.php');
?>