Heya,
So I've added a feature to my site which allows for automatic creation of [email protected] whenever a new employee is added. However, the current system I use is using plain text password to login to cPanel, and I was wondering, can I upgrade this? Since it's a commercial system, I'd have to store password in a table, in plain text, which is something I'd rather not do.
I've attached the api file (too long to list here). Here's an example of code that uses it:
View attachment xmlapi.zip
Thank you and have a nice day!
So I've added a feature to my site which allows for automatic creation of [email protected] whenever a new employee is added. However, the current system I use is using plain text password to login to cPanel, and I was wondering, can I upgrade this? Since it's a commercial system, I'd have to store password in a table, in plain text, which is something I'd rather not do.
I've attached the api file (too long to list here). Here's an example of code that uses it:
Code:
$ip = $_SERVER['SERVER_ADDR'];
$root_pass = $cpp; // Grabbed from database, stored in plain text
$account = $cpu; // Grabbed from database, stored in plain text
$email_user = $username;
$email_password = $rand ;
$email_domain = $domain;
$email_quota = 'Unlimited';
$xmlapi = new xmlapi($ip);
$xmlapi->set_port(2083);/* the ssl port for cpanel */
$xmlapi->password_auth($account,$root_pass);
$xmlapi->set_output('json');
$xmlapi->set_debug(1);
print $xmlapi->api1_query($account, "Email", "addpop", array($email_user, $email_password, $email_quota, $email_domain) );
$wm = $username . "@" . $domain;
Thank you and have a nice day!