Fetching User information

Author Message

John Smith

Tuesday 04 May 2010 6:59:51 am

Hi guys,

I am working on a website in which users will register from the public website. Once registered, user can search other users that are already registered on the website.

The search result will display name of the registered user, few other selective information from user class in a list. Now in the search result list, name of the user will be a link, when clicked will display all the information related to that user.

Is that possible, what is the best method?

I tried few roles and policies, it seems current logged in user cannot access information related to other user.

John Smith

Tuesday 04 May 2010 12:26:03 pm

Anyone please....

Abdelkader RHOUATI

Tuesday 04 May 2010 1:15:11 pm

Hello,

Users under ezpublish are managed in the same ways that the content, except that it is in another root node that has the node_id equal to 5, and another section "Users".

So I advice you to create a new section called for exemple "Public Users" and in new profile you give access to module content > function read on the new created section.

I hope it's help you.

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

John Smith

Tuesday 04 May 2010 2:28:31 pm

Cheers Mate for your swift reply and help.

So according to you I should create new section "Public Users" and assign it to user-group containing all the users. What is best way to display the information for each user??

The only way I can see the user information is via

/user/edit/<object_id>

which probably not the right way? Is it possible to display the information like we use for content, something like

/content/view/full/<node_id>

Cheers,

Abdelkader RHOUATI

Tuesday 04 May 2010 2:57:43 pm

Anything you can do with content, you can do it with the users.

So to display the details of a user, you use content/view/full/[node_id] or even if you retrieve the node of the user, using his url alias (something like this : $user.url_alias )

Regrads

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

John Smith

Tuesday 04 May 2010 11:53:24 pm

Cheers Abdelkader,

It seems working. I can display the information for other users. Seems possible.

Following are the templates which are getting loaded.

extension/ezwebin/design/ezwebin/templates/node/view/full.tpl

design/standard/templates/content/datatype/view/ezuser.tpl

design/standard/templates/content/datatype/view/eztext.tpl

design/standard/templates/content/datatype/view/ezimage.tpl

To get the required information as I have changed the user class (added few other attributes), I think I need to override ezuser.tpl (datatype template) or do you suggest something else to display the user information.

Can it be done like we do the overrides for content objects like article, folder etc?

Abdelkader RHOUATI

Wednesday 05 May 2010 12:42:31 am

Hello

The answer is yes.

TKS, have a nice day ;)

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

John Smith

Wednesday 05 May 2010 12:58:55 am

Got it, something like, have to do manually in override.ini.append.php

[xx_user_full.tpl]
Source=node/view/full.tpl
MatchFile=xx_user_full.tpl
Subdir=templates
Match[class_identifier]=user
Match[section]=10 (ID of Public Users section)

Cheers,

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