bug #1668724 JavaScript focus login Opera

This commit is contained in:
Sebastian Mendel
2007-03-15 10:16:15 +00:00
parent 02ca5e9e51
commit 3e9a417afa
2 changed files with 71 additions and 67 deletions

View File

@@ -10,6 +10,7 @@ $HeadURL$
- bug #1615530 [upload] added more specific error message if field upload fails - bug #1615530 [upload] added more specific error message if field upload fails
- bug #1627210, #1083301, #1482401 [data] warning on duplicate indexes - bug #1627210, #1083301, #1482401 [data] warning on duplicate indexes
- bug #1679055 #1050 - Table '<table name>' already exists - bug #1679055 #1050 - Table '<table name>' already exists
- bug #1668724 JavaScript focus login Opera
- [gui] avoid displaying a wide selector in server selection - [gui] avoid displaying a wide selector in server selection
+ [core] added PMA_fatalError() and made use of it + [core] added PMA_fatalError() and made use of it
. [i18n] use generic $strOptions . [i18n] use generic $strOptions

View File

@@ -1,14 +1,17 @@
<?php <?php
/* $Id$ */ /* vim: expandtab sw=4 ts=4 sts=4: */
// vim: expandtab sw=4 ts=4 sts=4: /**
* Set of functions used to run cookie based authentication.
// +--------------------------------------------------------------------------+ * Thanks to Piotr Roszatycki <d3xter at users.sourceforge.net> and
// | Set of functions used to run cookie based authentication. | * Dan Wilson who built this patch for the Debian package.
// | Thanks to Piotr Roszatycki <d3xter at users.sourceforge.net> and | *
// | Dan Wilson who built this patch for the Debian package. | * @version $Id$
// +--------------------------------------------------------------------------+ */
/**
* @todo replace by constant
* $coming_from_common can be set from outside with register_globals on
*/
if (!isset($coming_from_common)) { if (!isset($coming_from_common)) {
exit; exit;
} }
@@ -96,7 +99,7 @@ function PMA_auth()
$page_title = 'phpMyAdmin ' . PMA_VERSION; $page_title = 'phpMyAdmin ' . PMA_VERSION;
require './libraries/header_meta_style.inc.php'; require './libraries/header_meta_style.inc.php';
?> ?>
<script type="text/javascript" language="javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
// show login form in top frame // show login form in top frame
if (top != self) { if (top != self) {
@@ -108,8 +111,9 @@ if (top != self) {
<body class="loginform"> <body class="loginform">
<?php if (file_exists('./config.header.inc.php')) { <?php
require('./config.header.inc.php'); if (file_exists('./config.header.inc.php')) {
require './config.header.inc.php';
} }
?> ?>
@@ -155,12 +159,12 @@ echo sprintf( $GLOBALS['strWelcome'],
<?php <?php
echo '</div>' . "\n"; echo '</div>' . "\n";
if (file_exists('./config.footer.inc.php')) { if (file_exists('./config.footer.inc.php')) {
require('./config.footer.inc.php'); require './config.footer.inc.php';
} }
echo ' </body>' . "\n" echo ' </body>' . "\n"
. '</html>'; . '</html>';
exit(); exit;
} }
?> ?>
<br /> <br />
@@ -225,7 +229,6 @@ echo sprintf( $GLOBALS['strWelcome'],
?> ?>
</fieldset> </fieldset>
</form> </form>
<?php <?php
// show the "Cookies required" message only if cookies are disabled // show the "Cookies required" message only if cookies are disabled
// (we previously tried to set some cookies) // (we previously tried to set some cookies)
@@ -238,32 +241,32 @@ if ( ! empty( $GLOBALS['PMA_errors'] ) && is_array( $GLOBALS['PMA_errors'] ) ) {
} }
} }
?> ?>
<script type="text/javascript">
<script type="text/javascript" language="javascript"> // <![CDATA[
<!-- function PMA_focusInput()
var uname = document.forms['login_form'].elements['pma_username']; {
var pword = document.forms['login_form'].elements['pma_password']; var input_username = document.getElementById('input_username');
if (uname.value == '') { var input_password = document.getElementById('input_password');
uname.focus(); if (input_username.value == '') {
input_username.focus();
} else { } else {
pword.focus(); input_password.focus();
} }
//--> }
window.setTimeout('PMA_focusInput()', 500);
// ]]>
</script> </script>
</div> </div>
<?php
<?php if (file_exists('./config.footer.inc.php')) { if (file_exists('./config.footer.inc.php')) {
require('./config.footer.inc.php'); require './config.footer.inc.php';
} }
?> ?>
</body> </body>
</html> </html>
<?php <?php
exit(); exit;
return true;
} // end of the 'PMA_auth()' function } // end of the 'PMA_auth()' function