roundcubemail/program/lib/Roundcube/rcube_user.php
function list_identities($sql_add = '', $formatted = false)
    {
        $result = array();

        $sql_result = $this->db->query(
            "SELECT * FROM ".$this->db->table_name('identities', true).
            " WHERE `del` <> 1 AND `user_id` = ?".
            ($sql_add ? " ".$sql_add : "").
            " ORDER BY `standard` DESC, `name` ASC, `email` ASC, `identity_id` ASC",
            $this->ID);

        while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
            if ($formatted) {
                $ascii_email = format_email($sql_arr['email']);
                $utf8_email  = format_email(rcube_utils::idn_to_utf8($ascii_email));

                $sql_arr['email_ascii'] = $ascii_email;
                $sql_arr['email']       = $utf8_email;
                $sql_arr['ident']       = format_email_recipient($ascii_email, $sql_arr['name']);
            }

            $result[] = $sql_arr;
        }

        return $result;
    }
function list_identities($sql_add = '', $formatted = false)
    {
        $result = array();

        $sql_result = $this->db->query(
            "SELECT * FROM ".$this->db->table_name('identities', true).
            " WHERE `del` <> 1 AND `user_id` = ?".
            ($sql_add ? " ".$sql_add : "").
            " ORDER BY `standard` DESC, `name` ASC, `email` ASC, `identity_id` ASC",
            $this->ID);

        while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
            if ($formatted) {
                $ascii_email = format_email($sql_arr['email']);
                $utf8_email  = format_email(rcube_utils::idn_to_utf8($ascii_email));

                $sql_arr['email_ascii'] = $ascii_email;
                $sql_arr['email']       = $utf8_email;
                $sql_arr['ident']       = format_email_recipient($ascii_email, $sql_arr['name']);
            }

            $result[] = $sql_arr;
        }

        return $result;
    }
function list_identities ( $ sql_add = '' , $ formatted = false ) { $ result = array ( ) ; $ sql_result = $ this -> db -> query ( "SELECT * FROM " . $ this -> db -> table_name ( 'identities' , true ) . " WHERE `del` <> 1 AND `user_id` = ?" . ( $ sql_add ? " " . $ sql_add : "" ) . " ORDER BY `standard` DESC, `name` ASC, `email` ASC, `identity_id` ASC" , $ this -> ID ) ; while ( $ sql_arr = $ this -> db -> fetch_assoc ( $ sql_result ) ) { if ( $ formatted ) { $ ascii_email = format_email ( $ sql_arr [ 'email' ] ) ; $ utf8_email = format_email ( rcube_utils :: idn_to_utf8 ( $ ascii_email ) ) ; $ sql_arr [ 'email_ascii' ] = $ ascii_email ; $ sql_arr [ 'email' ] = $ utf8_email ; $ sql_arr [ 'ident' ] = format_email_recipient ( $ ascii_email , $ sql_arr [ 'name' ] ) ; } $ result [ ] = $ sql_arr ; } return $ result ; }
Return a list of all identities linked with this user

@param string $sql_add   Optional WHERE clauses
@param bool   $formatted Format identity email and name

@return array List of identities
Return a list of all identities linked with this user