Index: bio.module =================================================================== RCS file: /var/lib/cvs_web_solutions/w2/sites/all/modules/bio/bio.module,v retrieving revision 1.1 retrieving revision 1.3 diff -u -p -r1.1 -r1.3 --- bio.module 25 Jul 2007 21:33:43 -0000 1.1 +++ bio.module 26 Jul 2007 21:56:19 -0000 1.3 @@ -1,15 +1,29 @@ uid > 1) { + if (!bio_for_user($user->uid)) { + drupal_set_message(t('Please create a bio before continuing.'), 'error'); + drupal_goto('node/add/' . $nodetype, NULL, NULL, 303); + } + } + } + } } /** @@ -188,6 +202,7 @@ function bio_for_user($uid = NULL){ * - bio node type * - node types on which to display links * - use bio for profile + * - enforce bio creation */ function bio_settings() { $types = array(); @@ -221,5 +236,11 @@ function bio_settings() { '#description' => t('Display nothing but the bio node on the user profile page.'), '#default_value' => variable_get('bio_profile_takeover', 0), ); + $form['bio_enforce'] = array( + '#type' => 'checkbox', + '#title' => t('Enforce bio.'), + '#description' => t('Require every user to create a bio. If they have not, redirect them.'), + '#default_value' => variable_get('bio_enforce', 0), + ); return system_settings_form($form); }