Thomas Bruederli
2015-04-17 a3644638aaf0418598196a870204e0b632a4c8ad
plugins/password/drivers/sql.php
@@ -35,15 +35,8 @@
        }
        if ($dsn = $rcmail->config->get('password_db_dsn')) {
            // #1486067: enable new_link option
            if (is_array($dsn) && empty($dsn['new_link']))
                $dsn['new_link'] = true;
            else if (!is_array($dsn) && !preg_match('/\?new_link=true/', $dsn))
                $dsn .= '?new_link=true';
            $db = rcube_db::factory($dsn, '', false);
            $db->set_debug((bool)$rcmail->config->get('sql_debug'));
            $db->db_connect('w');
        }
        else {
            $db = $rcmail->get_dbh();
@@ -73,8 +66,10 @@
                $len = 2;
                break;
            case 'blowfish':
                $len = 22;
                $salt_hashindicator = '$2a$';
                $cost = (int) $rcmail->config->get('password_blowfish_cost');
                $cost = $cost < 4 || $cost > 31 ? 12 : $cost;
                $len  = 22;
                $salt_hashindicator = sprintf('$2a$%02d$', $cost);
                break;
            case 'sha256':
                $len = 16;