【问题标题】:Changing Email Passwords With cPanel XML API in PHP在 PHP 中使用 cPanel XML API 更改电子邮件密码
【发布时间】:2013-07-31 13:56:25
【问题描述】:

我一直在思考如何让我的用户使用 cPanels XML API 更改他们的密码。我用谷歌搜索,玩过示例代码,但找不到任何远程工作的东西。有人可以告诉我我做错了什么吗?谢谢!

require_once('../includes/xmlapi.php');

$ip = '127.0.0.1';
$root_pass = 'secret';

$account = 'accountna';
$email_account = $_POST['email'];
$email_domain = "mydomain.com";

$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_debug(1);

$args = array(
  'domain'=>$email_domain, 
  'email'=>$email_account
);


if ($xmlapi->api2_query($account, "Email", "passwdpop", array( 'domain' => "domain name", 'email' => "user name", 'password' => "new password") )) {
    echo "Success!";
};

【问题讨论】:

    标签: php xml api cpanel whm


    【解决方案1】:

    你需要设置端口! 在password_auth之前

    $xmlapi->set_port ( 2083 );
    $xmlapi->password_auth("root",$root_pass);
    

    【讨论】:

      猜你喜欢
      • 2017-09-26
      • 2016-09-19
      • 2012-06-24
      • 1970-01-01
      • 2019-12-06
      • 2014-12-02
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      相关资源
      最近更新 更多