Skip to content

Instantly share code, notes, and snippets.

@iarp
Last active January 27, 2022 15:39
Show Gist options
  • Save iarp/6367158 to your computer and use it in GitHub Desktop.
Save iarp/6367158 to your computer and use it in GitHub Desktop.
A way to allow direct login to adminer
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function credentials() {
# You don't need this if statement, but I added it because not having
# it skipped the login screen for everyone.
if ($_GET['username'] == 'username')
return array('127.0.0.1', 'username', 'password');
}
}
return new AdminerSoftware;
}
require_once("adminer.php");
@madurapa
Copy link

madurapa commented Dec 13, 2017

Thanks!

If you add $_GET['username'] = ''; to the top of this code does the tric

@cornernote
Copy link

I had the same issue, saw this, and didn't realise it was the solution.

The issue is, the login page is displayed on the first load. When you click login (without filling in any information) you become logged in.

Thanks @madurapa for a quick solution.

@realies
Copy link

realies commented Dec 3, 2018

Check out my fork work for an updated and working version

@cornernote
Copy link

This stopped working on version 4.7.7 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment