require_once $curr_path . "/../../../../lib/php/webapp_token_access.inc.php"; $extplorer_dir = sprintf("%s/../extplorer/current", $curr_path); $app_name = "extplorer"; session_name($app_name); $vhost = dp_derive_gen_vhost(); $is_logged_in = dp_is_already_logged_to_app($app_name); if (!$is_logged_in && !($token = dp_get_app_token_from_url())) { echo "Access denied. Unable to verify app token.\n"; exit(1); } else { if (!$is_logged_in && dp_has_valid_token($vhost, $app_name, $token)) { dp_start_app_session($vhost, $app_name, $token); header('Location: ' . str_replace("/{$token}", "", $_SERVER['SCRIPT_URI']) . '/index.php'); exit; } else { if ($is_logged_in && dp_get_app_token_from_url()) { $file = 'index.php'; } } } $file = isset($file) ? $file : basename($_SERVER['PATH_INFO']); if ($file == '') { header('Location: ' . str_replace("/{$token}", "", $_SERVER['SCRIPT_URI']) . '/index.php'); exit; } if ($file == 'index.php') { if (isset($_GET['action']) && $_GET['action'] == 'logout') { setcookie('we_logout'); } if (isset($_GET['mode']) && $_GET['mode'] == '1') { $_SESSION['xtp_wrapper_advanced_user'] = true;
<?php $curr_path = dirname(__FILE__); require_once $curr_path . "/../../../../lib/php/webapp_token_access.inc.php"; $app_name = "phpmyadmin"; session_name("devpanel_{$app_name}"); $vhost = dp_derive_gen_vhost(); $is_logged_in = dp_is_already_logged_to_app($app_name); if (!$is_logged_in) { if (($token = dp_get_app_token_from_url()) && dp_has_valid_token($vhost, $app_name, $token)) { dp_start_app_session($vhost, $app_name, $token); header('Location: ' . str_replace("/{$token}", "/", $_SERVER['SCRIPT_URI']) . '/index.php'); exit(0); } else { echo "Access denied. Unable to verify app token.\n"; exit(1); } } if (isset($_SERVER["PATH_INFO"])) { if ($_SERVER["PATH_INFO"] == "/" . $_SESSION["token"]) { $file = "index.php"; } else { $file = $_SERVER["PATH_INFO"]; } } else { header('Location: ' . str_replace("/{$token}", "/", $_SERVER['SCRIPT_URI']) . '/index.php'); exit; } $file_path = sprintf("%s/../%s/current/%s", dirname(__FILE__), $app_name, $file); $_SERVER["PATH_INFO"] = $_SERVER["SCRIPT_NAME"]; $_SERVER["SCRIPT_NAME"] = $file;