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!

passwdpop() function strength rating

Discussion in 'cPanel Developers' started by jaheller, Jun 12, 2017.

  1. jaheller

    jaheller Registered

    Joined:
    May 31, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Germany
    cPanel Access Level:
    Root Administrator
    I'm using the below PHP code (using the xml API interface) to change passwords for email accounts:

    function change_email_password($xmlapi, $email, $password) {

    // Note that $email is just the username part of the email
    $req = array("email" => $email, "password" => $password, "domain" => EMAIL_DOMAIN);
    $response = $xmlapi->api1_query(CPANEL_USERNAME, "Email", "passwdpop", $req);


    $decoded = json_decode($response, true);
    return $decoded;
    return get_cpanel_reason($decoded, "Failed to change email password for an unknown reason.");
    }

    Calling the code by using:

    die(var_dump(change_email_password(get_cpanel_xmlapi(), 'somemail','3e6agh3tzdafg3wartdwa')));

    Returns:

    array(8) { ["apiversion"]=> string(1) "1" ["type"]=> string(5) "event" ["module"]=> string(5) "Email" ["func"]=> string(9) "passwdpop" ["source"]=> string(6) "module" ["data"]=> array(1) { ["result"]=> string(233) "
    The password that you entered has a strength rating of “0”. You cannot use it because it is too weak and too easy to guess. Please enter a password with a strength rating of “65” or higher. " } ["event"]=> array(2) { ["result"]=> int(0) ["reason"]=> string(224) "Email::passwdpop() failed: The password that you entered has a strength rating of “0”. You cannot use it because it is too weak and too easy to guess. Please enter a password with a strength rating of “65” or higher." } ["error"]=> string(224) "Email::passwdpop() failed: The password that you entered has a strength rating of “0”. You cannot use it because it is too weak and too easy to guess. Please enter a password with a strength rating of “65” or higher." }

    Any idea where things go wrong? The strength rating of a password is 0 all the time.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,408
    Likes Received:
    1,953
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm unable to reproduce this issue using the command line to call this cPanel AP 1 function (I also tested with cPanel API 2 and UAPI). Could you verify which version of cPanel is installed on this system? Also, can you reproduce the issue using the command line to call this API function? You can find an example at:

    UAPI Functions - Email::passwd_pop - Software Development Kit - cPanel Documentation

    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