/**
  * Displays authentication form
  *
  * this function MUST exit/quit the application
  *
  * @global string $conn_error the last connection error
  *
  * @return boolean|void
  */
 public function auth()
 {
     global $conn_error;
     $response = PMA_Response::getInstance();
     if ($response->isAjax()) {
         $response->setRequestStatus(false);
         // redirect_flag redirects to the login page
         $response->addJSON('redirect_flag', '1');
         if (defined('TESTSUITE')) {
             return true;
         } else {
             exit;
         }
     }
     /* Perform logout to custom URL */
     if (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) {
         PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']);
         if (defined('TESTSUITE')) {
             return true;
         } else {
             exit;
         }
     }
     // No recall if blowfish secret is not configured as it would produce
     // garbage
     if ($GLOBALS['cfg']['LoginCookieRecall'] && !empty($GLOBALS['cfg']['blowfish_secret'])) {
         $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"';
     }
     $response->getFooter()->setMinimal();
     $header = $response->getHeader();
     $header->setBodyId('loginform');
     $header->setTitle('phpMyAdmin');
     $header->disableMenuAndConsole();
     $header->disableWarnings();
     if (file_exists(CUSTOM_HEADER_FILE)) {
         include CUSTOM_HEADER_FILE;
     }
     echo '
 <div class="container">
 <a href="';
     echo PMA_linkURL('https://www.phpmyadmin.net/');
     echo '" target="_blank" class="logo">';
     $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_right.png';
     if (@file_exists($logo_image)) {
         echo '<img src="' . $logo_image . '" id="imLogo" name="imLogo" alt="phpMyAdmin" border="0" />';
     } else {
         echo '<img name="imLogo" id="imLogo" src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo.png' . '" ' . 'border="0" width="88" height="31" alt="phpMyAdmin" />';
     }
     echo '</a>
    <h1>';
     echo sprintf(__('Welcome to %s'), '<bdo dir="ltr" lang="en">phpMyAdmin</bdo>');
     echo "</h1>";
     // Show error message
     if (!empty($conn_error)) {
         PMA_Message::rawError($conn_error)->display();
     } elseif (isset($_GET['session_expired']) && intval($_GET['session_expired']) == 1) {
         PMA_Message::rawError(__('Your session has expired. Please log in again.'))->display();
     }
     echo "<noscript>\n";
     PMA_message::error(__("Javascript must be enabled past this point!"))->display();
     echo "</noscript>\n";
     echo "<div class='hide js-show'>";
     // Displays the languages form
     if (empty($GLOBALS['cfg']['Lang'])) {
         include_once './libraries/display_select_lang.lib.php';
         // use fieldset, don't show doc link
         echo PMA_getLanguageSelectorHtml(true, false);
     }
     echo '</div>
 <br />
 <!-- Login form -->
 <form method="post" action="index.php" name="login_form"' . $autocomplete . ' class="disableAjax login hide js-show">
     <fieldset>
     <legend>';
     echo __('Log in');
     echo PMA_Util::showDocu('index');
     echo '</legend>';
     if ($GLOBALS['cfg']['AllowArbitraryServer']) {
         echo '
         <div class="item">
             <label for="input_servername" title="';
         echo __('You can enter hostname/IP address and port separated by space.');
         echo '">';
         echo __('Server:');
         echo '</label>
             <input type="text" name="pma_servername" id="input_servername"';
         echo ' value="';
         echo htmlspecialchars($default_server);
         echo '" size="24" class="textfield" title="';
         echo __('You can enter hostname/IP address and port separated by space.');
         echo '" />
         </div>';
     }
     echo '<div class="item">
             <label for="input_username">' . __('Username:'******'</label>
             <input type="text" name="pma_username" id="input_username" ' . 'value="' . htmlspecialchars($default_user) . '" size="24"' . ' class="textfield"/>
         </div>
         <div class="item">
             <label for="input_password">' . __('Password:'******'</label>
             <input type="password" name="pma_password" id="input_password"' . ' value="" size="24" class="textfield" />
         </div>';
     if (count($GLOBALS['cfg']['Servers']) > 1) {
         echo '<div class="item">
             <label for="select_server">' . __('Server Choice:') . '</label>
             <select name="server" id="select_server"';
         if ($GLOBALS['cfg']['AllowArbitraryServer']) {
             echo ' onchange="document.forms[\'login_form\'].' . 'elements[\'pma_servername\'].value = \'\'" ';
         }
         echo '>';
         include_once './libraries/select_server.lib.php';
         echo PMA_selectServer(false, false);
         echo '</select></div>';
     } else {
         echo '    <input type="hidden" name="server" value="' . $GLOBALS['server'] . '" />';
     }
     // end if (server choice)
     // Add captcha input field if reCaptcha is enabled
     if (!empty($GLOBALS['cfg']['CaptchaLoginPrivateKey']) && !empty($GLOBALS['cfg']['CaptchaLoginPublicKey'])) {
         // If enabled show captcha to the user on the login screen.
         echo '<script src="https://www.google.com/recaptcha/api.js?hl=' . $GLOBALS['lang'] . '" async defer></script>';
         echo '<div class="g-recaptcha" data-sitekey="' . $GLOBALS['cfg']['CaptchaLoginPublicKey'] . '"></div>';
     }
     echo '</fieldset>
     <fieldset class="tblFooters">
         <input value="' . __('Go') . '" type="submit" id="input_go" />';
     $_form_params = array();
     if (!empty($GLOBALS['target'])) {
         $_form_params['target'] = $GLOBALS['target'];
     }
     if (!empty($GLOBALS['db'])) {
         $_form_params['db'] = $GLOBALS['db'];
     }
     if (!empty($GLOBALS['table'])) {
         $_form_params['table'] = $GLOBALS['table'];
     }
     // do not generate a "server" hidden field as we want the "server"
     // drop-down to have priority
     echo PMA_URL_getHiddenInputs($_form_params, '', 0, 'server');
     echo '</fieldset>
 </form>';
     // BEGIN Swekey Integration
     Swekey_login('input_username', 'input_go');
     // END Swekey Integration
     if ($GLOBALS['error_handler']->hasDisplayErrors()) {
         echo '<div id="pma_errors">';
         $GLOBALS['error_handler']->dispErrors();
         echo '</div>';
     }
     echo '</div>';
     if (file_exists(CUSTOM_FOOTER_FILE)) {
         include CUSTOM_FOOTER_FILE;
     }
     if (!defined('TESTSUITE')) {
         exit;
     } else {
         return true;
     }
 }
