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_id = $node_ref->nid; $crm_block['visibility'] = 1; $crm_block['custom'] = 0; $crm_block['pages'] = 'node/'. $node_id; $crm_block['module'] = 'civicrm'; $crm_block['delta'] = 8; _block_rehash(); block_admin_configure_submit(NULL, $crm_block); }