All pastes #69375 Raw Edit

clueless

public text v1 · immutable
#69375 ·published 2006-06-22 20:57 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->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;");}