]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twittersettings.php
Fixed bug in which you cannot turn off importing friends timelines flag
[quix0rs-gnu-social.git] / actions / twittersettings.php
index 7fffa0af018b8b5909d26fa51651f6701afc3382..89169941eb4424cbdc7a960e8f0d4df982e81421 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Settings for Twitter integration
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Settings
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -38,10 +38,10 @@ require_once INSTALLDIR.'/lib/twitter.php';
  * Settings for Twitter integration
  *
  * @category Settings
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  *
  * @see      SettingsAction
  */
@@ -75,13 +75,19 @@ class TwittersettingsAction extends ConnectSettingsAction
      * Content area of the page
      *
      * Shows a form for associating a Twitter account with this
-     * Laconica account. Also lets the user set preferences.
+     * StatusNet account. Also lets the user set preferences.
      *
      * @return void
      */
 
     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();
@@ -159,7 +165,7 @@ class TwittersettingsAction extends ConnectSettingsAction
                                 ($flink->noticesync & FOREIGN_NOTICE_RECV) :
                                 false);
                 $this->elementEnd('li');
-
+            } else {
                 // preserve setting even if bidrection bridge toggled off
 
                 if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) {