You are here

function content_access_save_per_node_settings in Content Access 5

Same name and namespace in other branches
  1. 8 content_access.module \content_access_save_per_node_settings()
  2. 6 content_access.module \content_access_save_per_node_settings()
  3. 7 content_access.module \content_access_save_per_node_settings()
3 calls to content_access_save_per_node_settings()
content_access_action_reset_node_permissions in ./content_access.workflow_ng.inc
Action implementation: Reset permissions for a node.
content_access_action_set_node_permissions in ./content_access.workflow_ng.inc
Action implementation: Set permissions for a node.
content_access_page_submit in ./content_access.module

File

./content_access.module, line 534

Code

function content_access_save_per_node_settings($node, $settings) {
  db_query("UPDATE {content_access} SET settings = '%s' WHERE nid = %d", serialize($settings), $node->nid);
  if (!db_affected_rows()) {
    db_query("INSERT INTO {content_access} (nid, settings) VALUES(%d, '%s')", $node->nid, serialize($settings));
  }

  //make content_access_per_node_setting() use the new settings
  content_access_per_node_setting(NULL, $node, $settings);
}