domain_enable

Definition

domain_enable()
domain.module, line 913

Description

Upon enabling this module, store the default view grant in the {node_access} table. @see domain_grant_all()

Code

function domain_enable() {
  domain_enabling(TRUE);
  // Rebuild the node access table with our rules.
  node_access_rebuild();
  // Set the default 'domain_all' grant for special pages.
  domain_set_default_grant();
  // Put all the grant records into the {domain_access} table.
  $realms = array('domain_site', 'domain_id', 'domain_editor');
  foreach ($realms as $realm) {
    $result = db_query("SELECT * FROM {node_access} WHERE realm = '%s'", $realm);
    while ($data = db_fetch_array($result)) {
      db_query("INSERT INTO {domain_access} VALUES (%d, %d, '%s')", $data['nid'], $data['gid'], $data['realm']);
    }
  }
}