Menu

#811 Possible fix for autologin feature

Git
closed-rejected
nobody
auto-login (2)
5
2025-02-19
2021-08-06
No

Starting from version 4.7.2 of Adminer autologin feature does not work. It happens because the custom credentials() function never be called since the get_password() function in line 157 of auth.inc.php file returns an empty string before the call of credentials function:

if (isset($_GET["username"]) && is_string(get_password())) {

To fix this issue to this line also should be added call of the credentials function to check the password from it:

if (isset($_GET["username"]) && (is_string(get_password()) || is_string($adminer->credentials()[2]))) {

Discussion

  • Martin Schilliger

    Thank you, this was the solution! I use adminer only inside a validated session, so it's save to not use the provided login function. It took me some time to find out how to use your hint. In the end it was clear that wasn't that difficult, but may be a starting help for someone else:

    • Download the sourcecode
    • open a terminal in the folder
    • php compile.php editor mysql de for creating only the editor, only with mysql and only with german language
    • ignore all the warnigs it outputs, as suggested in this ticket they are more a todo-list than real warnings.
    • the file editor-4.8.1-mysql-de.php gets created in the same directory.
     
  • Jakub Vrána

    Jakub Vrána - 2025-02-19
    • status: open --> closed-rejected
     

Log in to post a comment.

MongoDB Logo MongoDB