diff --git a/plugins/oauth_client/models/oauth_client_plugin/noosfero_oauth2_auth.rb b/plugins/oauth_client/models/oauth_client_plugin/noosfero_oauth2_auth.rb new file mode 100644 index 0000000..cb468b8 --- /dev/null +++ b/plugins/oauth_client/models/oauth_client_plugin/noosfero_oauth2_auth.rb @@ -0,0 +1,15 @@ +class OauthClientPlugin::NoosferoOauth2Auth < OauthClientPlugin::Auth + + def image_url(size = nil) + size = IMAGE_SIZES[size] || IMAGE_SIZES[:icon] + URI.join("http://#{self.external_person.source}/profile/#{self.external_person.identifier}/", size) + end + + def profile_url + "http://#{self.external_person.source}/profile/#{self.external_person.identifier}" + end + + def settings_url + "http://#{self.external_person.source}/myprofile/#{self.external_person.identifier}" + end +end diff --git a/plugins/oauth_client/models/oauth_client_plugin/twitter_auth.rb b/plugins/oauth_client/models/oauth_client_plugin/twitter_auth.rb new file mode 100644 index 0000000..ec3d47c --- /dev/null +++ b/plugins/oauth_client/models/oauth_client_plugin/twitter_auth.rb @@ -0,0 +1,7 @@ +class OauthClientPlugin::TwitterAuth < OauthClientPlugin::Auth + + def image_url(size = nil) + size = IMAGE_SIZES[size] || IMAGE_SIZES[:icon] + self.external_person_image_url + end +end -- libgit2 0.21.2