Timestamp for user block changes

22 views
Skip to first unread message

iomdesign

unread,
Nov 6, 2012, 11:40:56 AM11/6/12
to joomla-de...@googlegroups.com
Hi all,

I'm looking to try and insert a timestamp, user_id and blocked status in a custom table when either a new user is created or an existing user's blocked status is modified and then delete all of the timestamp rows if the user is deleted. I'm pretty confident I can do it using MySQL triggers but just wondered if there might be a better way using Joomla's core functions.

Any ideas most welcome.

Many thanks,
James

Sam Moffatt

unread,
Nov 6, 2012, 12:01:45 PM11/6/12
to joomla-de...@googlegroups.com
There is a onUserBeforeSave and onUserAfterSave plugin hook for user
plugins that you can use to detect and track changes in a user's
state.

Cheers,

Sam Moffatt
http://pasamio.id.au
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/joomla-dev-general/-/3u8ejkxpB88J.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-gene...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Adam Rifat

unread,
Nov 6, 2012, 12:03:45 PM11/6/12
to joomla-de...@googlegroups.com
Hi James,

First thought would be to look at using a plugin. I have a user plugin which writes profile info out to a separate table when a new user is created (or an existing one updated). 

This might help http://docs.joomla.org/Creating_a_profile_plugin although you will need to do a fair bit of customising. In your case I guess the additional profile details would be hidden fields and wouldn't need to be shown on the registration or user edit form.

HTH

iomdesign

unread,
Nov 6, 2012, 5:27:18 PM11/6/12
to joomla-de...@googlegroups.com
Thanks ever so much for posts guys. I really appreciate the input. I'm actually using Community Builder for user admin as it adds some really good extras however it does actually seem to pass of user saves to Joomla core so shouldn't cause any problems - plugin hook could be the possible way to go.

Time to do some reading and learning!

Thanks again


On Tuesday, November 6, 2012 4:40:56 PM UTC, iomdesign wrote:
Reply all
Reply to author
Forward
0 new messages