Re: [jgen] What do you think about a 'created_by' property for the user class? I think there is a good reason to have it.

28 views
Skip to first unread message

rahul borole

unread,
May 18, 2013, 4:48:48 AM5/18/13
to Joomla! General Development
i think it can be good but not much useful


On Fri, May 17, 2013 at 5:55 PM, Clubnite <tin...@googlemail.com> wrote:
Hello,

through a current work i came to the following question:

Users can be created by a user itself through the registration form or by the site admin through the backend. Now, if i have a routine hooks up the onUserLogin event to check if this user is member of a specific group and if not to add it to this group, then there is some information required, who created this user. In my case, i want all users, that register themselves through the registration form to get auto-added to the new group, but users created by the admin must not. So, the plugin handling the onUserLogin event needs to know who created this user.

This is why i wonder, if we could add another user class property 'created_by' to get around this issue. 

What do you guy think?

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Janich Rasmussen

unread,
May 18, 2013, 5:19:25 PM5/18/13
to joomla-de...@googlegroups.com
Why look at the cms? You can easily do this yourself;

Take a look at the user plugins. 
What you want, is something that hooks on to the onUserAfterSave and saves the creator in database - fx in the #__user_profiles table, which is already used by the profile plugin.

It will not become a property on the actual user object, but you can extract the value as you like anyway.
And best of all - It shouldn't take more than a few mins to make. :)
Reply all
Reply to author
Forward
0 new messages