? negative_bypass.patch
Index: userpoints.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.module,v
retrieving revision 1.67.2.58
diff -u -r1.67.2.58 userpoints.module
--- userpoints.module	16 May 2010 21:43:36 -0000	1.67.2.58
+++ userpoints.module	8 Jun 2010 16:29:49 -0000
@@ -19,6 +19,7 @@
 define('USERPOINTS_STATUS',              'userpoints_status');
 
 define('USERPOINTS_POINTS_MODERATION',    'userpoints_points_moderation');
+define('USERPOINTS_POINTS_MODERATION_NEGATIVE_BYPASS',    'userpoints_points_moderation_negative_bypass');
 
 define('USERPOINTS_TXN_STATUS_APPROVED',  0);
 define('USERPOINTS_TXN_STATUS_PENDING',   1);
@@ -311,6 +312,12 @@
     '#options'       => array(t('Approved'), t('Moderated')),
     '#description'   => t('Select whether all !points should be approved automatically, or moderated, and require admin approval', userpoints_translation()),
   );
+  
+  $form[$group][USERPOINTS_POINTS_MODERATION_NEGATIVE_BYPASS] = array(
+    '#type'          => 'checkbox',
+    '#title'         => t('Allow negative points to bypass moderation'),
+    '#default_value' => variable_get(USERPOINTS_POINTS_MODERATION_NEGATIVE_BYPASS, 0),
+  );
 
   $group = "Points expiration";
   $form[$group] = array(
@@ -581,7 +588,12 @@
 
     if (!isset($params['moderate'])) {
       //if not passed then site default is used
-      $params['status'] = variable_get(USERPOINTS_POINTS_MODERATION, 0);
+      if (variable_get(USERPOINTS_POINTS_MODERATION, 0)) {
+      
+        if ($params['points'] > 0 || (variable_get(USERPOINTS_POINTS_MODERATION_NEGATIVE_BYPASS, 0) == 0)) {
+          $params['status'] = 1;
+        }
+      }
     }
     else {
       if ($params['moderate'] == true) {
@@ -705,7 +717,12 @@
     }
     if (!isset($params['moderate'])) {
       //if not passed then site default is used
-      $params['status'] = variable_get(USERPOINTS_POINTS_MODERATION, 0);
+      if (variable_get(USERPOINTS_POINTS_MODERATION, 0)) {
+      
+        if ($params['points'] > 0 || (variable_get(USERPOINTS_POINTS_MODERATION_NEGATIVE_BYPASS, 0) == 0)) {
+          $params['status'] = 1;
+        }
+      }
     }
     else {
       if ($params['moderate'] == true) {
