我一直在思考如何让我的用户使用 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!";
};