Commit 0125b04e10dd4651bcc61f1aeb813fe26bb7c53f
1 parent
50a13bc2
Adds Noosfero and Twitter auth classes
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
2 changed files
with
22 additions
and
0 deletions
Show diff stats
plugins/oauth_client/models/oauth_client_plugin/noosfero_oauth2_auth.rb
0 → 100644
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||
1 | +class OauthClientPlugin::NoosferoOauth2Auth < OauthClientPlugin::Auth | ||
2 | + | ||
3 | + def image_url(size = nil) | ||
4 | + size = IMAGE_SIZES[size] || IMAGE_SIZES[:icon] | ||
5 | + URI.join("http://#{self.external_person.source}/profile/#{self.external_person.identifier}/", size) | ||
6 | + end | ||
7 | + | ||
8 | + def profile_url | ||
9 | + "http://#{self.external_person.source}/profile/#{self.external_person.identifier}" | ||
10 | + end | ||
11 | + | ||
12 | + def settings_url | ||
13 | + "http://#{self.external_person.source}/myprofile/#{self.external_person.identifier}" | ||
14 | + end | ||
15 | +end |
plugins/oauth_client/models/oauth_client_plugin/twitter_auth.rb
0 → 100644