Looking for a way to make a plugin to display phpinfo()

Developers
2013-10-21
2013-10-25
  • NewEraCracker
    NewEraCracker
    2013-10-21

    Hi,

    I am looking for a way to make a plugin to display phpinfo() output in
    Adminer when user is authenticated.

    Currently I have done the following code and I need help improving it as I
    need to hook the output in a better way.

    &username=&phpinfo=1" target=_blank>Show phpinfo();

    Thanks in advance.

     
  • NewEraCracker
    NewEraCracker
    2013-10-22

    It seems sourceforge parser screwed with the code I posted.

    <?php
    class AdminerPhpInfo {
        function login($login, $password) {
            if($_GET['phpinfo'])
            {
                unset($_COOKIE, $_REQUEST, $GLOBALS['PHP_AUTH_PW'], $_SERVER['PHP_AUTH_PW']); /* Avoid exposing too much information */
                phpinfo();
                exit();
            }
        }
        function navigation($unused='') {
            if($_GET['server'] && $_GET['username'])
            {
    ?>
                <a href="?server=<?php echo urlencode($_GET['server']); ?>&amp;username=<?php echo urlencode($_GET['username']); ?>&amp;phpinfo=1" target="_blank">Show phpinfo();</a> <?php
            }
        }
    }
    ?>
    

    This is the code I have made at the moment.

     
  • Jakub Vrána
    Jakub Vrána
    2013-10-25

    This looks fine to me. Maybe you can position it with CSS?