ASPX templates
Version 5.x > ASPX templates > "Generate Password" format View modes: 
User avatar
Member
Member
dmco - 6/2/2010 4:20:13 PM
   
"Generate Password" format
Hi there

We are using the Kentico login webpart forgotten password retrieval function.
However, the passwords that are generated by default contain numerous special characters that are proving to be very difficult for our users to type in (a lot of them will not think to copy/paste).

e.g.
Password: -I5Oc;;_

Is there any way to specify the format of these generated passwords so it will output alphanumerics only?

Thanks


User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/7/2010 6:46:41 AM
   
RE:"Generate Password" format
Hello,

You will need to modify the code of the logon form web part: devnet.kentico.com/docs/devguide/modifying_the_code_of_standard_web_parts.htm).

In this web part (\CMSWebParts\Membership\LogonForm.ascx.cs) there is a btnPasswdRetrieval_Click event and you will need to change its code.

You will replace existing code with your custom password generation algorithm. This generated password will be sent via an e-mail using our devnet.kentico.com/downloads/kenticocms_api.zip from this place as well (in similar way as it is described in the example for web part modification in the link above) and you will send the e-mail with appropriate e-mail template in which you will pass the new password (e.g. CMS.EmailEngine.EmailSender.SendEmailWithTemplateText(string, CMS.EmailEngine.EmailMessage, CMS.EmailEngine.EmailTemplateInfo, CMS.GlobalHelper.MacroResolver, bool)).

Best regards
Ondrej Vasil

User avatar
Member
Member
dmco - 6/14/2010 8:19:22 PM
   
RE:"Generate Password" format
Thanks very much for the response.
So, can I just confirm, there is no configuration-based way to change the format of generated passwords?
I ask because I am using UserInfoProvider.GenerateNewPassword() in a number of places in our app. I can of course refactor it to use a service method of our own, that does our own generation, but I was hoping for a settings-based change that would mean we would not have to deploy a new release.

Thanks again

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/17/2010 7:07:28 AM
   
RE:"Generate Password" format
Hello,

Regrettably this kind of adjustment is not supported in current version of Kentico CMS out-of-the-box. Therefore, customization is the only way here.

At any rate, I'm passing a requirement for this feature to our product manager.

Best regards
Ondrej Vasil