Index: usernode.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/usernode/usernode.module,v
retrieving revision 1.5.2.7
diff -u -r1.5.2.7 usernode.module
--- usernode.module	28 Mar 2007 15:45:27 -0000	1.5.2.7
+++ usernode.module	6 Feb 2008 16:13:55 -0000
@@ -25,6 +25,7 @@
  * The usernode form
  */
 function usernode_form(&$node) {
+  $form = array();
   $form['title'] = array(
     '#type' => 'hidden',
     '#default_value' => $node->title
@@ -206,6 +207,23 @@
 }
 
 /**
+ * @return array
+ */
+function usernode_settings() {
+  $form = array();
+
+  $form['usernode_default_status'] = array(
+    '#type' => 'radios',
+    '#title' => t('Default published status'),
+    '#default_value' => variable_get('usernode_default_status', 0),
+    '#options' => array(t("Sync with users' active/blocked status"), t("Use content type's configuration default")),
+    '#description' => t("Syncing with the users' status will unpublish their corresponding usernode when the user is blocked and publish the usernode when the user is re-activated. Using the content type default sets the published status on usernode creation according to the !usernode_settings.", array('!usernode_settings' => l(t('usernode content type settings'), 'admin/settings/content-types/usernode'))),
+  );
+
+  return $form;
+}
+
+/**
  * Create an associated node. Called by hook_user();
  */
 function usernode_create_node(&$user) {
@@ -218,7 +236,7 @@
   $node->type = USERNODE_CONTENT_TYPE;
   $node->title = check_plain($user->name);
   $node = node_submit($node);
-  $node->status = $node->status && $user->status;
+  $node->status = variable_get('usernode_default_status', 0) ? $node->status : ($node->status && $user->status);
   node_save($node);
 
   db_query("INSERT INTO {usernode} (nid,uid) VALUES(%d,%d)",$node->nid, $user->uid);
@@ -230,17 +248,18 @@
 function usernode_update_node(&$user, &$edit) {
   $node = usernode_get_node($user);
   $node_options = variable_get('node_options_'. USERNODE_CONTENT_TYPE, array('status', 'promote'));
+
+  // (bool) = default status was set on admin/settings/content-types/usernode
   $status = in_array('status', $node_options);
 
   $changed = FALSE;
+
+  // status default setting exists && current node status != submitted status from a node edit submission
   if ($status && $node->status != $edit['status']) {
     $node->status = $edit['status'];
     $changed = TRUE;
   }
-  else if (!$status && $node->status) {
-    $node->status = $status;
-    $changed = TRUE;
-  }
+
   if ($edit['name'] && $user->name != $edit['name']) {
     $node->title = check_plain($edit['name']);
     $changed = TRUE;
