Fix phpMyAdmin signin to handle both GET and POST parameters

- Updated phpmyadminsignin.php to accept token and username via both GET and POST
- Fixes issue where phpMyAdmin access fails when accessed with GET parameters
- Maintains backward compatibility with existing POST-based authentication
- Resolves 404 error when accessing phpMyAdmin via CyberPanel interface
This commit is contained in:
master3395
2026-01-20 17:34:00 +01:00
parent 9189e076c9
commit cfd3db52e3

View File

@@ -7,12 +7,16 @@ try {
define('PMA_SIGNON_SESSIONNAME', 'SignonSession');
define('PMA_DISABLE_SSL_PEER_VALIDATION', TRUE);
if (isset($_POST['token'])) {
// Handle both GET and POST parameters for token and username
$token = isset($_POST['token']) ? $_POST['token'] : (isset($_GET['token']) ? $_GET['token'] : null);
$username = isset($_POST['username']) ? $_POST['username'] : (isset($_GET['username']) ? $_GET['username'] : null);
if ($token && $username) {
### Get credentials using the token
$token = htmlspecialchars($_POST['token'], ENT_QUOTES, 'UTF-8');
$username = htmlspecialchars($_POST['username'], ENT_QUOTES, 'UTF-8');
$token = htmlspecialchars($token, ENT_QUOTES, 'UTF-8');
$username = htmlspecialchars($username, ENT_QUOTES, 'UTF-8');
//$url = "/dataBases/fetchDetailsPHPMYAdmin?token=" . $token . '&username=' . $username;
$url = "/dataBases/fetchDetailsPHPMYAdmin";
@@ -27,7 +31,7 @@ try {
echo '</form>';
echo '<script>document.getElementById("redirectForm").submit();</script>';
} else if (isset($_POST['logout'])) {
} else if (isset($_POST['logout']) || isset($_GET['logout'])) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 86400, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
session_destroy();