Commit 0125b04e10dd4651bcc61f1aeb813fe26bb7c53f

Authored by Gabriel Silva
1 parent 50a13bc2

Adds Noosfero and Twitter auth classes

Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
plugins/oauth_client/models/oauth_client_plugin/noosfero_oauth2_auth.rb 0 → 100644
... ... @@ -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
... ... @@ -0,0 +1,7 @@
  1 +class OauthClientPlugin::TwitterAuth < OauthClientPlugin::Auth
  2 +
  3 + def image_url(size = nil)
  4 + size = IMAGE_SIZES[size] || IMAGE_SIZES[:icon]
  5 + self.external_person_image_url
  6 + end
  7 +end
... ...