summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitteroauthclient.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-02 16:49:29 -0800
committerZach Copley <zach@status.net>2010-03-02 16:49:29 -0800
commitca21f1da8603be348c1a34a8bcc3e7610b9a395d (patch)
tree229d0837009b03a8afef6eb4934f0f03d39502ad /plugins/TwitterBridge/twitteroauthclient.php
parent09705a1e989d202859d637f8a84383f365b7906a (diff)
- Have Twitter bridge check for a global key and secret if it can't
find one in the local config - Refuse to work at all if the consumer key and secret aren't set
Diffstat (limited to 'plugins/TwitterBridge/twitteroauthclient.php')
-rw-r--r--plugins/TwitterBridge/twitteroauthclient.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php
index ba45b533d..93f6aadd1 100644
--- a/plugins/TwitterBridge/twitteroauthclient.php
+++ b/plugins/TwitterBridge/twitteroauthclient.php
@@ -22,7 +22,7 @@
* @category Integration
* @package StatusNet
* @author Zach Copley <zach@status.net>
- * @copyright 2009 StatusNet, Inc.
+ * @copyright 2009-2010 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@@ -61,8 +61,23 @@ class TwitterOAuthClient extends OAuthClient
$consumer_key = common_config('twitter', 'consumer_key');
$consumer_secret = common_config('twitter', 'consumer_secret');
- parent::__construct($consumer_key, $consumer_secret,
- $oauth_token, $oauth_token_secret);
+ if (empty($consumer_key) && empty($consumer_secret)) {
+ $consumer_key = common_config(
+ 'twitter',
+ 'global_consumer_key'
+ );
+ $consumer_secret = common_config(
+ 'twitter',
+ 'global_consumer_secret'
+ );
+ }
+
+ parent::__construct(
+ $consumer_key,
+ $consumer_secret,
+ $oauth_token,
+ $oauth_token_secret
+ );
}
// XXX: the following two functions are to support the horrible hack