[SOLVED] Alter the generated password

5 years 4 months ago #308698 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
I have been trying this and I am not sure what I am doing wrong but I am still getting 12 characters on password. Is the event onUserRandomPassword a Joomla event? Should I reload the user?

Please Log in to join the conversation.

5 years 4 months ago #308703 by krileon
Replied by krileon on topic Alter the generated password
It's not a Joomla event. Be sure you've updated CB to at least 2.3 (recommend latest build release) and updated CB Auto Actions to 7.3.1. Next use the below auto action.

www.joomlapolis.com/forum/255-developer-members-support/239506-alter-the-generated-password?start=18#308563

I've confirmed this works fine for adjusting the password length.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

5 years 4 months ago #308720 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
It was the latest version on all accounts but I checked again and went through the instructions again and it is still sending me 12 character passwords. Could it be affected by confirmation and approval? I don't have either active now and I have no conditions on the Auto Action.

Please Log in to join the conversation.

5 years 4 months ago #308729 by krileon
Replied by krileon on topic Alter the generated password
My tests had confirmation and approval disabled to mimic your usage. Are you registering from frontend or backend? Have you set the reference variables parameter correctly in your auto action? Variable 2 needs to be set as a reference.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

5 years 4 months ago #308730 by krileon
Replied by krileon on topic Alter the generated password
There might be something wrong with your site in general as it would seam setting by reference does not work for you. To use reference variables your site has to allow for eval or create_function otherwise it won't be able to pass reference variables. Often people will add eval to disabled_functions, but that won't actually disable it although CB Auto Actions will respect it. It can only actually be disabled using suhosin, which CB Auto Actions again will respect. If you're on PHP 7.2+ then create_function no longer exists. So if both are disabled then reference variables will not work and you won't be able to use this feature to change the length and you'll instead have to replace the password entirely by returning a new randomly generated password. The below might work for that.


Global
Triggers: onUserRandomPassword
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
jimport( 'joomla.plugin.helper' );

return JUserHelper::genRandomPassword( 6 );
Output
Display: return

Have added a feature ticket to add under the reference variables parameter a warning if both eval and create_function are not available.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: MarlonFungai

Please Log in to join the conversation.

5 years 4 months ago #308778 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
Thanks its working now. When I saw your response I remembered we upgraded to 7.2 2 weeks ago and thats why it wasn't working. Its working perfectly now. Thank you for the excellent support guys.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.623 seconds

Facebook Twitter LinkedIn