[SOLVED] Alter the generated password

5 years 8 months ago - 5 years 4 months ago #306240 by MarlonFungai
[SOLVED] Alter the generated password was created by MarlonFungai
I would like to change the generated passwords created on registration to maybe a 6 digit number or even a 4 letter combination my client finds the current passwords too complex. How can I achieve that?

Please Log in to join the conversation.

5 years 8 months ago #306257 by krileon
Replied by krileon on topic Alter the generated password
There's no functionality to change the length of generated passwords. They are 12 characters long because that makes for a very secure password.


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 8 months ago #306258 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
I understand that but my client doesn't if I have to hack the code I don't mind where can I find the generation function

Please Log in to join the conversation.

5 years 8 months ago #306261 by krileon
Replied by krileon on topic Alter the generated password
You can find the password generating function in the below file as part of the user object.

/libraries/CBLib/CB/Database/Table/UserTable.php

Beyond location we can not help any further as we do not support core edits. You will have to re-implement your core edits on every CB update as well.


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 7 months ago #306673 by MarlonFungai
Replied by MarlonFungai on topic Alter the generated password
Is it possible to use a code Auto Action to set the password at registration?

Please Log in to join the conversation.

5 years 7 months ago #306684 by krileon
Replied by krileon on topic Alter the generated password
Probably best way to do that is a Code action as follows.

Global
Triggers: onBeforeUserRegistration
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
$variables['var1']->password = SET_ENCRYPTED_PASSWORD_HERE;
Parameters
Reference Variables: Variable 1

To use existing password generator you could set the code to the below for example.

$variables['var1']->setRandomPassword( 6 );

That should set their password to a random one with 6 characters before they've registered. You may need to use hashAndSaltPassword as well to encrypt the password as I don't recall if that process happens before that trigger or after it (assuming after).


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.

Moderators: beatnantkrileon
Time to create page: 0.234 seconds

Facebook Twitter LinkedIn