Created
March 26, 2012 13:56
-
-
Save jutaz/2205220 to your computer and use it in GitHub Desktop.
kloxo add client function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createAccount($params) { | |
//all aviable options | |
$domain = $params['domain']; | |
$username = $params['username']; | |
$password = $params['password']; | |
$clientsdetails = $params['clientsdetails']; | |
$email = $clientsdetails['email']; | |
$resourcePlan = $params['resourcePlan']; | |
$dnsTemplate = $params['dnsTemplate']; | |
$webServer = $params['webServer']; | |
$mailServer = $params['mailServer']; | |
$mysqlServer = $params['mysqlServer']; | |
$dnsServers = $params['dnsServers']; | |
//end all options | |
$json = $this->KloxoCore->getResourcePlans(); | |
if ($json->return === "error") { | |
return $json->message; | |
} | |
$resourcePlanInternal = $this->KloxoCore->getinternalresourcename($json->result, $resourcePlan); | |
$json = $this->KloxoCore->callApi("action=add&class=client&name=" . $username . "&v-password=" . $password . "&v-plan_name=" . $resourcePlanInternal . "&v-type=customer" . "&v-contactemail=" . $email . "&v-send_welcome_f=off" . "&v-domain_name=" . $domain . "&v-dnstemplate_name=" . $dnsTemplate . "&v-websyncserver" . $webServer . "&v-mmailsyncserver=" . $mailServer . "&v-mysqldbsyncserver=" . $mysqlServer . "&v-dnssyncserver_list=" . $dnsServers); | |
$json = $this->helper->checkJsonReturn($json); | |
if (!$json) { | |
return $json; | |
} else { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment