Option to Disable Notify Status selector on Registration form

winston - August 29, 2009 - 14:39
Project:Notify
Version:6.x-1.0
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I've set the "access notify" permissions so that only specific roles should be able to access it. However, I just noticed that when a new user creates an account there is a checkbox there "Receive email notifications of news posted to this site. Notifications are sent every 1 hour." which defaults to on!

So my primary question is how do I make it so that this option doesn't show up on user login at all? That would solve the immediate problem.

A related question would be, is it perhaps a bug that even though I have set permissions such that not all roles can access notify that the new user process allows new users to bypass that permission?

#1

moondancerjen - September 16, 2009 - 18:11

I'd really like to know how to fix this too. I only wanted notify so our administrators would know when anonymous users post content.

#2

matt2000 - October 22, 2009 - 01:25

To be clear, the presence of that check box does not in any way override the permission. If a user registers with it checked, but they do not have a role that permits them to receive notifications, then they will not receive notifications.

To prevent the selector from appearing, you can comment out line 126 of notify module as follows:

<?php
/**
* Implementation of hook_user().
*/
function notify_user($type, &$edit, &$user, $category = NULL) {
  switch (
$type) {
    case
'delete':
     
db_query('DELETE FROM {notify} WHERE uid = %d', $user->uid);
      break;
   
    case
'register':
     
//return _notify_user_reg_fields();  //THIS IS LINE #126. See  // added at front <--------------------
     
break;
   
    case
'insert':
      if (isset(
$edit['notify_decision']) && $edit['notify_decision'] == 1){
       
db_query('INSERT INTO {notify} (uid, status, node, teasers, comment) VALUES (%d, %d, %d, %d, %d)', $user->uid, 1, 1, 0, 0);
       
$edit['notify_decision'] = NULL;
      }
      break;
   
  }
}
?>

#3

matt2000 - October 22, 2009 - 01:27

[dbl post]

#4

matt2000 - October 22, 2009 - 01:27

[dbl post]

#5

matt2000 - October 22, 2009 - 01:37

[dbl post -- something must be up with drupal.org's caching or DB replication, cause I swear this didn't seem to post at first.]

#6

matt2000 - October 22, 2009 - 01:37
Status:active» needs review

Since I made such a mess of this thread, I'll atone by offering this patch. It modifies the notify admin settings to allow for the registration check box to be removed.

AttachmentSize
notify_turn_off_registration_checkbox.patch 1.02 KB

#7

matt2000 - October 22, 2009 - 16:27
Title:How to prevent new accounts from turning on notify» Option to Disable Notify Status selector on Registration form
Category:support request» feature request
 
 

Drupal is a registered trademark of Dries Buytaert.