and * Dan Wilson who built this patch for the Debian package. * * @version $Id: cookie.auth.lib.php 10471 2007-07-03 00:28:32Z lem9 $ */ /** * @todo replace by constant * $coming_from_common can be set from outside with register_globals on */ if (!isset($coming_from_common)) { exit; } if (function_exists('mcrypt_encrypt') || PMA_dl('mcrypt')) { /** * Uses faster mcrypt library if available */ require_once './libraries/mcrypt.lib.php'; } else { require_once './libraries/blowfish.php'; /** * display warning in main.php */ define('PMA_WARN_FOR_MCRYPT', 1); } /** * Displays authentication form * * this function MUST exit/quit the application * * @uses $GLOBALS['server'] * @uses $GLOBALS['PHP_AUTH_USER'] * @uses $GLOBALS['pma_auth_server'] * @uses $GLOBALS['text_dir'] * @uses $GLOBALS['pmaThemeImage'] * @uses $GLOBALS['charset'] * @uses $GLOBALS['target'] * @uses $GLOBALS['db'] * @uses $GLOBALS['table'] * @uses $GLOBALS['PMA_errors'] * @uses $GLOBALS['convcharset'] * @uses $GLOBALS['lang'] * @uses $GLOBALS['strWelcome'] * @uses $GLOBALS['strSecretRequired'] * @uses $GLOBALS['strError'] * @uses $GLOBALS['strLogin'] * @uses $GLOBALS['strLogServer'] * @uses $GLOBALS['strLogUsername'] * @uses $GLOBALS['strLogPassword'] * @uses $GLOBALS['strServerChoice'] * @uses $GLOBALS['strGo'] * @uses $GLOBALS['strCookiesRequired'] * @uses $GLOBALS['strPmaDocumentation'] * @uses $GLOBALS['pmaThemeImage'] * @uses $cfg['Servers'] * @uses $cfg['LoginCookieRecall'] * @uses $cfg['Lang'] * @uses $cfg['Server'] * @uses $cfg['ReplaceHelpImg'] * @uses $cfg['blowfish_secret'] * @uses $cfg['AllowArbitraryServer'] * @uses $_COOKIE * @uses $_REQUEST['old_usr'] * @uses PMA_sendHeaderLocation() * @uses PMA_select_language() * @uses PMA_select_server() * @uses PMA_VERSION * @uses file_exists() * @uses sprintf() * @uses count() * @uses htmlspecialchars() * @uses is_array() * @global string the last connection error * * @access public */ function PMA_auth() { global $conn_error; /* Perform logout to custom URL */ if (! empty($_REQUEST['old_usr']) && ! empty($GLOBALS['cfg']['Server']['LogoutURL'])) { PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']); exit; } if ($GLOBALS['cfg']['LoginCookieRecall']) { $default_user = $GLOBALS['PHP_AUTH_USER']; $default_server = $GLOBALS['pma_auth_server']; $autocomplete = ''; } else { $default_user = ''; $default_server = ''; // skip the IE autocomplete feature. $autocomplete = ' autocomplete="off"'; } $cell_align = ($GLOBALS['text_dir'] == 'ltr') ? 'left' : 'right'; // Defines the charset to be used header('Content-Type: text/html; charset=' . $GLOBALS['charset']); // Defines the "item" image depending on text direction $item_img = $GLOBALS['pmaThemeImage'] . 'item_' . $GLOBALS['text_dir'] . '.png'; /* HTML header */ $page_title = 'phpMyAdmin ' . PMA_VERSION; require './libraries/header_meta_style.inc.php'; ?>