]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'jeff-themovie/0.8.x-subsystems-enabled' into 0.8.x
authorCraig Andrews <candrews@integralblue.com>
Fri, 7 Aug 2009 02:38:06 +0000 (22:38 -0400)
committerCraig Andrews <candrews@integralblue.com>
Fri, 7 Aug 2009 02:38:06 +0000 (22:38 -0400)
12 files changed:
README
actions/emailsettings.php
actions/imsettings.php
actions/smssettings.php
actions/subscriptions.php
actions/twittersettings.php
config.php.sample
lib/action.php
lib/common.php
lib/connectsettingsaction.php
scripts/getvaliddaemons.php
scripts/maildaemon.php

diff --git a/README b/README
index ef5a1393468fb7bd22ef1e5d1207a3b2e5e79c98..12c465869c5ab7b8b6fcc24194f7757518a59515 100644 (file)
--- a/README
+++ b/README
@@ -1228,6 +1228,30 @@ 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
+---
+
+For SMS integration.
+
+enabled: Whether to enable SMS integration. Defaults to true. Queues
+         should also be enabled.
+
+twitter
+-------
+
+For Twitter integration
+
+enabled: Whether to enable Twitter integration. Defaults to true.
+         Queues should also be enabled.
+
 integration
 -----------
 
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 e0f5ede3a7520c1069a9906c229c12416730603c..70a6f37d4f78e0fc4f207b15eb7617c3323fb2ad 100644 (file)
@@ -84,6 +84,12 @@ class ImsettingsAction extends ConnectSettingsAction
 
     function showContent()
     {
+        if (!common_config('xmpp', 'enabled')) {
+            $this->element('div', array('class' => 'error'),
+                           _('IM is not available.'));
+            return;
+        }
+
         $user = common_current_user();
         $this->elementStart('form', array('method' => 'post',
                                           'id' => 'form_settings_im',
index 922bab9a4e3bc2ccec5bd15ad9df102d19e376ff..33b54abf6a531de6c35f84bb2c1062ceace6af8b 100644 (file)
@@ -80,6 +80,12 @@ class SmssettingsAction extends ConnectSettingsAction
 
     function showContent()
     {
+        if (!common_config('sms', 'enabled')) {
+            $this->element('div', array('class' => 'error'),
+                           _('SMS is not available.'));
+            return;
+        }
+
         $user = common_current_user();
 
         $this->elementStart('form', array('method' => 'post',
index 42bdae10f78c160846de3f97d364bddfa88f390a..0724471ff6c946dd81d9eda5cd271f8401b7d7cc 100644 (file)
@@ -174,14 +174,26 @@ class SubscriptionsListItem extends SubscriptionListItem
             return;
         }
 
+        if (!common_config('xmpp', 'enabled') && !common_config('sms', 'enabled')) {
+            return;
+        }
+
         $this->out->elementStart('form', array('id' => 'subedit-' . $this->profile->id,
                                           'method' => 'post',
                                           'class' => 'form_subscription_edit',
                                           'action' => common_local_url('subedit')));
         $this->out->hidden('token', common_session_token());
         $this->out->hidden('profile', $this->profile->id);
-        $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
-        $this->out->checkbox('sms', _('SMS'), $sub->sms);
+        if (common_config('xmpp', 'enabled')) {
+            $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
+        } else {
+            $this->out->hidden('jabber', $sub->jabber);
+        }
+        if (common_config('sms', 'enabled')) {
+            $this->out->checkbox('sms', _('SMS'), $sub->sms);
+        } else {
+            $this->out->hidden('sms', $sub->sms);
+        }
         $this->out->submit('save', _('Save'));
         $this->out->elementEnd('form');
         return;
index 2b742788eee55419112a718d271f6e4285960163..3343dba95a20d240a0a42f1ab14ae97e650e6223 100644 (file)
@@ -85,6 +85,12 @@ class TwittersettingsAction extends ConnectSettingsAction
 
     function showContent()
     {
+        if (!common_config('twitter', 'enabled')) {
+            $this->element('div', array('class' => 'error'),
+                           _('Twitter is not available.'));
+            return;
+        }
+
         $user = common_current_user();
 
         $profile = $user->getProfile();
index c27645ff874cb98863d1be99fd728344f62edddc..21b6865e150e503444183bccbde45c621b37d1c6 100644 (file)
@@ -164,6 +164,15 @@ $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;
+
+// Disable Twitter integration
+// $config['twitter']['enabled'] = false;
+
 // Twitter integration source attribute. Note: default is Laconica
 // $config['integration']['source'] = 'Laconica';
 
index 1c6170693f46deaed714764aa70596c462e44b2b..326edf3a00122a8fa7cad6bb3b3f49e8b4217775 100644 (file)
@@ -402,6 +402,14 @@ class Action extends HTMLOutputter // lawsuit
     function showPrimaryNav()
     {
         $user = common_current_user();
+        $connect = '';
+        if (common_config('xmpp', 'enabled')) {
+            $connect = 'imsettings';
+        } else if (common_config('sms', 'enabled')) {
+            $connect = 'smssettings';
+        } else if (common_config('twitter', 'enabled')) {
+            $connect = 'twittersettings';
+        }
 
         $this->elementStart('dl', array('id' => 'site_nav_global_primary'));
         $this->element('dt', null, _('Primary site navigation'));
@@ -413,12 +421,9 @@ class Action extends HTMLOutputter // lawsuit
                                 _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
                 $this->menuItem(common_local_url('profilesettings'),
                                 _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
-                if (common_config('xmpp', 'enabled')) {
-                    $this->menuItem(common_local_url('imsettings'),
-                                    _('Connect'), _('Connect to IM, SMS, Twitter'), false, 'nav_connect');
-                } else {
-                    $this->menuItem(common_local_url('smssettings'),
-                                    _('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
+                if ($connect) {
+                    $this->menuItem(common_local_url($connect),
+                                    _('Connect'), _('Connect to services'), false, 'nav_connect');
                 }
                 if (common_config('invite', 'enabled')) {
                     $this->menuItem(common_local_url('invite'),
index b3d3018620a15d889f02a6183e72192241a03725..be30519f47409bb7e7eefa6ae92e60379e9b7910 100644 (file)
@@ -183,6 +183,12 @@ $config =
         array('piddir' => '/var/run',
               'user' => false,
               'group' => false),
+        'emailpost' =>
+        array('enabled' => true),
+        'sms' =>
+        array('enabled' => true),
+        'twitter' =>
+        array('enabled' => true),
         'twitterbridge' =>
         array('enabled' => false),
         'integration' =>
index 30629680ecbb124cecba705c510a3e42b7c2501a..02c468a359b7f166ce012e85ef9db5d0b9f17959 100644 (file)
@@ -99,25 +99,27 @@ class ConnectSettingsNav extends Widget
     function show()
     {
         # action => array('prompt', 'title')
-        $menu =
-          array('imsettings' =>
-                array(_('IM'),
-                      _('Updates by instant messenger (IM)')),
-                'smssettings' =>
-                array(_('SMS'),
-                      _('Updates by SMS')),
-                'twittersettings' =>
-                array(_('Twitter'),
-                      _('Twitter integration options')));
+        $menu = array();
+        if (common_config('xmpp', 'enabled')) {
+            $menu['imsettings'] =
+              array(_('IM'),
+                    _('Updates by instant messenger (IM)'));
+        }
+        if (common_config('sms', 'enabled')) {
+            $menu['smssettings'] =
+              array(_('SMS'),
+                    _('Updates by SMS'));
+        }
+        if (common_config('twitter', 'enabled')) {
+            $menu['twittersettings'] =
+              array(_('Twitter'),
+                    _('Twitter integration options'));
+        }
 
         $action_name = $this->action->trimmed('action');
         $this->action->elementStart('ul', array('class' => 'nav'));
 
         foreach ($menu as $menuaction => $menudesc) {
-            if ($menuaction == 'imsettings' &&
-                !common_config('xmpp', 'enabled')) {
-                continue;
-            }
             $this->action->menuItem(common_local_url($menuaction),
                                    $menudesc[0],
                                    $menudesc[1],
index 1e4546dff1261704f3afc35fe864c473b1ce2ddb..8b127bd201be9516466c9541ef51b2ba8cb9428b 100755 (executable)
@@ -43,7 +43,11 @@ if(common_config('twitterbridge','enabled')) {
     echo "twitterstatusfetcher.php ";
 }
 echo "ombqueuehandler.php ";
-echo "twitterqueuehandler.php ";
+if (common_config('twitter', 'enabled')) {
+    echo "twitterqueuehandler.php ";
+}
 echo "facebookqueuehandler.php ";
 echo "pingqueuehandler.php ";
-echo "smsqueuehandler.php ";
+if (common_config('sms', 'enabled')) {
+    echo "smsqueuehandler.php ";
+}
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');
+}