domain_source_update_nodes($form_id, $form_values)
domain_source/domain_source.module, line 153
FormAPI function that lets us update access rules.
function domain_source_update_nodes($form_id, $form_values) {
// If our operation is flagged, then we have to manually change the
// {node_access} table. The rest of the process will clear the cache,
// so this should be a safe operation.
if ($form_values['operation'] == 'domain') {
$source = $form_values['domain_source'];
foreach ($form_values['nodes'] as $key => $value) {
if ($key == $value) {
db_query("DELETE FROM {domain_source} WHERE nid = %d", $key);
db_query("INSERT INTO {domain_source} (nid, domain_id) VALUES (%d, %d)", $key, $source);
}
}
}
}