Beispiel #2
0
/**
 * 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['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    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;
    }
    /* No recall if blowfish secret is not configured as it would produce garbage */
    if ($GLOBALS['cfg']['LoginCookieRecall'] && !empty($GLOBALS['cfg']['blowfish_secret'])) {
        $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; do not show here the PMA version to improve security */
    $page_title = 'phpMyAdmin ';
    require './libraries/header_meta_style.inc.php';
    ?>
<script type="text/javascript">
//<![CDATA[
// show login form in top frame
if (top != self) {
    //window.top.location.href=location;
}
//]]>
</script>
</head>

<body class="loginform">

    <?php 
    if (file_exists('./config.header.inc.php')) {
        require './config.header.inc.php';
    }
    ?>

<div class="container">
<a href="http://www.phpmyadmin.net" target="_blank" class="logo"><?php 
    $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_right.png';
    if (@file_exists($logo_image)) {
        echo '<img src="' . $logo_image . '" id="imLogo" name="imLogo" alt="phpMyAdmin" border="0" />';
    } else {
        echo '<img name="imLogo" id="imLogo" src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo.png' . '" ' . 'border="0" width="88" height="31" alt="phpMyAdmin" />';
    }
    ?>
</a>
<h1>
    <?php 
    echo sprintf($GLOBALS['strWelcome'], '<bdo dir="ltr" xml:lang="en">' . $page_title . '</bdo>');
    ?>
</h1>
    <?php 
    // Show error message
    if (!empty($conn_error)) {
        PMA_Message::rawError($conn_error)->display();
    }
    // Displays the languages form
    if (empty($GLOBALS['cfg']['Lang'])) {
        require_once './libraries/display_select_lang.lib.php';
        // use fieldset, don't show doc link
        PMA_select_language(true, false);
    }
    ?>
<br />
<!-- Login form -->
<form method="post" action="index.php" name="login_form"<?php 
    echo $autocomplete;
    ?>
 target="_top" class="login">
    <fieldset>
    <legend>
<?php 
    echo $GLOBALS['strLogin'];
    echo '<a href="./Documentation.html" target="documentation" ' . 'title="' . $GLOBALS['strPmaDocumentation'] . '">';
    if ($GLOBALS['cfg']['ReplaceHelpImg']) {
        echo '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . $GLOBALS['strPmaDocumentation'] . '" />';
    } else {
        echo '(*)';
    }
    echo '</a>';
    ?>
</legend>

<?php 
    if ($GLOBALS['cfg']['AllowArbitraryServer']) {
        ?>
        <div class="item">
            <label for="input_servername" title="<?php 
        echo $GLOBALS['strLogServerHelp'];
        ?>
"><?php 
        echo $GLOBALS['strLogServer'];
        ?>
</label>
            <input type="text" name="pma_servername" id="input_servername" value="<?php 
        echo htmlspecialchars($default_server);
        ?>
" size="24" class="textfield" title="<?php 
        echo $GLOBALS['strLogServerHelp'];
        ?>
" />
        </div>
<?php 
    }
    ?>
        <div class="item">
            <label for="input_username"><?php 
    echo $GLOBALS['strLogUsername'];
    ?>
</label>
            <input type="text" name="pma_username" id="input_username" value="<?php 
    echo htmlspecialchars($default_user);
    ?>
" size="24" class="textfield"/>
        </div>
        <div class="item">
            <label for="input_password"><?php 
    echo $GLOBALS['strLogPassword'];
    ?>
</label>
            <input type="password" name="pma_password" id="input_password" value="" size="24" class="textfield" />
        </div>
    <?php 
    if (count($GLOBALS['cfg']['Servers']) > 1) {
        ?>
        <div class="item">
            <label for="select_server"><?php 
        echo $GLOBALS['strServerChoice'];
        ?>
:</label>
            <select name="server" id="select_server"
        <?php 
        if ($GLOBALS['cfg']['AllowArbitraryServer']) {
            echo ' onchange="document.forms[\'login_form\'].elements[\'pma_servername\'].value = \'\'" ';
        }
        ?>
        >
        <?php 
        require_once './libraries/select_server.lib.php';
        PMA_select_server(false, false);
        echo '</select></div>';
    } else {
        echo '    <input type="hidden" name="server" value="' . $GLOBALS['server'] . '" />';
    }
    // end if (server choice)
    ?>
    </fieldset>
    <fieldset class="tblFooters">
        <input value="<?php 
    echo $GLOBALS['strGo'];
    ?>
" type="submit" id="input_go" />
    <?php 
    $_form_params = array();
    if (!empty($GLOBALS['target'])) {
        $_form_params['target'] = $GLOBALS['target'];
    }
    if (!empty($GLOBALS['db'])) {
        $_form_params['db'] = $GLOBALS['db'];
    }
    if (!empty($GLOBALS['table'])) {
        $_form_params['table'] = $GLOBALS['table'];
    }
    // do not generate a "server" hidden field as we want the "server"
    // drop-down to have priority
    echo PMA_generate_common_hidden_inputs($_form_params, '', 0, 'server');
    ?>
    </fieldset>
</form>

    <?php 
    // BEGIN Swekey Integration
    Swekey_login('input_username', 'input_go');
    // END Swekey Integration
    // show the "Cookies required" message only if cookies are disabled
    // (we previously tried to set some cookies)
    if (empty($_COOKIE)) {
        trigger_error($GLOBALS['strCookiesRequired'], E_USER_NOTICE);
    }
    if ($GLOBALS['error_handler']->hasDisplayErrors()) {
        echo '<div>';
        $GLOBALS['error_handler']->dispErrors();
        echo '</div>';
    }
    ?>
</div>
<script type="text/javascript">
// <![CDATA[
function PMA_focusInput()
{
    var input_username = document.getElementById('input_username');
    var input_password = document.getElementById('input_password');
    if (input_username.value == '') {
        input_username.focus();
    } else {
        input_password.focus();
    }
}

window.setTimeout('PMA_focusInput()', 500);
// ]]>
</script>
    <?php 
    if (file_exists('./config.footer.inc.php')) {
        require './config.footer.inc.php';
    }
    ?>
</body>
</html>
    <?php 
    exit;
}
/**
 * Displays authentication form
 *
 * this function MUST exit/quit the application
 *
 * @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;
    }
    /* No recall if blowfish secret is not configured as it would produce garbage */
    if ($GLOBALS['cfg']['LoginCookieRecall'] && !empty($GLOBALS['cfg']['blowfish_secret'])) {
        $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=utf-8');
    /* HTML header; do not show here the PMA version to improve security */
    $page_title = 'phpMyAdmin ';
    include './libraries/header_meta_style.inc.php';
    // if $page_title is set, this script uses it as the title:
    include './libraries/header_scripts.inc.php';
    ?>
</head>

<body class="loginform">

    <?php 
    if (file_exists(CUSTOM_HEADER_FILE)) {
        include CUSTOM_HEADER_FILE;
    }
    ?>

<div class="container">
<a href="<?php 
    echo PMA_linkURL('http://www.phpmyadmin.net/');
    ?>
" target="_blank" class="logo"><?php 
    $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_right.png';
    if (@file_exists($logo_image)) {
        echo '<img src="' . $logo_image . '" id="imLogo" name="imLogo" alt="phpMyAdmin" border="0" />';
    } else {
        echo '<img name="imLogo" id="imLogo" src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo.png' . '" ' . 'border="0" width="88" height="31" alt="phpMyAdmin" />';
    }
    ?>
</a>
<h1>
    <?php 
    echo sprintf(__('Welcome to %s'), '<bdo dir="ltr" lang="en">' . $page_title . '</bdo>');
    ?>
</h1>
    <?php 
    // Show error message
    if (!empty($conn_error)) {
        PMA_Message::rawError($conn_error)->display();
    }
    echo "<noscript>\n";
    PMA_message::error(__("Javascript must be enabled past this point"))->display();
    echo "</noscript>\n";
    echo "<div class='hide js-show'>";
    // Displays the languages form
    if (empty($GLOBALS['cfg']['Lang'])) {
        include_once './libraries/display_select_lang.lib.php';
        // use fieldset, don't show doc link
        PMA_select_language(true, false);
    }
    echo "</div>";
    ?>
<br />
<!-- Login form -->
<form method="post" action="index.php" name="login_form"<?php 
    echo $autocomplete;
    ?>
 target="_top" class="login hide js-show">
    <fieldset>
    <legend>
<?php 
    echo __('Log in');
    echo PMA_showDocu('');
    ?>
</legend>

<?php 
    if ($GLOBALS['cfg']['AllowArbitraryServer']) {
        ?>
        <div class="item">
            <label for="input_servername" title="<?php 
        echo __('You can enter hostname/IP address and port separated by space.');
        ?>
"><?php 
        echo __('Server:');
        ?>
</label>
            <input type="text" name="pma_servername" id="input_servername" value="<?php 
        echo htmlspecialchars($default_server);
        ?>
" size="24" class="textfield" title="<?php 
        echo __('You can enter hostname/IP address and port separated by space.');
        ?>
" />
        </div>
<?php 
    }
    ?>
        <div class="item">
            <label for="input_username"><?php 
    echo __('Username:'******'Password:'******'cfg']['Servers']) > 1) {
        ?>
        <div class="item">
            <label for="select_server"><?php 
        echo __('Server Choice');
        ?>
:</label>
            <select name="server" id="select_server"
        <?php 
        if ($GLOBALS['cfg']['AllowArbitraryServer']) {
            echo ' onchange="document.forms[\'login_form\'].elements[\'pma_servername\'].value = \'\'" ';
        }
        echo '>';
        include_once './libraries/select_server.lib.php';
        PMA_select_server(false, false);
        echo '</select></div>';
    } else {
        echo '    <input type="hidden" name="server" value="' . $GLOBALS['server'] . '" />';
    }
    // end if (server choice)
    ?>
    </fieldset>
    <fieldset class="tblFooters">
        <input value="<?php 
    echo __('Go');
    ?>
