Skip to content

Commit

Permalink
add oauth reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
hanachin committed May 8, 2012
1 parent 683e575 commit 1617d2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions i18n/ja.yml
Expand Up @@ -13,4 +13,5 @@ ja:
status_success: 認証済み
status_fail: 未認証
oauth: 認証する
oauth_reset: 認証を解除する
post_message: 投稿メッセージ
7 changes: 7 additions & 0 deletions lib/lokka/tweet_feed.rb
Expand Up @@ -63,6 +63,13 @@ def self.registered(app)
redirect '/admin/plugins/tweet_feed'
end

app.get '/admin/plugins/tweet_feed/oauth_reset' do
Option.first(:name => 'tweet_feed_token').destroy
Option.first(:name => 'tweet_feed_secret').destroy

redirect '/admin/plugins/tweet_feed'
end

app.helpers do
def tweet_feed_url
"#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}"
Expand Down
2 changes: 2 additions & 0 deletions views/index.haml
Expand Up @@ -43,6 +43,8 @@
%h3=t('tweet_feed.status')
-if Option.tweet_feed_token && Option.tweet_feed_secret
%p=t('tweet_feed.status_success')
%form{:action => '/admin/plugins/tweet_feed/oauth_reset', :method => 'get'}
%input{:type => 'submit', :value => t('tweet_feed.oauth_reset')}
-else
%p=t('tweet_feed.status_fail')
%br
Expand Down

0 comments on commit 1617d2f

Please sign in to comment.