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.

FTP Change Password api

Discussion in 'cPanel Developers' started by risklife, Dec 16, 2014.

  1. risklife

    risklife Member

    Joined:
    Dec 16, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, im new in this, i use XMLAPI for get summary account, but now, i need create a change password script, need change a specific account ftp, how i could make this?

    I use this for the summary:
    Code:
    include("xmlapi.php");
    ip = "localhost";
    $root_hash = '';
    $xmlapi = new xmlapi($ip);
    $xmlapi->hash_auth("root",$root_hash);
    $xmlapi->return_xml(1);
    $xmlapi->set_debug(1);
    $username = user;
    $xmlapi->accountsummary($username);
    I try this, but dont work:

    Code:
    include("xmlapi.php"); 
    
    $ip = "localhost"; 
    $root_pass = "root_pass"; 
    
    $xmlapi = new xmlapi($ip); 
    $xmlapi->password_auth("root",$root_pass); 
    
    //$xmlapi->set_debug(1); 
    $args = array( 
        'user' => 'unique@mydomain.tld', 
        'pass' => 'S3cr3t', 
    ); 
    $xmlapi->api2_query('dave','Ftp','passwd',$args);  
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    671
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I notice the following line:

    Please update the user entry to "unique" so the @domain suffix is excluded from the entry.

    Thank you.
     
Loading...

Share This Page