function hosting_client_user_form_submit in Hosting 6.2
Same name and namespace in other branches
- 5 client/hosting_client.access.inc \hosting_client_user_form_submit()
- 7.4 client/hosting_client.access.inc \hosting_client_user_form_submit()
- 7.3 client/hosting_client.access.inc \hosting_client_user_form_submit()
Save the values submitted when editing or adding a user.
See also
1 call to hosting_client_user_form_submit()
- hosting_client_user in client/
hosting_client.access.inc - Implements hook_user().
File
- client/
hosting_client.access.inc, line 143 - Control client node access.
Code
function hosting_client_user_form_submit($edit, $user) {
if (array_key_exists('clients', $edit)) {
foreach ($edit['clients'] as $client) {
$query = db_query('DELETE FROM {hosting_client_user} WHERE user = %d AND client = %d', $user->uid, $client);
}
}
if (array_key_exists('hosting_client', $edit) && $edit['hosting_client']) {
$client = hosting_get_client($edit['hosting_client']);
$query = db_query('INSERT INTO {hosting_client_user} (client, user, contact_type) VALUES (%d, %d, "%s")', $client->nid, $user->uid, '');
}
}