Index: bio.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bio/bio.module,v
retrieving revision 1.2.2.12
diff -u -r1.2.2.12 bio.module
--- bio.module	3 Jul 2007 18:28:09 -0000	1.2.2.12
+++ bio.module	11 Sep 2007 17:10:38 -0000
@@ -28,6 +28,19 @@
     );
   }
   else {
+    // Enforce creation of Bio Node
+    if (variable_get('bio_profile_required', 0)) {
+      if ($user->uid > 1 && strcmp('logout', $_GET['q'])) {
+        if (strcmp('user/' . $user->uid . '/bio', $_GET['q'])) {
+          if (!bio_for_user($user->uid)) {
+            $biotypename = node_get_types('name', variable_get('bio_nodetype','bio'));
+            drupal_set_message(t('Please create a %bio before continuing.', array('%bio' => $biotypename)), 'error');
+            drupal_goto('user/' . $user->uid . '/bio'); 
+          }
+        }
+      }
+    }
+    
     if (variable_get('bio_profile', 0) && (arg(0) == 'user') && (is_numeric(arg(1)))) {
       $type = variable_get('bio_nodetype','bio');
       $nid  = bio_for_user(arg(1));
@@ -222,6 +235,12 @@
     '#description' => t('Display nothing but the bio node on the user profile page.'),
     '#default_value' => variable_get('bio_profile_takeover', 0),
   );
+  $form['bio_profile_required'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Required'),
+    '#description' => t('Enforce the creation of a Bio node before using the rest of the site.'),
+    '#default_value' => variable_get('bio_profile_required', 0),
+  );
   $add_a_submit = system_settings_form($form);
   $add_a_submit['#validate']['bio_settings_validate_xxx'] = array();
   return $add_a_submit;
@@ -234,7 +253,9 @@
  * validate phase because submits were interfering with the #base attribute. Yuck.
  */
 function bio_settings_validate_xxx($form_id, $form_values) {
-  views_invalidate_cache();
+  if (module_exists('views')) {
+    views_invalidate_cache();
+  }
 }
 
 /**

