Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

password not sent to editor login extension

Help
EWoods
2012-12-13
2013-06-06
  • EWoods
    EWoods
    2012-12-13

    I am trying to implement an external authentication (ldap, but that is beside the point) by using the login extension and am finding that no value is passed to the $password variable.

    Here's my extension to the editor, with a short circuit to just print out the login credentials, and what I find is that password isn't populated:

    <?php
    $_GET['sqlite'] = '';
    function adminer_object() {
        class AdminerSoftware extends Adminer {
            function name() {
                // custom name in title and heading
                return 'Simple Error Log';
            }
            function database() {
                // database name, will be escaped by Adminer
                return '/projects/ewoods/err.db';
            }
            function login($login, $password) {
                // Do external login here
                echo "Login: $login, Password: $password;" die;
                return true;
            }
        }
        
        return new AdminerSoftware;
    }
    include "./sql_editor.php";
    

    Obviously i will need to add implementation to my login script, but my implementation will fail if I don't have the password.

     
  • EWoods
    EWoods
    2012-12-13

    And here's the browser output:

    Login: test, Password: ;
    [code]
    
     
  • Jakub Vrána
    Jakub Vrána
    2013-04-16

    The problem is in the $_GET = ''; line. Adminer sets password based on driver. You need to implement the loginForm() method to properly set the driver.