[SOLVED] Alter the generated password

6 months 2 weeks ago #308395 by MarlonFungai
Hi krileon

Please do not most login credentials here as they are publicly visible forums.

- noted I had actually deleted that user already.

I am only testing on the frontend. I have tried getting them to accept the 12 characters and it almost cost me a client. If I were to create a plugin for this maybe a cbFieldHandler child could that do the trick?
6 months 2 weeks ago - 6 months 2 weeks ago #308400 by krileon
A plugin shouldn't be necessary as it'd just be doing what you've already configured CB Auto Actions to do. You can try using the below which will modify the user then save them again, but any emails sent before this trigger will not have the newly generated password.


Global
Triggers: onAfterUserRegistration
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$user->setRandomPassword( 6 );
$user->store();

This may also work on onBeforeUserRegistration, but it will cause a user store prematurely. Please also be sure CB Auto Actions it self in CB > Plugin Management is public and published or the auto actions won't execute.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
6 months 2 weeks ago #308403 by MarlonFungai
Ok this didn't work as I tried the password sent in the email (12 characters) and I was able to login with it. I have set both email confirmation and admin confirmation off. Does that make a difference? I have checked that the auto action is running using the auto action debug and making errors on purpose.
6 months 2 weeks ago #308409 by krileon
Sorry, I don't know what more to suggest. It sounds like your auto action is never executing. Be absolutely sure you've set CB Auto Actions as published and public within CB > Plugin Management and that your auto action it self is also published or it will never execute. For the after registration trigger usage try forcing a reload of the user object under the Parameters tab of your auto action.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
6 months 2 weeks ago #308417 by MarlonFungai
The auto action is definitely getting called I have set the output to vardump [content] and it shows string(0) "" as the output on the front end whenever I register a user and further more when I use the onAfterUserRegistration trigger and set the auto action to reload the user the password comes out like this $2y$10$HeEtcmBLIaFnIfDjNWIiieOrs6gsE9SrazAJpQ/3uT.Zpp650WtnS
6 months 2 weeks ago #308429 by krileon
Have tested changing the password multiple ways across multiple triggers and sure enough it simply refuses to update. Several other fields will update fine, but the password continues to generate with 12 characters regardless. Have debugged the user object and it is being updated with the 6 character password, but refuses to store.

Very strange. I suspect it's an issue with the password not being set to the Joomla user object that's in the CB user object. Sorry, don't have anything further to suggest. All I can recommend is informing your clients the importance of security of a 12 character password or opt to use non-randomly generated passwords.

Will see if the Field action can be improved further to support randomly generating a new password which maybe more reliable than doing so from a Code action.

forge.joomlapolis.com/issues/7340


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.406 seconds
Facebook Twitter Google LinkedIn