roundcubemail/program/lib/Roundcube/rcube_user.php
function insert_identity($data)
    {
        if (!$this->ID)
            return false;

        unset($data['user_id']);

        $insert_cols   = array();
        $insert_values = array();

        foreach ((array)$data as $col => $value) {
            $insert_cols[]   = $this->db->quote_identifier($col);
            $insert_values[] = $value;
        }

        $insert_cols[]   = $this->db->quote_identifier('user_id');
        $insert_values[] = $this->ID;

        $sql = "INSERT INTO ".$this->db->table_name('identities', true).
            " (`changed`, ".join(', ', $insert_cols).")".
            " VALUES (".$this->db->now().", ".join(', ', array_pad(array(), count($insert_values), '?')).")";

        $insert = $this->db->query($sql, $insert_values);

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->insert_id('identities');
    }
function insert_identity($data)
    {
        if (!$this->ID)
            return false;

        unset($data['user_id']);

        $insert_cols   = array();
        $insert_values = array();

        foreach ((array)$data as $col => $value) {
            $insert_cols[]   = $this->db->quote_identifier($col);
            $insert_values[] = $value;
        }

        $insert_cols[]   = $this->db->quote_identifier('user_id');
        $insert_values[] = $this->ID;

        $sql = "INSERT INTO ".$this->db->table_name('identities', true).
            " (`changed`, ".join(', ', $insert_cols).")".
            " VALUES (".$this->db->now().", ".join(', ', array_pad(array(), count($insert_values), '?')).")";

        $insert = $this->db->query($sql, $insert_values);

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->insert_id('identities');
    }
function insert_identity ( $ data ) { if ( ! $ this -> ID ) return false ; unset ( $ data [ 'user_id' ] ) ; $ insert_cols = array ( ) ; $ insert_values = array ( ) ; foreach ( ( array ) $ data as $ col => $ value ) { $ insert_cols [ ] = $ this -> db -> quote_identifier ( $ col ) ; $ insert_values [ ] = $ value ; } $ insert_cols [ ] = $ this -> db -> quote_identifier ( 'user_id' ) ; $ insert_values [ ] = $ this -> ID ; $ sql = "INSERT INTO " . $ this -> db -> table_name ( 'identities' , true ) . " (`changed`, " . join ( ', ' , $ insert_cols ) . ")" . " VALUES (" . $ this -> db -> now ( ) . ", " . join ( ', ' , array_pad ( array ( ) , count ( $ insert_values ) , '?' ) ) . ")" ; $ insert = $ this -> db -> query ( $ sql , $ insert_values ) ; // clear the cache $ this -> identities = array ( ) ; $ this -> emails = null ; return $ this -> db -> insert_id ( 'identities' ) ; }
Create a new identity record linked with this user

@param array $data Hash array with col->value pairs to save
@return int  The inserted identity ID or false on error
Create a new identity record linked with this user