How to stop user data being saved

26 views
Skip to first unread message

Chris Paschen

unread,
Jul 2, 2016, 11:14:22 PM7/2/16
to joomla-de...@googlegroups.com

I need to check a core user field contents on registration and if it fails a custom php test, I need to cause the user data to NOT be saved, and ideally, display a message to the user about the failure.

I thought that I could use onUserBeforeSave to do the checking.

I've reviewed the details here:

https://docs.joomla.org/Plugin/Events/User#onUserBeforeSave

And I think I can get that to work; however, I'm not completely sure how to use that function. The 'example' reference doesn't exist in any copy of Joomla 3.5.1 that I have.

Anyone have any samples or ideas that might help?

--

Chris Paschen, President

Paschen Communications, LLC

p: (651) 204-9218 | e: cpas...@paschencommunications.com
m: Box 9207, St. Paul, MN 55109
w: http://www.PaschenCommunications.com

View Chris Paschen's LinkedIn profile View Chris Paschen's profile

Follow @cpaschen

Ole Ottosen (ot2sen)

unread,
Jul 3, 2016, 3:18:42 AM7/3/16
to joomla-de...@googlegroups.com
Those example references was in J2.5 and it doesn´t look like they are in the J3.5 package.

Could be these examples that got their own repo 3 years back:
https://github.com/joomla/joomla-cms-examples/tree/master/plugins

--
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 email to joomla-de...@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Ole Ottosen (ot2sen)

unread,
Jul 3, 2016, 3:24:16 AM7/3/16
to joomla-de...@googlegroups.com
To avoid searching for possible outdated further examples, you should instead have a look at Jisses book 'Programming Joomla Plugins'

Really useful. Like having a dictionary with working examples for your plugin adventures :)

Chris Paschen

unread,
Jul 3, 2016, 10:32:07 AM7/3/16
to joomla-de...@googlegroups.com
Thanks. I already have Jisse's book and skimmed through it first (i've already 'worked' through it and built quite a few plugins) to see if I could find an example of onUserBeforeSave, but I couldn't.

So I went and started looking through it again from the start, and there it is, a hole chapter on user functions. And on p.170 was exactly what I was looking for.

I have NO idea how I missed that (I did look at the contents and appendix). I guess I'll just have to claim it was Saturday and I wasn't all there.

BTW ... anyone else reading this ... if you don't have Jisse's book ... GET IT. It's the best Joomla coding resource I've ever purchased.

Thanks again for pointing me back there. Sorry for not re-checking there first.
Reply all
Reply to author
Forward
0 new messages