[SOLVED] Alter the generated password

5 years 5 months ago #308475 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
Thank you so much for taking the time look at this again. I see that you have built the new field action for release with the next CB Auto Actions release which is great. In the meantime am I now able to create a plugin that will achieve the same effect using the current codebase? If so what trigger would it act on and what would be the general algorithm to apply?

Please Log in to join the conversation.

5 years 5 months ago #308490 by krileon
Replied by krileon on topic Alter the generated password
Next release will just allow you to use a Field action to generate random passwords instead of needing to code it. I was able to successfully generate a new password on the onAfterSaveUserRegistration trigger, but that trigger is fired after emails are sent. Sorry, I don't have a solution for you.

I've added a feature ticket to add a parameter to CB it self to allow changing the length of generated passwords.

forge.joomlapolis.com/issues/7343


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 5 months ago #308493 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
Ok hypothetically speaking what would happen if you simply removed the password field from the registration form and didn't set CB to generate passwords? What would CB use for the password?

Please Log in to join the conversation.

5 years 5 months ago #308498 by krileon
Replied by krileon on topic Alter the generated password
In that case CB will ignore your settings of not using generated passwords and force it on to generate a password. For now I recommend just modifying core code. Next release hopefully should have the parameter for you to easily change the generated 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.
The following user(s) said Thank You: MarlonFungai

Please Log in to join the conversation.

5 years 5 months ago #308563 by krileon
Replied by krileon on topic Alter the generated password
Ok, latest nightly includes a new trigger to allow deeper customization of randomly generated passwords. For your usage you're just wanting to reduce the length which you can do with the below.

Global
Triggers: onUserRandomPassword
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$variables['var2'] = 6;
Parameters
Reference Variables: Variable 2

The new trigger is as follows.

$_PLUGINS->trigger( 'onUserRandomPassword', array( $this, &$length ) )

var1 being the user object and var2 is the password length. Since var2 is a reference variable the length can be altered from an auto action.


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: nant, MarlonFungai

Please Log in to join the conversation.

5 years 5 months ago #308564 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
Thank you so much this is a huge help. I will test it out today.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.192 seconds

Facebook Twitter LinkedIn