Index: trunk/extensions/TwitterLogin/TwitterLogin.i18n.php |
— | — | @@ -26,6 +26,7 @@ |
27 | 27 | 'signuptwitter' => 'You can register to this wiki using your twitter account', |
28 | 28 | 'tietoaccount' => 'You are currently logged into this wiki as $1.<br/>You may sign in with Twitter to tie your twitter account to your existing mediawiki account.', |
29 | 29 | 'twitterlogin-desc' => 'Register and log in to a mediawiki using your twitter account', |
| 30 | + 'alreadyloggedin' => 'You\'re already logged in.', |
30 | 31 | 'couldnotconnect' => 'Could not connect to Twitter. Refresh the page or try again later.' |
31 | 32 | ); |
32 | 33 | |
Index: trunk/extensions/TwitterLogin/SpecialTwitterLogin.php |
— | — | @@ -53,18 +53,19 @@ |
54 | 54 | |
55 | 55 | private function _default(){ |
56 | 56 | global $wgOut, $wgUser, $wgScriptPath, $wgExtensionAssetsPath; |
| 57 | + |
57 | 58 | $wgOut->setPagetitle("Twitter Login"); |
58 | 59 | |
59 | | - /* |
60 | | - if( $wgUser->isLoggedIn() ) |
61 | | - $wgOut->addWikiText( wfMsg( 'tietoaccount', $wgUser->getName() ) ); |
62 | | - else |
63 | | - */ |
64 | | - $wgOut->addWikiText( wfMsg( 'signuptwitter') ); |
| 60 | + if ( !$wgUser->isLoggedIn() ) { |
| 61 | + $wgOut->addWikiText( wfMsg( 'signuptwitter') ); |
65 | 62 | |
66 | | - $wgOut->addHTML( '<a href="' . $wgScriptPath . '/index.php/Special:TwitterLogin/redirect">' |
| 63 | + $wgOut->addHTML( '<a href="' . $wgScriptPath . '/index.php/Special:TwitterLogin/redirect">' |
67 | 64 | .'<img src="' . $wgExtensionAssetsPath . '/TwitterLogin/' . |
68 | 65 | 'images/sign-in-with-twitter-d.png"/></a>' ); |
| 66 | + } else { |
| 67 | + //$wgOut->addWikiText( wfMsg( 'tietoaccount', $wgUser->getName() ) ); |
| 68 | + $wgOut->addWikiText( wfMsg( 'alreadyloggedin' ) ); |
| 69 | + } |
69 | 70 | return true; |
70 | 71 | } |
71 | 72 | |
— | — | @@ -246,7 +247,7 @@ |
247 | 248 | } |
248 | 249 | } |
249 | 250 | |
250 | | - private function _doTwitterOAuth($at, $ats){ |
| 251 | + private function _doTwitterOAuth( $at, $ats ){ |
251 | 252 | /* Get user access tokens out of the session. */ |
252 | 253 | return new TwitterOAuth( |
253 | 254 | $this->_consumerKey, |