2016-02-29 56 views
0

我正在使用WHM API,并希望通过传递域名来查找cPanel用户名。WHM API:按域名查找cPanel用户

备注:我有WHM的凭据。

这里没有这样的文件存在https://documentation.cpanel.net/pages/viewpage.action?pageId=1507786

那么,有没有办法实现这样做呢?

更新:

现在,我使用xmlapi.php这里是我试过至今。在$xmlapi->api2_query方法

require_once(base_path() . "/vendor/cpanel_api/xmlapi.php"); 
    $ip = env('SERVER_IP', "127.0.0.1"); //your server's IP 

    $xmlapi = new \xmlapi($ip); 
    $xmlapi->password_auth(env('CPANEL_USER', "root"),env('CPANEL_PASSWORD', "")); //the server login info for the user you want to create the emails under 

    $xmlapi->set_output('json'); 
    $xmlapi->set_debug(1); 

    $params = array('domain'=>$domain, 'searchtype'=>'domain'); //quota is in MB 
    $res = json_decode($xmlapi->api2_query('root', "listaccts", "", $params), true); 


    print_r($res); 

,有4个参数

  • 的cPanel用户名
  • WHM模块名称
  • 在步骤给定的模块下作用2
  • 参数,那将被传递到步骤3中的功能

我必须找出cPanel用户名,所以,我现在写了'root'。但没有成功

回答