Page 1 of 1

Assign User to group from webentry form

Posted: Wed Oct 02, 2019 10:56 am
by justinopsky
I have a user registration form by webentry form.
I can create the user but can not associate the user to a specified group, after form submited.
I use this trigger
Code: Select all
//create user
PMFCreateUser(@@textNIF, @@textPassword, @@textPrimeiroNome, @@textUltimoNome, @@textEmail, "PROCESSMAKER_OPERATOR", "", "INACTIVE");
//define Group Name 
$groupName = "AccaoSocial";
//Get Group Name ID
$GroupUID = PMFGetGroupUID($groupName);
$username = @@textNIF;
$result = executeQuery("SELECT USR_UID FROM USERS WHERE USR_USERNAME='$username' ");
if (is_array($result) and count($result) > 0) {
   $aUser = PMFInformationUser( $result[1]['USR_UID'] );
}
//assign user to group
PMFAssignUserToGroup($aUser, $GroupUID);
I get this error
"Non-static method Bootstrap::hashPassword() should not be called statically, assuming $this from incompatible context"

After this the user is cretead but not associeted to the group

Re: Assign User to group from webentry form

Posted: Fri Oct 04, 2019 4:15 pm
by justinopsky
Please can anyone help me.

Re: Assign User to group from webentry form

Posted: Sun Oct 06, 2019 2:55 pm
by Bosatzu
justinopsky wrote: Fri Oct 04, 2019 4:15 pm Please can anyone help me.
Hello!

Could you upload your process to import here and see what could be the problem?

Re: Assign User to group from webentry form

Posted: Mon Oct 07, 2019 4:10 am
by justinopsky
(57.06 KiB) Downloaded 4 times

Re: Assign User to group from webentry form

Posted: Wed Oct 23, 2019 4:44 am
by justinopsky
Anyone can help me?

Re: Assign User to group from webentry form

Posted: Wed Oct 23, 2019 5:01 am
by programerboy
Hi,
Your code must be like this:
Code: Select all
//create user
PMFCreateUser(@@textNIF, @@textPassword, @@textPrimeiroNome, @@textUltimoNome, @@textEmail, "PROCESSMAKER_OPERATOR", "", "INACTIVE");
//define Group Name 
$groupName = "AccaoSocial";
//Get Group Name ID
$GroupUID = PMFGetGroupUID($groupName);
$username = @@textNIF;
$result = executeQuery("SELECT USR_UID FROM USERS WHERE USR_USERNAME='$username' ");
if (is_array($result) and count($result) > 0) {
	//assign user to group
	PMFAssignUserToGroup($result[1]['USR_UID'], $GroupUID);
}
Also you can check this link for more detail:
https://wiki.processmaker.com/3.2/Proce ... roup.28.29

Re: Assign User to group from webentry form

Posted: Wed Oct 23, 2019 10:54 am
by justinopsky
Thanks!