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!

SOLVED api token passwd problem

Discussion in 'cPanel Developers' started by weeming21, Dec 7, 2017.

Tags:
  1. weeming21

    weeming21 Active Member

    Joined:
    Jun 13, 2015
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Malaysia
    cPanel Access Level:
    Root Administrator
    $oldpass = "123456aaaaa";
    i use api token to execute whmapi1 passwd, to change a user password to alibaba123

    PHP:
    $query "https://127.0.0.1:2087/json-api/passwd?api.version=1&user=userx&password='alibaba123'";
    affter executed, the reponse:
    PHP:
    (
        [
    data] => Array
            (
                [
    app] => Array
                    (
                        [
    0] => system
                        
    [1] => ftp
                        
    [2] => mail
                        
    [3] => MySQL
                    
    )

            )

        [
    metadata] => Array
            (
                [
    result] => 1
                
    [version] => 1
                
    [command] => passwd
                
    [output] => Array
                    (
                        [
    raw] => Password for “userx” has been changed.FTP (File Transfer Protocolpassword change has been queued.

                    )

                [
    reason] => Password changed for user “userx”.
            )

    )
    after that i can't use new password to login cpanel

    the password didn't changed, i still can use old password to login

    this is bug or i miss something? please advise
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,870
    Likes Received:
    1,811
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Do you notice any output to /usr/local/cpanel/logs/error_log when running that WHM API 1 function?

    Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. weeming21

    weeming21 Active Member

    Joined:
    Jun 13, 2015
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Malaysia
    cPanel Access Level:
    Root Administrator
    i already submit a ticket ,and it it json api bug
    internal case CPANEL-17323
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,870
    Likes Received:
    1,811
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Internal case CPANEL-17323 was closed as the issue was not reproducible. Are you intentionally including the single quotes with the new password so that they are part of the password? If not, refrain from placing the single quotes around the password when executing the function.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. weeming21

    weeming21 Active Member

    Joined:
    Jun 13, 2015
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Malaysia
    cPanel Access Level:
    Root Administrator
    i know the exactly problem already
    i execute the whmapi1 passwd at postwwwacct and ChangePasswd(Post)
    and my passwd process is faster than then cpanel change password process
    therefore the password had been overwritten by cpanel again

    i delay free seconds then the problem fixed
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,870
    Likes Received:
    1,811
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Thank you for sharing the outcome.
     
    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