On 10/03/2012 11:43 AM, Felix AtCurriki wrote:
Hi all,

At Curriki we currently work on a small tool which allows us to search
users and apply changes to their "active/inactive" and
"email_undeliverable" values easily without the need of editing the user
objects manually.

That gives us the following combinations for user states which are already
in use (e.g. in the registration process):

    - User state: Active    Values: (active:"Active", email_undeliverable:No)
    - User state: Inactive  Values: (active:"Inactive",
    email_undeliverable:Yes) - The user needs to revalidate his email address

Now if we want users to be marked as deactivated/spammers do you think
would it be a good way to define an additional user state by expressing it
through boolean combinations like this:

    - User state: Deactivated/Spammer  Values: (active:"Inactive",
    email_undeliverable:*No*)

Or do you think it would it be better to add an entry to the choices of the
"active" value in the user object which explicitly says "deactivated" or
"spammer".

Or do you have any other best practice solutions?

I prefer to keep the semantics of fields pure, so I don't agree that the user state should be computed from the different combinations of the other two fields. Add a new field user_state to the class and explicitly put the state in there. This is more flexible and allows for future new states.

Suggested field type: static list.

--
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to