rid; db_query("INSERT INTO {role} (name) VALUES ('%s')", $profile2); $res2 = db_fetch_object(db_query("SELECT * FROM {role} WHERE name = ('%s')", $profile2)); $role_id2 = $res2->rid; db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role_id1, $perms1); db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role_id2, $perms2); $node = new stdClass(); $node->title = "Create new user"; //This is also used to key this node, if you change it here you must change it below as well. You've been warned ;o) $node->type = 'page'; $node->uid = 1; $node->status = 1; $node->promote = 0; $node->moderate = 0; $node->sticky = 0; $node->body = "Use the CiviCRM \"New Individual\" block to create a new CiviCRM user."; $node->teaser = node_teaser($node->body); $node->format = FILTER_FORMAT_DEFAULT; node_save($node); $node_ref = db_fetch_object(db_query("SELECT * FROM {node} WHERE title = '%s';", $node->title)); $node_id = $node_ref->nid; _block_rehash(); db_query("UPDATE {blocks} SET status = 1 WHERE module = 'civicrm' AND delta = 8;"); db_query("UPDATE {blocks} SET visibility = 1 WHERE module = 'civicrm' AND delta = 8;"); db_query("UPDATE {blocks} SET pages = 'node/$node_id' WHERE module = 'civicrm' AND delta = 8;"); }