aboutsummaryrefslogtreecommitdiff
path: root/mod/twitterservice/views/default/usersettings/twitterservice/edit.php
blob: 95a2a2fd61e396d09b64aa0482fcf0582474a404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * 
 */

$user_id = get_loggedin_userid();
$twitter_name = get_plugin_usersetting('twitter_name', $user_id, 'twitterservice');
$access_key = get_plugin_usersetting('access_key', $user_id, 'twitterservice');
$access_secret = get_plugin_usersetting('access_secret', $user_id, 'twitterservice');

echo '<p>' . elgg_echo('twitterservice:usersettings:description') . '</p>';

if (!$access_key || !$access_secret) {
	// send user off to validate account
	$request_link = twitterservice_get_authorize_url();
	echo '<p>' . sprintf(elgg_echo('twitterservice:usersettings:request'), $request_link) . '</p>';
} else {
	$url = "{$CONFIG->site->url}pg/twitterservice/revoke";
	echo '<p class="twitter_anywhere">' . sprintf(elgg_echo('twitterservice:usersettings:authorized'), $twitter_name) . '</p>';
	echo '<p>' . sprintf(elgg_echo('twitterservice:usersettings:revoke'), $url) . '</p>';
}