1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-15 11:04:02 +02:00

Customize login and login form

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@860 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-21 12:19:25 +00:00
parent 70b72075ca
commit 2faa08cd15
6 changed files with 51 additions and 25 deletions

View File

@@ -12,6 +12,21 @@ function adminer_database() {
return call_adminer('database', (count($dbs) == 1 ? $dbs[0] : (count($dbs) == 2 && information_schema($dbs[0]) ? $dbs[1] : 'test')));
}
function adminer_login_form($username) {
if (call_adminer('login_form', true, $username)) {
?>
<table cellspacing="0">
<tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="server" value="" /><input name="username" value="<?php echo htmlspecialchars($username); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
<?php
}
}
function adminer_login($login, $password) {
return call_adminer('login', true, $login, $password);
}
function adminer_table_name($row) {
table_comment($row);
return call_adminer('table_name', htmlspecialchars(strlen($row["Comment"]) ? $row["Comment"] : $row["Name"]), $row);

View File

@@ -1,12 +0,0 @@
<?php
function auth_error($exception = null) {
page_header(lang('Login'), htmlspecialchars(lang('Invalid credentials.'), null));
page_footer("auth");
}
$dbh = connect();
if (is_string($dbh)) {
auth_error();
exit;
}
$_SESSION["tokens"][$_GET["server"]] = rand(1, 1e6); // defense against cross-site request forgery