Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Reuse password strength javascript?

Discussion in 'cPanel Developers' started by pkuhn, Jul 20, 2018.

  1. pkuhn

    pkuhn Registered

    Joined:
    Jul 20, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  2. pkuhn

    pkuhn Registered

    Joined:
    Jul 20, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    france
    cPanel Access Level:
    Website Owner
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. pkuhn

    pkuhn Registered

    Joined:
    Jul 20, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
    #4 pkuhn, Jul 24, 2018
    Last edited by a moderator: Jul 25, 2018
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I don't know that it's closer to the strength scores provided by cPanel & WHM, but you can review the following document to get a better idea of how the score is formulated so that you can then modify the script to better resemble the cPanel & WHM score if necessary:

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

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #5 cPanelMichael, Jul 24, 2018
    Last edited by a moderator: Jul 25, 2018
  6. pkuhn

    pkuhn Registered

    Joined:
    Jul 20, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    france
    cPanel Access Level:
    Website Owner
    Hello

    Where can we find the regex that do the math?
    Not easy to remake them easily.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,857
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice