Author
|
Message
|
Georg Franz
|
Tuesday 04 December 2007 1:40:42 pm
Hi, I want to fetch a list of users. I am doing:
{def $children=fetch(content,list,
hash( parent_node_id,$node.node_id,
limit,$page_limit,
offset,$view_parameters.offset,
sort_by,$node.sort_array,
class_filter_type,'include',
class_filter_array,array( 'user' ),
sort_by, array( array( 'published', false() ) ),
) ) } My problem: Is there a way to get only user nodes which are currently activated?
Best wishes,
Georg.
--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004
|
Paul Leclercq
|
Tuesday 04 December 2007 3:11:39 pm
Hello Georg,
Have you tried? {def $logged_in_users = fetch("user", "logged_in_list")}
You have more info and a list of sort options on the following page: http://ez.no/doc/ez_publish/technical_manual/3_10/reference/modules/user/fetch_functions/logged_in_list
|
Piotrek Karaś
|
Tuesday 04 December 2007 3:30:06 pm
Interesting question. Just looked through the eZUser and eZUserFunctionCollection classes, but nothing useful seems to be there... I guess what we need is a custom operator/fetch around the following query: SELECT ezuser.contentobject_id AS enabled_user_id
FROM ezuser, ezuser_setting
WHERE ezuser.contentobject_id=ezuser_setting.user_id
AND ezuser_setting.is_enabled=1
Georg, I believe logged in and enabled users are two different things.
--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu
|
Paul Leclercq
|
Tuesday 04 December 2007 4:05:51 pm
Exact, sorry about that if misread your question. It looks like you do need to create a custom fetch operator.
|
Felix Woldt
|
Thursday 06 March 2008 6:09:56 am
We had a simelar problem and we create a patch to solve this generally. See http://issues.ez.no/IssueView.php?Id=12658 for more details. Felix
http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com
CJW Newsletter 1.0.0 released: http://projects.ez.no/cjw_newsletter
|
André R.
|
Thursday 06 March 2008 10:01:47 am
Felix: I'm not sure I agree that they should be automatically hidden. And your patch looks like contains some errors (no file):
Index: .
===================================================================
--- . (revision 2250)
+++ . (working copy)
Wouldn't be more clean to have a attribute filter for activated/deactivated users?
eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom
|
Kristof Coomans
|
Thursday 06 March 2008 10:17:20 am
There's an extended attribute filter to filter enabled/disabled user accounts: http://projects.ez.no/ezuserfilter
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
|
Felix Woldt
|
Thursday 06 March 2008 11:47:52 pm
Hi all, We discuss in our team a lot about this topic. To use a extended attributefilter was one possibility, but in our project we use a lot of other extendedattibutefilters. But you can't use 2 filters at the same time. The other thing was, to extend all fetches where Users should be include, was not acceptable. In our community site the searchresult includes users to.
Then we thougt about the kernel patch, to hide a usernode if it is disabled. So all fetches works fine :-). And if you want to have a list of all users you can ignore the visibility. I think for the normal ez setup where users are placed under node 5, our kernel patch has no affect, because visibility of usernode is not use. Only if you place the users in the contentree ( under node 2) we have this situation. For example a spammer create a new login with bad words. The userobject ist placed under the public available CommunityUserGroup folder. Here the userobject should be only visible if it is enabled. And of course this SpamUserObject should be not found from any fetch in the communitysite. I hope you can follow my thought. @ André R. i will check the patches
http://www.jac-systeme.de - Developers united in eZ Publish: http://www.cjw-network.com
CJW Newsletter 1.0.0 released: http://projects.ez.no/cjw_newsletter
|
Donat Fritschy
|
Friday 07 March 2008 1:34:13 am
I fully agree with Felix. Users which are not (yet) activated or are deactivated should not be visible in any public context. In a community site it looks quite natural to place a user folder under the content root. A deactivated user could be regarded as a draft, which is not visible either. I consider the current behaviour of eZ as a clear deficiency. The kernel hack by Felix seems to me the best answer to the problem.
http://www.webmanufaktur.ch - Developers united in eZ Publish: http://www.cjw-network.com
|
Ekkehard Dörre
|
Friday 07 March 2008 3:50:13 am
There are more cases, where user accounts are in the content tree: You have a mixed B2B shop and B2C corporate site: They sell products via dealers to end costumers. Some of their dealers are for the end costumer (visible) some are only internal visible for the shop and the intranet, because they sell only to big companies (whole sale) or don't want to be listed and some are deactivated but still important for order history etc. so you can't delete them (what is most of the time not a good idea with user accounts, since a lot of objects loose the creator. Anonymous see products (class) without price and all dealers (class with user account) listed expect of non end costumer and deactivated user. dealers (class with user account) have login for shop, intranet and they are visible for anonymous, or not or deactivated, can edit their profile and children objects, which are special products (offer of the month, but without price with links on their shops) if visible. So you give them only edit access to their own user class (dealer) and their children, for product price and intranet. Clean story for eZ user rights. When you now thing of search, then you need a solution with clear fetches: Anonymous see dealers in search, with are activated and not whole sale and not deactivated. Anonymous see products of the month of dealers in search, with are activated and not whole sale and not deactivated. So even with Kristofs filter, you have them in search and everywhere, I think the easiest solution is to take the patch from Felix, make then invisible. Greetings, ekke
http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing
|
Kristof Coomans
|
Friday 07 March 2008 9:10:03 am
I believe one of the questions we should ask ourselves is why users are published when they didn't activate their user account yet when e-mail activation is enabled? The user activation by e-mail could be re-factored. Instead of having this kind of things coded in the user/register view, it could be a workflow event type, which creates the activation code, sends out the activation e-mail and halts the work flow. When the account gets activated by the user, the publish work flow continues. As for disabling users afterwards, it indeed could be useful to include "hiding" them in some situations as explained by Ekkehard.
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
|
Felix Laate
|
Friday 07 March 2008 12:38:09 pm
Hi,
>> it could be a workflow event type, which creates the activation code, sends out the
>> activation e-mail and halts the work flow. When the account gets activated by the user, >> the publish work flow continues. This is a great idea. In addition to hinder the publishing the before the registration is completed, this solution would make it easier to add different ways of activation (e.g. by SMS). Felix
Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com
|
Mark Marsiglio
|
Friday 07 March 2008 1:40:10 pm
A similar concern we are dealing with on a site right now is trying to encourage users who are not yet activated to complete the process. These disabled users need to be contacted with a reminder email, and have an interface to generate another confirmation link to be sent to their address. We are going to have to custom code this functionality for now, but it would be nice to consider this aspect of user registration in any refactoring.
http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions
|
Felix Laate
|
Saturday 08 March 2008 5:12:10 am
Hi again, IMHO a rewrite of the user-module is long over due. This because of:
- the need for flexibility in terms of workflow
- the need for different ways of handling activation (email, SMS etc)
- the need for different simplicity in the registration process - the web2.0 role of the user, not only a subject of autherization but also as an social object Felix
Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com
|