--- C:/Users/kenorb/AppData/Local/Temp/content_profile.module-revBASE.svn006.tmp.module	Fri Aug 07 14:51:09 2009
+++ D:/bro/workspace/Websites/XComKids/trunk/sites/all/modules/contributions/content_profile/content_profile.module	Fri Aug 07 14:50:43 2009
@@ -376,6 +376,17 @@
   if ($op == 'prepare' && is_content_profile($node) && !isset($node->nid) && $node->uid && !user_access('administer nodes') && arg(0) != 'admin') {
     // Check if this nodetype already exists
     if ($nid = content_profile_profile_exists($node, $node->uid)) {
+        if (module_exists('autoassignrole')) {
+            $path = drupal_get_path_alias($_GET['q']);
+            $page = db_fetch_object(db_query("SELECT rid FROM {autoassignrole_page} WHERE path = '%s'", $path)); // check choosen forms by the user
+            $profile_types = content_profile_get_types('names', 'registration_use'); // get content profile types list
+            foreach ($profile_types as $type => $typename) {
+                $enabled = variable_get('autoassignrole_content_profile_'. $type, 0); // check if this content has been enabled (at admin/content/node-type/%) via autoassignrole
+                if($enabled != $page->rid) {
+                    return; // RETURN if content is different that set via autoassignrole
+                }
+            }
+        }
       // This node already exists, redirect to edit page
       drupal_goto('node/'. $nid .'/edit', 'destination=user/'. $node->uid);
     }
