function hosting_import_client in Hostmaster (Aegir) 6
Helper function to generate new client node during import.
Parameters
$name: Client email address or name.
$organization: Client name, title, organization or machine name - deprecated.
Return value
The nid of the generated client.
Deprecated
the organization and email parameters will be dropped in 2.x in favor of the name parameter, which will become the sole argument.
2 calls to hosting_import_client()
- hosting_import_site in modules/
hosting/ site/ hosting_site.module - Helper function to generate update a site node during import.
- hosting_site_drush_context_import in modules/
hosting/ site/ hosting_site.drush.inc
File
- modules/
hosting/ client/ hosting_client.module, line 562
Code
function hosting_import_client($name, $organization = '') {
$client = hosting_get_client_by_uname($name);
if (!$client) {
$client = hosting_get_client($name);
}
if (!$client) {
$client = hosting_get_client_by_email($name);
}
if (!$client) {
$client = new stdClass();
$client->type = 'client';
$client->uid = 1;
$client->title = trim($name);
$client->status = 1;
node_save($client);
}
return $client;
}