]> git.joonet.de Git - adminer.git/commitdiff
Hide credentials for SQLite
authorJakub Vrana <jakub@vrana.cz>
Mon, 31 Jan 2011 13:48:40 +0000 (14:48 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 31 Jan 2011 13:48:40 +0000 (14:48 +0100)
adminer/include/adminer.inc.php
adminer/static/editing.js

index 9b1233d40556101c30548d096a25c1727fdad086..ebb58e6b645686c6a9dd8008cf9ac4796d8bff92 100644 (file)
@@ -47,13 +47,15 @@ class Adminer {
                global $drivers;
                ?>
 <table cellspacing="0">
-<tr><th><?php echo lang('System'); ?><td><?php echo html_select("driver", $drivers, DRIVER); ?>
+<tr><th><?php echo lang('System'); ?><td><?php echo html_select("driver", $drivers, DRIVER, "loginDriver(this);"); ?>
 <tr><th><?php echo lang('Server'); ?><td><input name="server" value="<?php echo h(SERVER); ?>">
 <tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
 <tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
 </table>
 <script type="text/javascript">
-document.getElementById('username').focus();
+var username = document.getElementById('username');
+username.focus();
+username.form['driver'].onchange();
 </script>
 <?php
                echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
index 9d4b94463108a5efd65803ace8472d7dba35d698..a855d08df0ff0d6cf65f17db8cb45cfb6136ed1d 100644 (file)
@@ -58,6 +58,13 @@ function typePassword(el, disable) {
        }
 }
 
+function loginDriver(driver) {
+       var trs = driver.parentNode.parentNode.parentNode.rows;
+       for (var i=1; i < trs.length; i++) {
+               trs[i].className = (/sqlite/.test(driver.value) ? 'hidden' : '');
+       }
+}
+
 
 
 var added = '.', rowCount;