Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

In iframe malfunctions

Help
LazyGatto
2012-06-04
2013-06-06
  • LazyGatto
    LazyGatto
    2012-06-04

    Good day.
    And big thaks for your product. It's great =)
    I trying integrate Adminer into vbulletin admincp.
    And have some troubles.
    Im using this code to initialize Adminer.

    $_GET['username'] = 'eg_developer';
    function adminer_object() {
            global $vbulletin;
            class AdminerSoftware extends Adminer {
                var $registry = null;
                var $sameOrigin;
                function AdminerSoftware(&$registry, $sameOrigin = false)
                {
                    $this->sameOrigin = $sameOrigin;
                    if (is_object($registry))
                    {
                        $this->registry =& $registry;
                        if (!is_object($registry->db))
                        {
                            trigger_error('Database object is not an object', E_USER_ERROR);
                        }
                    }
                    else
                    {
                        trigger_error('Registry object is not an object', E_USER_ERROR);
                    }
                }
                function headers() {
                    if ($this->sameOrigin) {
                        header("X-Frame-Options: SameOrigin");
                    }
                    header("X-XSS-Protection: 0");
                    return false;
                }
                function permanentLogin() {
                    return "";
                }
                function credentials() {
                    return array(
                        $this->registry->config['MasterServer']['servername'],
                        $this->registry->config['MasterServer']['username'],
                        $this->registry->config['MasterServer']['password']
                    );
                }
                function database() {
                    return $this->registry->config['Database']['dbname'];
                }
                function login($login, $password) {
                    return ($login == 'eg_developer' && $password == '');
                }
            }
            return new AdminerSoftware($vbulletin);
        }
    require_once "./includes/adminer-3.3.4-mysql-en.inc";
    

    But i always got CSRF error. i suppose, that some of _POST variables sanitaize while in global.php of vbulletin. Because it included further.
    And one more trouble. I cannot alter table. I always got error Incorrect table name '' SQL command

     
  • Jakub Vrána
    Jakub Vrána
    2012-06-29

    The code looks good. You are probably right that vBulletin alters some variables. Can you try it diagnose it yourself?