﻿Index: content_profile.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/content_profile/Attic/content_profile.module,v
retrieving revision 1.1.2.35
diff -u -r1.1.2.35 content_profile.module
--- content_profile.module	2 Feb 2009 13:57:37 -0000	1.1.2.35
+++ content_profile.module	5 Feb 2009 09:09:27 -0000
@@ -363,8 +363,8 @@
 function content_profile_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   global $last_nid;
 
-  if ($op == 'prepare' && is_content_profile($node) && !isset($node->nid) && $node->uid && !user_access('administer nodes')) {
-    // Check if this nodetype already exists
+  if ($op == 'prepare' && is_content_profile($node) && !isset($node->nid) && $node->uid && !user_access('administer nodes') && !( arg(2)=="user" && arg(3)=="create" )) {
+  // Check if this nodetype already exists
     if ($nid = content_profile_profile_exists($node, $node->uid)) {
       // This node already exists, redirect to edit page
       drupal_goto('node/'. $nid .'/edit', 'destination=user/'. $node->uid);
Index: modules/content_profile_registration.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/content_profile/modules/Attic/content_profile_registration.module,v
retrieving revision 1.1.2.25
diff -u -r1.1.2.25 content_profile_registration.module
--- modules/content_profile_registration.module	7 Jan 2009 11:02:28 -0000	1.1.2.25
+++ modules/content_profile_registration.module	5 Feb 2009 09:09:27 -0000
@@ -10,10 +10,9 @@
  * Implementation of hook_form_alter().
  */
 function content_profile_registration_form_alter(&$form, &$form_state, $form_id) {
-  // Note: We don't add the registration form to the admin create user form.
-  if ($form_id == 'user_register' && module_exists('content') && arg(0) != 'admin') {
+  if ($form_id == 'user_register' && module_exists('content')) {
     require_once drupal_get_path('module', 'node') .'/node.pages.inc';
-    $profile_types = content_profile_get_types('names', 'registration_use');
+    $profile_types = content_profile_get_types('names', arg(0) == 'admin' ? 'admin_user_add_use' : 'registration_use' );
     $form += array('#field_info' => array());
 
     foreach ($profile_types as $type => $typename) {
@@ -65,11 +64,17 @@
         '#description' => t('Use this content type on the user registration page'),
         '#default_value' => content_profile_get_settings($type, 'registration_use'),
       );
+      $form['registration']['admin_user_add_use'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Use on admin add user page'),
+        '#description' => t('Use this content type when an admin creates a new user'),
+        '#default_value' => content_profile_get_settings($type, 'admin_user_add_use'),
+      );          
       $options = _content_profile_registration_get_field_select($type, FALSE);
       if (!empty($options)) {
         $form['registration']['registration_hide'] = array(
           '#type' => 'checkboxes',
-          '#title' => t('Hide these fields during registration'),
+          '#title' => t('Hide these fields during registration and user creation'),
           '#options' => $options,
           '#default_value' => content_profile_get_settings($type, 'registration_hide'),
         );
@@ -130,7 +135,9 @@
  * Validates the user registration form
  */
 function content_profile_registration_user_register_validate($form, &$form_state) {
-  foreach (content_profile_get_types('names', 'registration_use') as $type => $typename) {
+  $profile_types = content_profile_get_types('names', arg(0) == 'admin' ? 'admin_user_add_use' : 'registration_use' );
+  foreach ($profile_types as $type => $typename) {
+
     $node = new StdClass;
     $node->type = $type;
 
@@ -146,7 +153,8 @@
  * Submits the user registration form
  */
 function content_profile_registration_user_register_submit($form, &$form_state) {
-  foreach (content_profile_get_types('names', 'registration_use') as $type => $typename) {
+  $profile_types = content_profile_get_types('names', arg(0) == 'admin' ? 'admin_user_add_use' : 'registration_use' );
+  foreach ($profile_types as $type => $typename) {
     if ($node = &$form_state['content_profile_registration'][$type]['node']) {
       // Set user's information for the node.
       $node->title = $form_state['user']->name;
@@ -170,6 +178,7 @@
 function content_profile_registration_content_profile_settings() {
   return array(
     'registration_use' => FALSE,
+    'admin_user_add_use' => FALSE, 
     'registration_hide' => array(),
   );
 }
