<?php
$user_domain="domein.ext"; // Domainname, without http:// or www. without a traiing slash
$user_cpanel="domein"; // cpanel username
$user_pass="demo"; // cPanel-password
$user_theme="x"; // cPanel-theme (by default 'x')
function create_acct($acct, $domain, $meg, $mpassword, $cpaneluser, $cpanelpass, $user_theme) {
$o = "http://$cpaneluser:[email protected]$domain:2082/frontend/".$user_theme."/mail/doaddpop.html?email=$acct&domain=$domain&password=$mpassword"a=3";
$tester = @file($o);
if( strstr($tester[109], 'Sorry the account') )
{
return 'Sorry, this address exists already. Please try again.';
}
else
{
return 'Your email address was addes succesfully..<br>'
.'Your username is is: '. $_POST['acct'] .'@domein.nl'
.'<br>Your password is: '. $_POST['pass']
."<br><br>Go to <a href=http://$_POST[acct]@domein.nl:$_POST[pass]@domein.nl:2095/>"
."http://$_POST[acct]@domein.nl:$_POST[pass]@domein.nl:2095/</a> in order to manage your account<br><br>";
}
}
function remove_acct($acct, $domain, $cpaneluser, $cpanelpass, $user_theme) {
$o = "http://$cpaneluser:[email protected]$domain:2082/frontend/".$user_theme."/mail/realdelpop.html?email=$acct&domain=$domain";
$tester = @file($o);
return "succesfully deleted<br>";
}
if ($_POST['make'])
{
echo create_acct($_POST['acct'],$user_domain,$_POST['megs'],$_POST['pass'],$user_cpanel,$user_pass, $user_theme);
}
elseif ($_POST['remove'])
{
echo remove_acct($_POST['acct'],$user_domain,$user_cpanel,$user_pass, $user_theme);
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="nl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Create/delete mail account</title>
</head>
<body>
<form method="POST" action="<? echo $PHP_SELF; ?>">
<p>username <input type="text" name="acct" size="20">@<? echo $user_domain; ?></p>
<p>password <input type="text" name="pass" size="20"> (not needed when deleting)</p>
<p>quota <input type="text" name="megs" size="20"> (not needed when deleted)</p>
<p><input type="submit" value="make" name="make"><input type="submit" value="remove" name="remove"></p>
</form>
</body>
</html>