<commit_before><?php
/**
 * Pimcore
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.pimcore.org/license dsf sdaf asdf asdf
 *
 * @copyright  Copyright (c) 2009-2010 elements.at New Media Solutions GmbH (http://www.elements.at)
 * @license    http://www.pimcore.org/license     New BSD License
 */

// adminer isn'T fully php 5.4 compatible
error_reporting(E_ERROR);

$workingDirectory = getcwd();
include("../../../cli/startup.php");
chdir($workingDirectory);

// only for logged in users
$user = Pimcore_Tool_Authentication::authenticateSession();
if(!$user instanceof User) {
    die("Authentication failed!");
}

$conf = Pimcore_Config::getSystemConfig()->database->params;
if(empty($_SERVER["QUERY_STRING"])) {
    header("Location: /pimcore/modules/3rdparty/adminer/index.php?username=" . $conf->username . "&db=" . $conf->dbname);
    exit;
}

// adminer plugin
function adminer_object() {

    // required to run any plugin
    include_once "./plugins/plugin.php";

    // autoloader
    foreach (glob("plugins/*.php") as $filename) {
        include_once "./$filename";
    }<commit_msg>fixed problem CSRF protection problem in adminer<commit_after><?php
/**
 * Pimcore
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.pimcore.org/license dsf sdaf asdf asdf
 *
 * @copyright  Copyright (c) 2009-2010 elements.at New Media Solutions GmbH (http://www.elements.at)
 * @license    http://www.pimcore.org/license     New BSD License
 */

// adminer isn'T fully php 5.4 compatible
error_reporting(E_ERROR);

$workingDirectory = getcwd();
include("../../../cli/startup.php");
chdir($workingDirectory);

// start global session an keep it open (this is needed for the CSRF protections from adminer)
Pimcore_Tool_Session::get();

// only for logged in users
$user = Pimcore_Tool_Authentication::authenticateSession();
if(!$user instanceof User) {
    die("Authentication failed!");
}

$conf = Pimcore_Config::getSystemConfig()->database->params;
if(empty($_SERVER["QUERY_STRING"])) {
    header("Location: /pimcore/modules/3rdparty/adminer/index.php?username=" . $conf->username . "&db=" . $conf->dbname);
    exit;
}

// adminer plugin
function adminer_object() {

    // required to run any plugin
    include_once "./plugins/plugin.php";

    // autoloader
    foreach (glob("plugins/*.php") as $filename) {
        include_once "./$filename";
    }
{'fraction_non_alphanumeric': 0.14387144992526157, 'fraction_numerical': 0.008221225710014948, 'mean_word_length': 3.7974910394265233, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2638891', 'n_tokens_mistral': 850, 'n_tokens_neox': 817, 'n_words': 229}