How to set a random password for useractivation in Chronoforms 6

ga galbur 12 Jun, 2019
Hi
​
In the Version 5 i had the "User Registration" Action with email activation, random password, Send Joomla activation and so on.
I miss this in Version 6. How can i set a Random Password for example?
​
Thank you
Best regards
Christoph
Gr GreyHead 12 Jun, 2019
Hi Christophe,
​
There are some suggestions here
​
Bob
he healyhatman 12 Jun, 2019
Put a PHP block before your user registration, call it "password"
​
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
$pass = []; for ($i = 0; $i < 8; $i++) { $n = rand(0, count($alphabet)-1); $pass[$i] = $alphabet[$n]; } return $pass;
Then use {var:password} in your user registration action.
ga galbur 13 Jun, 2019
Hi Bob and healyhatman
​
Thanks for helping!
Maybe i did something wrong?
So i have the customcode before the joomla user action:
​
How to set a random password for useractivation in Chronoforms 6 image 1
​
The PHP code looks like this:
How to set a random password for useractivation in Chronoforms 6 image 2
​
Then i have var:password in the password field provider
​
How to set a random password for useractivation in Chronoforms 6 image 3
​
All the Best
Christoph
​
BTW: the Image Uploadfunction in your Forum is still not working ...
Gr GreyHead 13 Jun, 2019
Hi,
​
Not tested but I think that needs an implode($pass, ''); before the return line.
​
Bob
ga galbur 14 Jun, 2019
Hi
Thank you. So i tried to use the code with a php-block. I'm not shure. Do i have to use the php code with or without <?php ?> Brackets within the php-block?
So anyway it doesn't work.
​
This is my setup :
​
How to set a random password for useractivation in Chronoforms 6 image 4
​
All the best
Christoph
This topic is locked and no more replies can be posted.