this is EXTREMELY easy to do. just write a short function to make the following call to the WHMCS API while storing the user's joomla profile info in an array called $DetailArray:
Code:
$url = "api.php"; # URL to WHMCS API file
$username = "admin"; # Admin username goes here
$password = "admin"; # Admin password goes here
$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "addclient";
$postfields["firstname"] = $Detail_Array[firstname];
$postfields["lastname"] = $Detail_Array[lastname];
$postfields["companyname"] = $Detail_Array[business];
$postfields["email"] = $Detail_Array[email];
$postfields["address1"] = $Detail_Array[address];
$postfields["address2"] = $Detail_Array[address2];
$postfields["city"] = $Detail_Array[city];
$postfields["state"] = $Detail_Array[state];
$postfields["postcode"] = $Detail_Array[postcode];
$postfields["country"] = "AU";
$postfields["phonenumber"] = $Detail_Array[phone];
$postfields["password2"] = $Detail_Array[password];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$data = explode(";",$data);
foreach ($data AS $temp) {
$temp = explode("=",$temp);
$results[$temp[0]] = $temp[1];
}
if ($results["result"]=="success") {
# Result was OK!
echo("Success, new client id is ". $results["clientid"]);
} else {
# An error occured
echo "The following error occured: ".$results["message"];
}
then just save the user's $clientID into a field in the joomla user table. You can then submit their username and password to the WHMCS login page using a link on your joomla homepage.
We did the same thing on our website, but we dont use Joomla. its the same deal though.
I've never actually used Joomla, but if it's writen in PHP with MySQL, then you should be able to use this code (mostly borrowed from the WHMCS API documentation) to do what you want to do.