The way I get to the situation with the &db at the start of the querystring is to view a table and then click the DB name in the breadrumb in the header.
Could this be fixed in the core please?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's because I've been setting $_GET['username'] = "" which seemed to be part of the recommended way to set up an automatic login. Currently I am logging in automatically via a JS submission of a hidden form which is a bit ugly, but it works and does mean that I no longer need to set $_GET['username'] = "" and so there is now also no longer an issue with &db, so I guess this is solved.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In both cases, adding the $_GET['username'] = "" removes the username query string parameter. I see it when opening a table and then navigating back to the DB in the breadcrumb - eg clicking on "pwtest" in this example:
MySQL » Server » pwtest » Select: fieldgroups_fields
This has been a problem for me all along so I hack the adminer core, changing:
to:
This might be because I am setting the available databases like this:
so that there is only one database available.
The way I get to the situation with the
&db
at the start of the querystring is to view a table and then click the DB name in the breadrumb in the header.Could this be fixed in the core please?
Adminer always has at least
?username=
here. You must be doing something weird.It's because I've been setting
$_GET['username'] = ""
which seemed to be part of the recommended way to set up an automatic login. Currently I am logging in automatically via a JS submission of a hidden form which is a bit ugly, but it works and does mean that I no longer need to set$_GET['username'] = ""
and so there is now also no longer an issue with&db
, so I guess this is solved.It doesn't matter how you set
username
, it's always used inME
: https://github.com/vrana/adminer/blob/v4.7.9/adminer/include/bootstrap.inc.php#L95.Yeah, I see that so not sure why it's being lost. Here is what I am currently doing with the hacky JS login form submission:
https://github.com/adrianbj/TracyDebugger/blob/master/panels/Adminer/plugins/AdminerProcessWireLogin.php
and here's the version I was using before the automated login broke:
https://github.com/adrianbj/TracyDebugger/blob/ab632ab59f232c70de39a7e0e9b869b51e3108e1/panels/Adminer/plugins/AdminerProcessWireLogin.php
In both cases, adding the
$_GET['username'] = ""
removes theusername
query string parameter. I see it when opening a table and then navigating back to the DB in the breadcrumb - eg clicking on "pwtest" in this example:MySQL » Server » pwtest » Select: fieldgroups_fields
the url looks like:
http://pwtest.test/admin/setup/adminer/&db=pwtest
Do not set
$_GET["username"]
in the constructor but just before including Adminer.Thanks @jakubvrana - that fixed it :)