" type="submit" id="input_go" />
    <?php 
    $_form_params = array();
    if (!empty($GLOBALS['target'])) {
        $_form_params['target'] = $GLOBALS['target'];
    }
    if (!empty($GLOBALS['db'])) {
        $_form_params['db'] = $GLOBALS['db'];
    }
    if (!empty($GLOBALS['table'])) {
        $_form_params['table'] = $GLOBALS['table'];
    }
    // do not generate a "server" hidden field as we want the "server"
    // drop-down to have priority
    echo PMA_generate_common_hidden_inputs($_form_params, '', 0, 'server');
    ?>
    </fieldset>
</form>

    <?php 
    // BEGIN Swekey Integration
    Swekey_login('input_username', 'input_go');
    // END Swekey Integration
    // show the "Cookies required" message only if cookies are disabled
    // (we previously tried to set some cookies)
    if (empty($_COOKIE)) {
        trigger_error(__('Cookies must be enabled past this point.'), E_USER_NOTICE);
    }
    if ($GLOBALS['error_handler']->hasDisplayErrors()) {
        echo '<div>';
        $GLOBALS['error_handler']->dispErrors();
        echo '</div>';
    }
    ?>
</div>
    <?php 
    if (file_exists(CUSTOM_FOOTER_FILE)) {
        include CUSTOM_FOOTER_FILE;
    }
    ?>
