The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API call to change cpanel password?

Discussion in 'General Discussion' started by electric, May 28, 2007.

  1. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    We would like to allow our cpanel customers to change their cpanel password from within our customer management system.

    Is there a "change password" API function?

    Thanks.
     
  2. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    This seems like a pretty basic API function.

    Nobody knows?
     
  3. eNetHosts

    eNetHosts Well-Known Member

    Joined:
    Apr 21, 2007
    Messages:
    195
    Likes Received:
    0
    Trophy Points:
    16
    Don't know whether it's worth a try popping along to WHMCS if nobody comes up with a solution.

    http://whmcs.com

    In WHMCS they have support in their scripts for server support staff to change an individuals cPanel password so maybe this is something they've already looked at.
     
  4. tanfwc

    tanfwc Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
  5. orware

    orware Member

    Joined:
    Jul 27, 2005
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    You can try this

    http://ayion.mirrors.phpclasses.org/browse/class/139.html

    If the above link doesn't work you can always go to phpclasses.org and browse the classes in the "Hosting" category.

    I've never tried any of the classes currently listed in there (or know if they'll work with cPanel 11 or not), but they may provide you with the clues you'll need to figure things out.

    The reason I know about them is because I wanted something to add email accounts remotely so I looked it up, but there are some other classes there for managing the hosting accounts as well.

    WHMCS is a great solution as well.

    -Omar
     
  6. brendandonhue

    brendandonhue Member

    Joined:
    Dec 3, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
  7. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    So there is no "change password" functionality in the cpanel API, then? The only way to do this is to basically call the cpanel changepw.html page and parse response for success?

    Can anyone from cpanel please comment?
     
  8. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Your script requires the cpanel un/pw to be hardcoded into it somewhere. (It is then passed into a URL to cpanel when it calls the pw change page.)

    The problem is that we want to give customer the ability to change email from our customer managmenent system. We have many servers, and it's not realistic to hardcode the WHM or root un/pw for every server into our script.

    Is there no way to call the cpanel API using the proper Server Access Key, just like we can do already to create/suspend/upgrade accounts using the cpanel API?

    Seems like password change functionality would be pretty basic stuff, but it seems to be missing. :(
     
  9. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider


    Use /xml-api in cpanel
     
  10. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
  11. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Just call the api2 function using the cpanel call

    http://www.cpanel.net/plugins/xmlapi/cpanel.html

    Update: it looks like the api2 page is missing about 200 functions.

    Heres the xml you need
    :


    <cpanelaction>
    <module>Passwd</module>
    <func>change_password</func>
    <args>
    <oldpass>__PASSHERE__</oldpass>
    </args>
    <args>
    <newpass>__PASSHERE__</newpass>
    </args>
    </cpanelaction>

    The responses are

    status,statustxt,passwdoutput,applist
     
  12. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Thanks Nick. Is it possible to use this function without the old password?

    The idea is that we would like to give our customer support people the ability to reset a customer's password without requiring them to have access to the root WHM, etc...

    And we'd also like to be able to build-in a "change control panel" password change function in our billing system.

    Password change requests are the #1 most requested action on our helpdesk, so we're trying to reduce the amount of work and number of requests related to this.

    Would be nice if customer can do the pw change themselves directly from our billing system (which they already have to authenticate to access, etc...)

    Is this possible? Sorry if I'm a bit confused here -- we've got three different api systems, from what I can see, and zero documentation on this particular function.

    Thanks for any help you can give. I'm surprised more people haven't asked for this functionality, as it seems like it would be useful...

    :)
     
  13. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider

    You'd have to use the whm xml-api for this, and there currently is not a function to change password in the whm xml-api. I've added it to the request list for the whm xml-api.
     
  14. electric

    electric Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    697
    Likes Received:
    1
    Trophy Points:
    18
    Thanks Nick. I hope it arrives "soon". :)
     
  15. dom974

    dom974 Active Member

    Joined:
    Jun 24, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Hi everyone,

    Can someone provide me the full list of api2 functions like the one for the password change ?

    Cpanelnick : you said the api2 has more than 200 functions, where did you get the list ?

    Thank you

    Dominique
     
  16. dom974

    dom974 Active Member

    Joined:
    Jun 24, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    any update please ?

    Dominique
     
  17. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    I'd like to see the full list too?
     
Loading...

Share This Page