? dba_mail.patch
? dba_mail_option.patch
Index: dba.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dba/dba.module,v
retrieving revision 1.54
diff -u -p -r1.54 dba.module
--- dba.module	24 Jun 2007 03:41:12 -0000	1.54
+++ dba.module	5 Oct 2007 21:00:14 -0000
@@ -265,12 +265,11 @@ function dba_settings_form() {
       '#attributes' => $attributes,
     );
   }
-  $form['backup']['dba_auto_backup_mail'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Mail backup to administrator'),
-    '#return_value' => 1,
-    '#default_value' => variable_get('dba_auto_backup_mail', 0),
-    '#description' => t("Enable this option to have a copy of the database backup files mailed to your administrator's email address."),
+  $form['backup']['dba_auto_backup_email'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Email address to send backup file.  Leave blank to disable.'),
+    '#default_value' => variable_get('dba_auto_backup_email',''),
+    '#description' => t("A copy of the backup will be sent to this email address.  To allow all variations of accounts (i.e. local) no validation is performed, so get this right."),
     '#attributes' => $attributes,
   );
   $form['backup']['dba_auto_backup_exclude_tables'] = array(
@@ -379,7 +378,7 @@ function dba_auto_backup() {
       variable_set('dba_auto_backup_last', time());
 
       // If enabled, email a copy of the backup to the site administrator.
-      if (variable_get('dba_auto_backup_mail', 0)) {
+      if (strlen(variable_get('dba_auto_backup_email', '')) > 0) {
         $attachment = new stdClass();
         $attachment->path = $path ."/$filename";
         $attachment->filename = $filename;
@@ -1551,8 +1550,7 @@ function dba_mail_backup($attachment) {
   $mail = new mime_mail();
   $mail->from = variable_get('site_mail', ini_get('sendmail_from'));
   $mail->headers = 'Errors-To: [EMAIL='. $mail->from .']'. $mail->from .'[/EMAIL]';
-  $admin = user_load(array('uid' => 1));
-  $mail->to = $admin->mail;
+  $mail->to = variable_get('dba_auto_backup_email', '');
   $mail->subject = t('Database backup from !site: !file', array('!site' => variable_get('site_name', 'drupal'), '!file' => $attachment->filename));
   $mail->body = t('Database backup attached');
   
