Aleksander Machniak
2013-05-26 22a41b824715cebb7a6874f1a869d1afde8d9cfc
program/lib/Roundcube/rcube_db_pgsql.php
@@ -2,8 +2,6 @@
/**
 +-----------------------------------------------------------------------+
 | program/include/rcube_db_pgsql.php                                    |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
 |                                                                       |
@@ -14,12 +12,10 @@
 | PURPOSE:                                                              |
 |   Database wrapper class that implements PHP PDO functions            |
 |   for PostgreSQL database                                             |
 |                                                                       |
 +-----------------------------------------------------------------------+
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+
*/
/**
 * Database independent query interface
@@ -57,19 +53,20 @@
    /**
     * Return correct name for a specific database sequence
     *
     * @param string $sequence Secuence name
     * @param string $table Table name
     *
     * @return string Translated sequence name
     */
    protected function sequence_name($sequence)
    protected function sequence_name($table)
    {
        $rcube = rcube::get_instance();
        // Note: we support only one sequence per table
        // Note: The sequence name must be <table_name>_seq
        $sequence = $table . '_seq';
        $rcube    = rcube::get_instance();
        // return sequence name if configured
        $config_key = 'db_sequence_'.$sequence;
        if ($name = $rcube->config->get($config_key)) {
            return $name;
        if ($prefix = $rcube->config->get('db_prefix')) {
            return $prefix . $sequence;
        }
        return $sequence;