Fetch list of users

Fetch list of users

Monday 06 March 2006 12:20:37 am - 6 replies

Author Message

Patrice DUCLAUD

Monday 06 March 2006 12:51:27 am

Hy,

You can try :

{def $ListeUser=fetch('content','tree' ,hash('parent_node_id',5) }

where 5 is the node_id of the users section.
$ListeUser contains users group and users.

Hope it will help.

Patrice

GDA AS

Monday 06 March 2006 1:11:10 am

I tried this:

fetch(content, tree,
			hash( parent_node_id, 5,
		        class_filter_type, include,
			class_filter_array, array( 'user' ),
			attribute_filter,
			array( array( 'contentobject_id', '=', $survey.user_identifier ) ) ) )}

Where $survey.user_identifier is from a collected_info_collection. It does not work. It fetches users if I remove the attribute filter so there must be something wrong with the filter.

What I want to accomplish is to display the users name (firstname, lastname) of the user who submitted a collected_info_collection.

GDA AS

Monday 06 March 2006 2:39:06 am

The user_identifier attribute of an ezinformationcollection object return something like '12905d5437cf0f07165ede3c8d893fea'.

How do I use this to fetch the coresponding user object? I can't find any attributes in the user object that contain a value similar to that of ezinformationcollection.user_identifier.

Tom Couwberghs

Wednesday 08 March 2006 2:11:36 pm

The syntax of your attribute filter is wrong. It should be:

array( 'and', array('<class_identifier>/<class_attribute_identifier>', '<operator>', '<value>'))

But in your case, this won't do. The problem is that the remote_id of the user isn't a content class attribute in the user class, but a database field in the ezcontentobject table.

To filter on remote id you will need to write an extended attribute filter which filters on this field. The following link explains what it is and how it works.

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/list

GDA AS

Wednesday 08 March 2006 11:07:33 pm

I found out that the user_identifier attribute of an ezinformationcollection is actually a md5-sum of the string "user-" and the user_id of the user who submitted the information. So my filter would not have worked anyway.

eZ systems have made an extension that will translate this to user_id's. This will make it possible to filter ezinformationcollections based on the user_identifier attribute. It will appear under contributions very soon.

Kristian Hole

Thursday 09 March 2006 1:52:20 am

The contribution is now available here:
http://ez.no/community/contribs/hacks/informationcollection_fetch_functions

Enjoy! :-)

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.