Пример #1
0
/*
 * secure passwords with secure_auth_key, if configured
 */
function secure_password($pwd)
{
    global $dw_config;
    if (isset($dw_config['secure_auth_key'])) {
        return hash_hmac('sha256', $pwd, $dw_config['secure_auth_key']);
    } else {
        return $pwd;
    }
}
require ROOT_PATH . 'lib/session/database.php';
require ROOT_PATH . 'lib/session/DatawrapperSession.php';
if (!defined('NO_SESSION')) {
    DatawrapperSession::initSession();
}
function debug_log($txt)
{
    $h = fopen(ROOT_PATH . 'log.txt', 'a+');
    fwrite($h, microtime(true) . ': ' . $txt . "\n");
    fclose($h);
}
require ROOT_PATH . 'lib/l10n.php';
require ROOT_PATH . 'lib/utils/parse_config.php';
parse_config();
if (!defined('NO_SLIM')) {
    // Initialize Slim app..
    if (ROOT_PATH == '../') {
        // ..either with TwigView for Datawrapper UI,...
        require_once ROOT_PATH . 'vendor/Slim-Extras/Views/TwigView.php';