--- revision_moderation.module	27 Dec 2008 22:27:36 -0000	1.49
+++ revision_moderation.module	18 Mar 2009 18:30:21 -0000
@@ -78,7 +78,13 @@ function revision_moderation_settings() 
     '#default_value' => variable_get('revision_moderation_exempt', 1),
     '#description' => t('With this option enabled, users with the "administer nodes" privilege will bypass the moderation system, and their revisions will be published immediately.'),
   );
-
+	$form['revision_moderation_unpublish_exempt'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Allow changes to unpublished nodes without revision moderation'),
+    '#default_value' => variable_get('revision_moderation_unpublish_exempt', 1),
+    '#description' => t('With this option enabled, edits to an unpublished node will bypass the moderation system. This does not affect the node once published.'),
+  );
+	
   return system_settings_form($form);
 }
 
@@ -190,9 +196,11 @@ function revision_moderation_nodeapi(&$n
   // Only do this logic for non-admin users on nodes with revision moderation
   // turned on.
   // And not editing a chose revision
+	// Bypass if this node is unpublished and unpuslished_exempt is checked
   if ($node->nid && $node->revision_moderation == 1 && arg(2) != 'revisions'
-    && (!user_access('administer nodes') || !variable_get('revision_moderation_exempt', 1))) {
-    switch ($op) {
+    && (!user_access('administer nodes') || !variable_get('revision_moderation_exempt', 1))
+		&& (($node->status == 1 || ($node->status == 0 && !variable_get('revision_moderation_unpublish_exempt', 1))))) {
+		switch ($op) {
       case 'prepare':
         // If user has a pending revision for this node, load the latest version of
         // it instead.