<script type="text/javascript">
//<![CDATA[
// show login form in top frame.
if (top != self || document.body.className != 'loginform') {
    window.top.location.href=location;
}
//]]>
</script>
</body>
</html>
    <?php 
    exit;
}
 /**
  * Displays authentication form
  *
  * this function MUST exit/quit the application
  *
  * @global string the last connection error
  *
  * @return void
  */
 public function auth()
 {
     global $conn_error;
     $response = PMA_Response::getInstance();
     if ($response->isAjax()) {
         $response->isSuccess(false);
         if (!empty($conn_error)) {
             $response->addJSON('message', PMA_Message::error($conn_error));
         } else {
             $response->addJSON('message', PMA_Message::error(__('Your session has expired. Please login again.')));
         }
         exit;
     }
     /* Perform logout to custom URL */
     if (!empty($_REQUEST['old_usr']) && !empty($GLOBALS['cfg']['Server']['LogoutURL'])) {
         PMA_sendHeaderLocation($GLOBALS['cfg']['Server']['LogoutURL']);
         exit;
     }
     // No recall if blowfish secret is not configured as it would produce
     // garbage
     if ($GLOBALS['cfg']['LoginCookieRecall'] && !empty($GLOBALS['cfg']['blowfish_secret'])) {
         $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';
     $response->getFooter()->setMinimal();
     $header = $response->getHeader();
     $header->setBodyId('loginform');
     $header->setTitle('phpMyAdmin');
     $header->disableMenu();
     $header->disableWarnings();
     if (file_exists(CUSTOM_HEADER_FILE)) {
         include CUSTOM_HEADER_FILE;
     }
     echo '
 <div class="container">
 <a href="';
     echo PMA_linkURL('http://www.phpmyadmin.net/');
     echo '" target="_blank" class="logo">';
     $logo_image = $GLOBALS['pmaThemeImage'] . 'logo_right.png';
     if (@file_exists($logo_image)) {
         echo '<img src="' . $logo_image . '" id="imLogo" name="imLogo" alt="phpMyAdmin" border="0" />';
     } else {
         echo '<img name="imLogo" id="imLogo" src="' . $GLOBALS['pmaThemeImage'] . 'pma_logo.png' . '" ' . 'border="0" width="88" height="31" alt="phpMyAdmin" />';
     }
     echo '</a>
    <h1>';
     echo sprintf(__('Welcome to %s'), '<bdo dir="ltr" lang="en">phpMyAdmin</bdo>');
     echo "</h1>";
     // Show error message
     if (!empty($conn_error)) {
         PMA_Message::rawError($conn_error)->display();
     }
     echo "<noscript>\n";
     PMA_message::error(__("Javascript must be enabled past this point"))->display();
     echo "</noscript>\n";
     echo "<div class='hide js-show'>";
     // Displays the languages form
     if (empty($GLOBALS['cfg']['Lang'])) {
         include_once './libraries/display_select_lang.lib.php';
         // use fieldset, don't show doc link
         PMA_Language_select(true, false);
     }
     echo '</div>
 <br />
 <!-- Login form -->
 <form method="post" action="index.php" name="login_form"' . $autocomplete . ' target="_top" class="login hide js-show">
     <fieldset>
     <legend>';
     echo __('Log in');
     echo PMA_Util::showDocu('');
     echo '</legend>';
     if ($GLOBALS['cfg']['AllowArbitraryServer']) {
         echo '
         <div class="item">
             <label for="input_servername" title="';
         echo __('You can enter hostname/IP address and port separated by space.');
         echo '">';
         echo __('Server:');
         echo '</label>
             <input type="text" name="pma_servername" id="input_servername"';
         echo ' value="';
         echo htmlspecialchars($default_server);
         echo '" size="24" class="textfield" title="';
         echo __('You can enter hostname/IP address and port separated by space.');
         echo '" />
         </div>';
     }
     echo '<div class="item">
             <label for="input_username">' . __('Username:'******'</label>
             <input type="text" name="pma_username" id="input_username" ' . 'value="' . htmlspecialchars($default_user) . '" size="24"' . ' class="textfield"/>
         </div>
         <div class="item">
             <label for="input_password">' . __('Password:'******'</label>
             <input type="password" name="pma_password" id="input_password"' . ' value="" size="24" class="textfield" />
         </div>';
     if (count($GLOBALS['cfg']['Servers']) > 1) {
         echo '<div class="item">
             <label for="select_server">' . __('Server Choice') . ':</label>
             <select name="server" id="select_server"';
         if ($GLOBALS['cfg']['AllowArbitraryServer']) {
             echo ' onchange="document.forms[\'login_form\'].' . 'elements[\'pma_servername\'].value = \'\'" ';
         }
         echo '>';
         include_once './libraries/select_server.lib.php';
         PMA_selectServer(false, false);
         echo '</select></div>';
     } else {
         echo '    <input type="hidden" name="server" value="' . $GLOBALS['server'] . '" />';
     }
     // end if (server choice)
     echo '</fieldset>
     <fieldset class="tblFooters">
         <input value="' . __('Go') . '" type="submit" id="input_go" />';
     $_form_params = array();
     if (!empty($GLOBALS['target'])) {
         $_form_params['target'] = $GLOBALS['target'];
     }
     if (!empty($GLOBALS['db'])) {
         $_form_params['db'] = $GLOBALS['db'];
     }
     if (!empty($GLOBALS['table'])) {
         $_form_params['table'] = $GLOBALS['table'];
     }
     // do not generate a "server" hidden field as we want the "server"
     // drop-down to have priority
     echo PMA_generate_common_hidden_inputs($_form_params, '', 0, 'server');
     echo '</fieldset>
 </form>';
     // BEGIN Swekey Integration
     Swekey_login('input_username', 'input_go');
     // END Swekey Integration
     // show the "Cookies required" message only if cookies are disabled
     // (we previously tried to set some cookies)
     if (empty($_COOKIE)) {
         trigger_error(__('Cookies must be enabled past this point.'), E_USER_NOTICE);
     }
     if ($GLOBALS['error_handler']->hasDisplayErrors()) {
         echo '<div>';
         $GLOBALS['error_handler']->dispErrors();
         echo '</div>';
     }
     echo '</div>';
     if (file_exists(CUSTOM_FOOTER_FILE)) {
         include CUSTOM_FOOTER_FILE;
     }
     echo '
 <script type="text/javascript">
 //<![CDATA[
 // show login form in top frame.
 if (top != self || ! $(\'body#loginform\').length) {
     window.top.location.href=location;
 }
 //]]>
 </script>';
     exit;
 }