diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-10-13 18:27:05 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-10-13 18:27:05 -0700 |
commit | c095d1fddeced2415b6d780b4140457a5cda41d0 (patch) | |
tree | b906f8d60e1359a75da673178bf8292c2af77aa9 /mod/twitter_api | |
parent | ef119763b51119a10851a7a3fb1258c7116a96c0 (diff) | |
download | elgg-c095d1fddeced2415b6d780b4140457a5cda41d0.tar.gz elgg-c095d1fddeced2415b6d780b4140457a5cda41d0.tar.bz2 |
Fixes #3177. Don't show the authorize twitter plugin setting if the admin hasn't set up the plugin.
Diffstat (limited to 'mod/twitter_api')
-rw-r--r-- | mod/twitter_api/languages/en.php | 2 | ||||
-rw-r--r-- | mod/twitter_api/views/default/plugins/twitter_api/usersettings.php | 8 |
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>'; |