Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Informations on createNewUser plugin event

  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #211608 by tassoman
Anyone who knows how to plugin the event createNewUser ? I'd like to fire an email to named email address (plugin settings) whenever a new user admin gets created, by webserver authentication.
Sadly, the wiki is undocumented about it. Also in the code , I can't find something useful.
Any help is appreciated, thanks in advance.
 

«All your survey answers are belong to us »
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #211613 by DenisChenu
Replied by DenisChenu on topic Informations on createNewUser plugin event
Seems an event when user is created by admin only

github.com/LimeSurvey/LimeSurvey/blob/ec...action.php#L118-L122

Done before creation …

You muts use POST value … to get the email etc … Yii::app()->request->getPost('new_user')

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tassoman
  • tassoman's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 2 months ago #211757 by tassoman
Replied by tassoman on topic Informations on createNewUser plugin event
Maybe should I use hook to afterModelSave event by userModel ?
manual.limesurvey.org/AfterModelSave

Looking for isNewRecord property?
www.yiiframework.com/doc/api/1.1/CActive...d#isNewRecord-detail

«All your survey answers are belong to us »
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #211765 by DenisChenu
Replied by DenisChenu on topic Informations on createNewUser plugin event
I don't use a lot AfterModelSave (here AfterUserSave)

But yes : i think you can use

$oUser = $this->getEvent()->get('model');
if($oUser->isNewRecord …


Another way (in 4.4) : github.com/LimeSurvey/LimeSurvey/blob/ec.../useraction.php#L165
manual.limesurvey.org/BeforeEmail

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose