2020-08-09 12:45:18 +05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define("PMA_SIGNON_INDEX", 1);
|
|
|
|
|
|
2020-09-04 19:25:05 +05:00
|
|
|
try{
|
2020-08-09 12:45:18 +05:00
|
|
|
|
|
|
|
|
define('PMA_SIGNON_SESSIONNAME', 'SignonSession');
|
|
|
|
|
define('PMA_DISABLE_SSL_PEER_VALIDATION', TRUE);
|
|
|
|
|
|
|
|
|
|
if(isset($_GET['token'])){
|
|
|
|
|
|
|
|
|
|
### Get credentials using the token
|
|
|
|
|
|
|
|
|
|
$token = $_GET['token'];
|
|
|
|
|
$username = $_GET['username'];
|
|
|
|
|
|
|
|
|
|
$url = "/dataBases/fetchDetailsPHPMYAdmin?token=" . $token . '&username=' . $username;
|
|
|
|
|
|
|
|
|
|
header('Location: ' . $url);
|
|
|
|
|
|
|
|
|
|
}
|
2020-08-13 11:09:43 +05:00
|
|
|
else if(isset($_GET['logout'])){
|
|
|
|
|
$params = session_get_cookie_params();
|
|
|
|
|
setcookie(session_name(), '', time() - 86400, $params["path"], $params["domain"], $params["secure"], $params["httponly"] );
|
|
|
|
|
session_destroy();
|
|
|
|
|
header('Location: /dataBases/phpMyAdmin');
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-08-09 12:45:18 +05:00
|
|
|
else if(isset($_GET['password'])){
|
|
|
|
|
|
|
|
|
|
session_name(PMA_SIGNON_SESSIONNAME);
|
|
|
|
|
@session_start();
|
|
|
|
|
|
|
|
|
|
$username = $_GET['username'];
|
|
|
|
|
$password = $_GET['password'];
|
|
|
|
|
|
|
|
|
|
$_SESSION['PMA_single_signon_user'] = $username;
|
|
|
|
|
$_SESSION['PMA_single_signon_password'] = $password;
|
|
|
|
|
$_SESSION['PMA_single_signon_host'] = 'localhost';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@session_write_close();
|
|
|
|
|
|
|
|
|
|
header('Location: /phpmyadmin/index.php?server=' . PMA_SIGNON_INDEX);
|
|
|
|
|
}
|
2020-09-04 19:25:05 +05:00
|
|
|
}catch (Exception $e) {
|
|
|
|
|
echo 'Caught exception: ', $e->getMessage(), "\n";
|
|
|
|
|
}
|
2020-08-09 12:45:18 +05:00
|
|
|
|
2020-09-04 19:25:05 +05:00
|
|
|
#$url = "/dataBases/fetchDetailsPHPMYAdmin?token=FailedLogin";
|
|
|
|
|
#header('Location: ' . $url);
|