--- org.ec_useracc.module	2007-11-10 18:48:05.558998000 -0800
+++ ec_useracc.module	2007-11-10 18:48:04.563035000 -0800
@@ -93,14 +93,29 @@ function ec_useracc_blank() {
  * Implementation of hook_settings()
  */
 function ec_useracc_ec_settings() {
-  $form = ec_mail_selection_form_for_variable('ec_useracc_settings_form',
+  $form['account_creation_notices'] = array(
+    '#type'           => 'radios',
+    '#title'          => t('Account creation e-mail notices'),
+    '#default_value'  => variable_get('account_creation_notices', 0),
+    '#options'        => array(t('Enabled'), t('Disabled')),
+    '#description'    => t('Enable or disable email notifications per account creation.')
+  );
+
+  $form[MAILVAR_EMAIL_CONFIRM] = ec_mail_selection_form_for_variable('ec_useracc_settings_form',
     ECMAIL_TYPE_EMAIL_CONFIRM, t('Confirmation e-mail'), MAILVAR_EMAIL_CONFIRM,
     t('This mail will be sent to confirm a new user\'s email address. If you want to edit this mail or add more mails see the !url page.',
     array('!url' => l(t('Mail settings'), 'admin/ecsettings/ec_mail'))));
+  if (variable_get('account_creation_notices', 0)) {
+    $form[MAILVAR_EMAIL_CONFIRM][MAILVAR_EMAIL_CONFIRM]['#disabled'] = TRUE;
+  }
+
   $form[MAILVAR_SITE_WELCOME] =  ec_mail_selection_form_for_variable('ec_useracc_settings_form',
     ECMAIL_TYPE_SITE_WELCOME, t('Welcome mail'), MAILVAR_SITE_WELCOME,
     t('This mail will be sent to confirm a new user\'s email address. If you want to edit this mail or add more mails see the !url page.',
     array('!url' => l(t('Mail settings'), 'admin/ecsettings/ec_mail'))));
+  if (variable_get('account_creation_notices', 0)) {
+    $form[MAILVAR_SITE_WELCOME][MAILVAR_SITE_WELCOME]['#disabled'] = TRUE;
+  }
 
   $form['useracc_confirm_expiry'] = array(
     '#type' => 'select',
@@ -109,6 +124,9 @@ function ec_useracc_ec_settings() {
     '#options' => drupal_map_assoc(range(1, 31)),
     '#description' => t('This is the number of days an email confirmation is valid for. If the confirmation is not made within this time the cron system removes them along with the unused user account.')
   );
+  if (variable_get('account_creation_notices', 0)) {
+    $form['useracc_confirm_expiry']['#disabled'] = TRUE;
+  }
 
   return system_settings_form($form);
 }
@@ -399,6 +418,7 @@ function ec_useracc_create(&$txn, &$node
 
   module_invoke_all('useraccapi', $txn, 'account activated');
 
+if (!variable_get('account_creation_notices', 0)) {
   if ($txn->gross != 0) {
     ec_useracc_send_welcome($account, $newacc['pass']);
   }
@@ -409,6 +429,7 @@ function ec_useracc_create(&$txn, &$node
     $_REQUEST['destination'] = url('ec_useracc');
     return;
   }
+}
 
   /**
    * FIXME: The problem with loging in the current user is that we have no
