]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added configuration option to disable post-by-email.
authorJeffery To <jeffery.to@gmail.com>
Thu, 6 Aug 2009 17:55:31 +0000 (01:55 +0800)
committerJeffery To <jeffery.to@gmail.com>
Thu, 6 Aug 2009 17:55:31 +0000 (01:55 +0800)
This hides the relevant settings from the email settings page and
prevents maildaemon.php from processing email if the option is
disabled.

README
actions/emailsettings.php
config.php.sample
lib/common.php
scripts/maildaemon.php

diff --git a/README b/README
index e4cae0e49785405242bfe0cb222c62b149d49965..12c465869c5ab7b8b6fcc24194f7757518a59515 100644 (file)
--- a/README
+++ b/README
@@ -1228,6 +1228,14 @@ enabled: Set to true to enable. Default false.
 server: a string with the hostname of the sphinx server.
 port: an integer with the port number of the sphinx server.
 
+emailpost
+---------
+
+For post-by-email.
+
+enabled: Whether to enable post-by-email. Defaults to true. You will
+         also need to set up maildaemon.php.
+
 sms
 ---
 
index 634388fdddbdf41acae10d679719d45148c5d869..cdd09282991fab1cabdd3bb2e22ee6018ce04fad 100644 (file)
@@ -122,7 +122,7 @@ class EmailsettingsAction extends AccountSettingsAction
         }
         $this->elementEnd('fieldset');
 
-       if ($user->email) {
+       if (common_config('emailpost', 'enabled') && $user->email) {
             $this->elementStart('fieldset', array('id' => 'settings_email_incoming'));
             $this->element('legend',_('Incoming email'));
             if ($user->incomingemail) {
@@ -173,11 +173,13 @@ class EmailsettingsAction extends AccountSettingsAction
                         _('Allow friends to nudge me and send me an email.'),
                         $user->emailnotifynudge);
         $this->elementEnd('li');
-        $this->elementStart('li');
-        $this->checkbox('emailpost',
-                        _('I want to post notices by email.'),
-                        $user->emailpost);
-        $this->elementEnd('li');
+        if (common_config('emailpost', 'enabled')) {
+            $this->elementStart('li');
+            $this->checkbox('emailpost',
+                            _('I want to post notices by email.'),
+                            $user->emailpost);
+            $this->elementEnd('li');
+        }
         $this->elementStart('li');
         $this->checkbox('emailmicroid',
                         _('Publish a MicroID for my email address.'),
index 91be39f489ad1022cbde0aae8d9d27780a47144c..21b6865e150e503444183bccbde45c621b37d1c6 100644 (file)
@@ -164,6 +164,9 @@ $config['sphinx']['port'] = 3312;
 // $config['memcached']['server'] = 'localhost';
 // $config['memcached']['port'] = 11211;
 
+// Disable post-by-email
+// $config['emailpost']['enabled'] = false;
+
 // Disable SMS
 // $config['sms']['enabled'] = false;
 
index 12a7ac4499a290dea552e4f7e542e6106563959d..6d20534ae7b7b703319acd627435feada01f3ff3 100644 (file)
@@ -183,6 +183,8 @@ $config =
         array('piddir' => '/var/run',
               'user' => false,
               'group' => false),
+        'emailpost' =>
+        array('enabled' => true),
         'sms' =>
         array('enabled' => false),
         'twitter' =>
index 3ef4d06383f99cba74214c5f170d5ececcbd20a9..91c257adb451fd468af1a5da305beee297580c27 100755 (executable)
@@ -385,5 +385,7 @@ class MailerDaemon
     }
 }
 
-$md = new MailerDaemon();
-$md->handle_message('php://stdin');
+if (common_config('emailpost', 'enabled')) {
+    $md = new MailerDaemon();
+    $md->handle_message('php://stdin');
+}