onUserGroupCreated ?

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Post Reply
erick-b
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Tue Feb 17, 2015 10:25 am

onUserGroupCreated ?

Post by erick-b » Tue Jan 26, 2021 9:50 am

Hi

to create a plugin I need to use core functions

Is there anything like onUserGroupCreated onUserGroupModified ? any core function using user groups

if a new group is created I need to do some actions

thanks

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: onUserGroupCreated ?

Post by toivo » Tue Jan 26, 2021 10:53 am

The following plugin events are listed in the list of contents for User but these events are not documented:

onUserBeforeSaveGroup
onUserAfterSaveGroup
onUserBeforeDeleteGroup
onUserAfterDeleteGroup

The com_users model and its parent class JModelAdmin/AdminModel load the plugins, starting from administrator/components/com_users/models/group.php. Have not used any of those plugin events, though.
Toivo Talikka, Global Moderator

erick-b
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Tue Feb 17, 2015 10:25 am

Re: onUserGroupCreated ?

Post by erick-b » Tue Jan 26, 2021 11:08 am

thanks a lot

which library should i use then ?

something like use Joomla\CMS\User\UserHelper;

is there any specific UserGroupHelper ?

or the plugin should extend JModelAdmin ?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: onUserGroupCreated ?

Post by toivo » Tue Jan 26, 2021 11:19 am

Plugins extend JPlugin. Have a look how the user plugin is configured in plugins/user/joomla/user.php
Toivo Talikka, Global Moderator

erick-b
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 139
Joined: Tue Feb 17, 2015 10:25 am

Re: onUserGroupCreated ?

Post by erick-b » Tue Jan 26, 2021 11:21 am


User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 13261
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: onUserGroupCreated ?

Post by toivo » Tue Jan 26, 2021 11:33 am

Even though that topic from five years ago, the logic should still be the same.
Toivo Talikka, Global Moderator


Post Reply

Return to “Joomla! 3.x Coding”