title: How to use adminer without password basing on login-password-less plugins
body: <p>I want to use adminer without password.</p>
  <p>I uploaded adminer-4.7.7-en.php file and finding login-password-less plugin
  I create file plugins/login-password-less.php with content :</p>
  <pre><code>&lt;?php
  
  /** Enable login for password-less database
  * @link https://www.adminer.org/plugins/#use
  * @author Jakub Vrana, https://www.vrana.cz/
  * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
  */
  class AdminerLoginPasswordLess {
      /** @access protected */
      var $password_hash;
      
      /** Set allowed password
      * @param string result of password_hash
      */
      function __construct($password_hash) {
          $this-&gt;password_hash = $password_hash;
      }
  
      function credentials() {
          $password = get_password();
          return array(SERVER, $_GET[&quot;username&quot;], (password_verify($password, $this-&gt;password_hash) ? &quot;&quot; : $password));
      }
      
      function login($login, $password) {
          if ($password != &quot;&quot;) {
              return true;
          }
      }
  
  }
  </code></pre>
  <p>and reading <a href="https://www.adminer.org/plugins/#use" rel="nofollow noreferrer">https://www.adminer.org/plugins/#use</a> I created file adminer.php, which is
  located in one dir with adminer-4.7.7-en.php and I created new apache host pointed at this file.</p>
  <p>This file has :</p>
  <pre><code>&lt;?php
  function adminer_object() {
      // required to run any plugin
      include_once &quot;./plugins/login-password-less.php&quot;; // Plugin I want to use
  
      // autoloader
      foreach (glob(&quot;plugins/*.php&quot;) as $filename) {
          include_once &quot;./$filename&quot;;
      }
  
      $plugins = array(
          // specify enabled plugins here
          new AdminerLoginPasswordLess, // Plugin I want to use
  /*        new AdminerTinymce,
          new AdminerFileUpload(&quot;data/&quot;),
          new AdminerSlugify,
          new AdminerTranslation,
          new AdminerForeignSystem,*/
      );
  
      /* It is possible to combine customization and plugins:
      class AdminerCustomization extends AdminerPlugin {
      }
      return new AdminerCustomization($plugins);
      */
  
      return new AdminerPlugin($plugins); // I am not sure which class is it and where it is defined ?
  }
  
  // include original Adminer or Adminer Editor
  include &quot;./adminer-4.7.7-en.php&quot;;  // encoded file I uploaded
  ?&gt;
  </code></pre>
  <p>and I got error:</p>
  <pre><code>Fatal error: Uncaught ArgumentCountError: Too few arguments to function AdminerLoginPasswordLess::__construct(), 0 passed in /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer.php on line 13 and exactly 1 expected in /mnt/_work_sdb8/wwwroot/lar/local_adminer/plugins/login-password-less.php:16 Stack trace: #0 /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer.php(13): AdminerLoginPasswordLess-&gt;__construct() #1 /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer-4.7.7-en.php(1654): adminer_object() #2 /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer.php(31): include('/mnt/_work_sdb8...') #3 {main} thrown in /mnt/_work_sdb8/wwwroot/lar/local_adminer/plugins/login-password-less.php on line 16
  </code></pre>
  <p>Which is the valid way  to use adminer without password ?</p>
  <p><strong>MODIFIED:</strong>
  I made :</p>
  <pre><code>new AdminerLoginPasswordLess(hash(&quot;md5&quot;, 'my_sql_user_password')),
  </code></pre>
  <p>Is the selected &quot;md5&quot; method valid ?</p>
  <p>But I got error :</p>
  <pre><code>Fatal error: Uncaught Error: Class 'AdminerPlugin' not found in /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer.php:32 Stack trace: #0 /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer-4.7.7-en.php(1654): adminer_object() #1 /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer.php(36): include('/mnt/_work_sdb8...') #2 {main} thrown in /mnt/_work_sdb8/wwwroot/lar/local_adminer/adminer.php on line 32
  </code></pre>
  <p><strong>MODIFIED:</strong>
  In source version of the site I foun file plugin.php with AdminerPlugin class implementation.
  I moved this file under plugins directory.
  In plugins/login-password-less.php I added reference to plugins/plugin.php file and added debugging info :</p>
  <pre><code>&lt;?php
  
  /** Enable login for password-less database
  * @link https://www.adminer.org/plugins/#use
  * @author Jakub Vrana, https://www.vrana.cz/
  * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
  */
  
  include_once &quot;./plugins/plugin.php&quot;;
  
  class AdminerLoginPasswordLess {
      /** @access protected */
      var $password_hash;
  
      /** Set allowed password
      * @param string result of password_hash
      */
      function __construct($password_hash) {
          $this-&gt;password_hash = $password_hash;
          debToFile('-2 AdminerLoginPasswordLess-&gt;__construct:$this-&gt;password_hash::'.$this-&gt;password_hash);
          // That is debugging method appending  string into text file
      }
  
      function credentials() {
          $password = get_password();
          debToFile('-3 AdminerLoginPasswordLess-&gt;credentials:$password::'.$password);
          // That is debugging method appending  string into text file
          return array(SERVER, $_GET[&quot;username&quot;], (password_verify($password, $this-&gt;password_hash) ? &quot;&quot; : $password));
      }
  
      function login($login, $password) {
          debToFile('-4 AdminerLoginPasswordLess-&gt;login:$login::'.$login);
          if ($password != &quot;&quot;) {
              debToFile('-5 TRUE AdminerLoginPasswordLess-&gt;login:$login::'.$login);
          // That is debugging method appending  string into text file
              return true;
          }
          debToFile('-5 false AdminerLoginPasswordLess-&gt;login:$login::'.$login);
      }
  
  }
  </code></pre>
  <p>and in adminer.php I added debugging line:</p>
  <pre><code>$plugins = array(
      new AdminerLoginPasswordLess(hash(&quot;md5&quot;, 'm8y2s8q&amp;L')),
  
  );
  debToFile('-1After:AdminerLoginPasswordLess');
  </code></pre>
  <p>I loggin file I see:</p>
  <pre><code>&lt;pre&gt;::-2 AdminerLoginPasswordLess-&gt;__construct:$this-&gt;password_hash::c61d49aaab35ca428e60d764ff05159d&lt;/pre&gt;
  &lt;pre&gt;::-1After:AdminerLoginPasswordLess&lt;/pre&gt;
  </code></pre>
  <p>It means that methods credentials and login of AdminerLoginPasswordLess class are not triggered.
  I run in browser as :
  <a href="http://local-adminer.com/?username=mysql_login_user" rel="nofollow noreferrer">http://local-adminer.com/?username=mysql_login_user</a></p>
  <p>or
  <a href="http://local-adminer.com" rel="nofollow noreferrer">http://local-adminer.com</a>  // host in apache config</p>
  <p>and I have no errors, but I still have to enter password for mysql_login_user.</p>
  <p>Did I miss some options/plugins?</p>
  <p>Thanks!</p>