Ejemplo n.º 1
0
function get_new_password()
{
    global $settings;
    if ($settings['admin_username'] == $_REQUEST['user'] && $settings['admin_password'] == $_REQUEST['old_pw']) {
        $new_password = random_key(8, true);
        $query = array('UPDATE' => 'settings', 'SET' => 'value="' . openld_hash($new_password) . '"', 'WHERE' => 'title="admin_password"');
        ($hook = get_hook('admin_login_get_password_settings_sql')) ? eval($hook) : null;
        $db->query_build($query);
        generate_settings_cache();
        echo NEW_PASSWORD . ":" . $new_password;
    } else {
        error("Invalid password request");
    }
}
Ejemplo n.º 2
0
    }
}
// Load hooks
if (file_exists(OPENLD_ROOT . 'cache/cache_hooks.php')) {
    include OPENLD_ROOT . 'cache/cache_hooks.php';
}
if (!defined('OPENLD_HOOKS_LOADED')) {
    generate_hooks_cache();
    require OPENLD_ROOT . 'cache/cache_hooks.php';
}
// Load cached settings
if (file_exists(OPENLD_ROOT . 'cache/cache_settings.php')) {
    include OPENLD_ROOT . 'cache/cache_settings.php';
}
if (!defined('OPENLD_CONFIG_LOADED')) {
    generate_settings_cache();
    require OPENLD_ROOT . 'cache/cache_settings.php';
}
// Enable output buffering
// Buffering feature cannot be active if active if zlib.output_compression is turned on!
if (!defined('OPENLD_DISABLE_BUFFERING')) {
    if (extension_loaded('zlib')) {
        // zlib.output_compression can be returned in an integer OR boolean
        if (is_integer(ini_get("zlib.output_compression")) && ini_get("zlib.output_compression") == 0 || is_bool(ini_get("zlib.output_compression")) && !ini_get("zlib.output_compression")) {
            // For some very odd reason, "Norton Internet Security" unsets this
            $_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '';
            // Should we use gzip output compression?
            if ($settings['gzip'] == 'Y' && function_exists('ob_gzhandler') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false)) {
                ob_start('ob_gzhandler');
            } else {
                ob_start();