aboutsummaryrefslogtreecommitdiff
path: root/mod/twitter_api/views/default/usersettings
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-08-23 20:12:58 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-08-23 20:12:58 -0700
commit9f13557c2e7422cb15ce109adbe5714d6d78fc9e (patch)
treef2c3966a0bbaae5462475089945e531d0f9138c9 /mod/twitter_api/views/default/usersettings
parent469f8ba89cc3b613b88228d95f9c69cb53e5b605 (diff)
downloadelgg-9f13557c2e7422cb15ce109adbe5714d6d78fc9e.tar.gz
elgg-9f13557c2e7422cb15ce109adbe5714d6d78fc9e.tar.bz2
Fixes #3117. Added an interstitial page for twitter new users.
Diffstat (limited to 'mod/twitter_api/views/default/usersettings')
-rw-r--r--mod/twitter_api/views/default/usersettings/twitter_api/edit.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/mod/twitter_api/views/default/usersettings/twitter_api/edit.php b/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
index 0898087ca..acb8d9af5 100644
--- a/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
+++ b/mod/twitter_api/views/default/usersettings/twitter_api/edit.php
@@ -3,10 +3,11 @@
* User settings for Twitter API
*/
-$user_id = elgg_get_logged_in_user_guid();
-$twitter_name = get_plugin_usersetting('twitter_name', $user_id, 'twitter_api');
-$access_key = get_plugin_usersetting('access_key', $user_id, 'twitter_api');
-$access_secret = get_plugin_usersetting('access_secret', $user_id, 'twitter_api');
+$user = elgg_get_logged_in_user_entity();
+$user_guid = $user->getGUID();
+$twitter_name = get_plugin_usersetting('twitter_name', $user_guid, 'twitter_api');
+$access_key = get_plugin_usersetting('access_key', $user_guid, 'twitter_api');
+$access_secret = get_plugin_usersetting('access_secret', $user_guid, 'twitter_api');
$site_name = elgg_get_site_entity()->name;
echo '<div>' . elgg_echo('twitter_api:usersettings:description', array($site_name)) . '</div>';
@@ -16,7 +17,13 @@ if (!$access_key || !$access_secret) {
$request_link = twitter_api_get_authorize_url(null, false);
echo '<div>' . elgg_echo('twitter_api:usersettings:request', array($request_link, $site_name)) . '</div>';
} else {
- $url = elgg_get_site_url() . "twitter_api/revoke";
- echo '<div class="twitter_anywhere">' . elgg_echo('twitter_api:usersettings:authorized', array($site_name, $twitter_name)) . '</div>';
- echo '<div>' . sprintf(elgg_echo('twitter_api:usersettings:revoke'), $url) . '</div>';
+ // if this user logged in through twitter and never set up an email address, don't
+ // let them disassociate their account.
+ if ($user->email) {
+ $url = elgg_get_site_url() . "twitter_api/revoke";
+ echo '<div class="twitter_anywhere">' . elgg_echo('twitter_api:usersettings:authorized', array($site_name, $twitter_name)) . '</div>';
+ echo '<div>' . sprintf(elgg_echo('twitter_api:usersettings:revoke'), $url) . '</div>';
+ } else {
+ echo elgg_echo('twitter_api:usersettings:cannot_revoke', array(elgg_normalize_url('twitter_api/interstitial')));
+ }
}