? nbproject
? notify_new_user_default.patch
Index: notify.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/notify/notify.module,v
retrieving revision 2.75
diff -u -p -r2.75 notify.module
--- notify.module	13 Mar 2009 02:32:27 -0000	2.75
+++ notify.module	23 Jun 2009 23:19:45 -0000
@@ -68,6 +68,13 @@ function notify_admin_settings() {
     '#default_value' => variable_get('notify_attempts', array(5)),
     '#options' => array(t('Disabled'), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20),
   );
+
+    $form[notify_settings]['notify_reg_default'] = array(
+      '#type' => 'checkbox',
+      '#title' => 'Notification checkbox default on new user registration form',
+      '#return_value' => 1,
+      '#default_value' => variable_get('notify_reg_default',1),
+    );
     
   $set = 'ntype';
   $form[$set] = array(
@@ -134,6 +141,8 @@ function notify_user($type, &$edit, &$us
  * Returns form fields to be added to User Regsitration form
  */
 function _notify_user_reg_fields() {
+  if (!user_access('access notify')) return;
+
   // Get the variable for how often the notifications are sent out
   $period = variable_get("notify_send", 86400);
 
@@ -149,7 +158,7 @@ function _notify_user_reg_fields() {
     '#type' => 'checkbox',
     '#title' => t('Receive email notifications of news posted to this site. Notifications are sent every ' . format_interval($period).'.'),
     '#return_value' => 1,
-    '#default_value' => 1,
+    '#default_value' => variable_get('notify_reg_default',1),
     '#description' => t('By accepting to receive <em>daily email news notifications</em>, you will be kept informed of news associated with ' . variable_get('site_name', 'Drupal') . '.')
   );
 
