aboutsummaryrefslogtreecommitdiff
path: root/mod/twitter_api
diff options
context:
space:
mode:
Diffstat (limited to 'mod/twitter_api')
-rw-r--r--mod/twitter_api/languages/en.php2
-rw-r--r--mod/twitter_api/views/default/plugins/twitter_api/usersettings.php8
2 files changed, 10 insertions, 0 deletions
diff --git a/mod/twitter_api/languages/en.php b/mod/twitter_api/languages/en.php
index 9d8554a9e..f4b3c7f94 100644
--- a/mod/twitter_api/languages/en.php
+++ b/mod/twitter_api/languages/en.php
@@ -21,6 +21,8 @@ $english = array(
'twitter_api:usersettings:authorized' => "You have authorized %s to access your Twitter account: @%s.",
'twitter_api:usersettings:revoke' => 'Click <a href="%s">here</a> to revoke access.',
+ 'twitter_api:usersettings:site_not_configured' => 'An administrator must first configure Twitter before it can be used.',
+
'twitter_api:revoke:success' => 'Twitter access has been revoked.',
'twitter_api:login' => 'Allow existing users who have connected their Twitter account to sign in with Twitter?',
diff --git a/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
index 65d04b883..edcea2f0d 100644
--- a/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
+++ b/mod/twitter_api/views/default/plugins/twitter_api/usersettings.php
@@ -9,6 +9,14 @@ $twitter_name = elgg_get_plugin_user_setting('twitter_name', $user_guid, 'twitte
$access_key = elgg_get_plugin_user_setting('access_key', $user_guid, 'twitter_api');
$access_secret = elgg_get_plugin_user_setting('access_secret', $user_guid, 'twitter_api');
+$site_key = elgg_get_plugin_setting('consumer_key', 'twitter_api');
+$site_secret = elgg_get_plugin_setting('consumer_secret', 'twitter_api');
+
+if (!($site_key && $site_secret)) {
+ echo '<div>' . elgg_echo('twitter_api:usersettings:site_not_configured') . '</div>';
+ return true;
+}
+
$site_name = elgg_get_site_entity()->name;
echo '<div>' . elgg_echo('twitter_api:usersettings:description', array($site_name)) . '</div>';