pkuhn

Registered
Jul 20, 2018
4
0
1
france
cPanel Access Level
Website Owner
Hello,

I am looking to reuse the javascript which indicates the complexity of the password on the creation of the mailboxes to use the API then, how to do that?

If the topic has already been addressed, do not hesitate to communicate a link for me to look into.

Thank you.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,910
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @pkuhn,

You may also need to utilize the following cPanel API 2 function:

cPanel API 2 Functions - PasswdStrength::get_password_strength - Developer Documentation - cPanel Documentation

We don't offer any examples for JavaScript, but you may find the following StackOverflow threads helpful:

https://stackoverflow.com/questions/7844927/how-to-create-meter-to-check-password-strength-in-php
https://stackoverflow.com/questions/10752862/password-strength-check-in-php

You can also read more about how cPanel & WHM determines a password's strength at:

How to Determine Password Strength - cPanel Knowledge Base - cPanel Documentation

Thank you.
 
  • Like
Reactions: Strangemother

pkuhn

Registered
Jul 20, 2018
4
0
1
france
cPanel Access Level
Website Owner
Hello @cPanelMichel

I'm currently using js zone.spip.net/trac/spip-zone/browser/spip-zone/_plugins_/complex/trunk/password.js.html but it does not compute like cpanel.

Would github.com/dahdee/pwdMeter/blob/master/jquery.pwdMeter.js be closer to the math?

Thank you
 
Last edited by a moderator:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,910
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Last edited by a moderator:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,910
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Where can we find the regex that do the math?
Not easy to remake them easily.
Hello @pkuhn,

We don't document or have examples of specific regular expressions for password generation. For the purpose of a custom script, you may find the following StackOverflow thread helpful:

https://stackoverflow.com/questions/19605150/regex-for-password-must-contain-at-least-eight-characters-at-least-one-number-a

We also provide a list of companies offering system administration services should you need help developing the custom script:

System Administration Services | cPanel Forums

Thank you.