pma.php 972 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. $fileToken = "IZs2cM1dmE2RluSrnUYH84kKBVjuhw";
  3. // Retrieve the token from the URL
  4. $providedToken = isset($_GET['token']) ? $_GET['token'] : '';
  5. if ($providedToken === $fileToken) {
  6. // Provided token and file token match, create a session
  7. session_set_cookie_params(0, '/', '', 0);
  8. session_name('OPENPANEL_PHPMYADMIN');
  9. session_start();
  10. $_SESSION['PMA_single_signon_user'] = 'phpmyadmin';
  11. $_SESSION['PMA_single_signon_password'] = 'cao1rsVFX0zPMq';
  12. $_SESSION['PMA_single_signon_host'] = 'localhost';
  13. session_write_close();
  14. // Remove the 'token' parameter from the query parameters
  15. unset($_GET['token']);
  16. // Construct the query parameters string
  17. $query_params_str = http_build_query($_GET);
  18. // Append query parameters to the Location header
  19. header("Location: ./index.php?$query_params_str");
  20. } else {
  21. // Handle invalid token (e.g., show an error message)
  22. echo 'Invalid token: $providedToken';
  23. }
  24. ?>