Aleksander Machniak
2015-08-07 1b39d9a6c744a393e7930c2493cc2ddc9c9e95bf
program/lib/Roundcube/rcube_ldap.php
@@ -833,13 +833,12 @@
            }
            else {
                // map address book fields into ldap attributes
                $me         = $this;
                $attributes = array();
                array_walk((array) $fields, function($field) use ($me, &$attributes) {
                    if ($me->coltypes[$field] && ($attrs = (array)$me->coltypes[$field]['attributes'])) {
                        $attributes = array_merge($attributes, $attrs);
                foreach ((array) $fields as $field) {
                    if ($this->coltypes[$field] && ($attrs = $this->coltypes[$field]['attributes'])) {
                        $attributes = array_merge($attributes, (array) $attrs);
                    }
                });
                }
            }
            // compose a full-text-like search filter
@@ -1052,11 +1051,14 @@
    /**
     * Create a new contact record
     *
     * @param array    Hash array with save data
     * @param array Associative array with save data
     *  Keys:   Field name with optional section in the form FIELD:SECTION
     *  Values: Field value. Can be either a string or an array of strings for multiple values
     * @param boolean True to check for duplicates first
     *
     * @return encoded record ID on success, False on error
     * @return mixed The created record ID on success, False on error
     */
    function insert($save_cols)
    function insert($save_cols, $check = false)
    {
        // Map out the column names to their LDAP ones to build the new entry.
        $newentry = $this->_map_data($save_cols);