All pastes #63456 Raw Edit

Robin Monks

public php v1 · immutable
#63456 ·published 2006-06-09 23:20 UTC
rendered paste body
<?php// This is actually the nessasary code for the civic_mom profile.// We had to put it here due to "shortcomings" in the installer.function page_install_configure (&$form) {return $form;}function page_install_configure_submit () {  $profile1 = 'Messenger';  $profile2 = 'Blogger';  $perms1 = "create pages, edit own pages";  $perms2 = "edit own blog";  db_query("INSERT INTO {role} (name) VALUES ('%s')", $profile1);  $res1 = db_fetch_object(db_query("SELECT * FROM {role} WHERE name = ('%s')", $profile1));  $role_id1 = $res1->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);}