Merge branch 'master' of git://github.com/diaspora/diaspora
This commit is contained in:
commit
8d444c0327
4 changed files with 21 additions and 13 deletions
|
|
@ -16,7 +16,7 @@ class User < ActiveRecord::Base
|
||||||
:timeoutable, :token_authenticatable
|
:timeoutable, :token_authenticatable
|
||||||
|
|
||||||
before_validation :strip_and_downcase_username
|
before_validation :strip_and_downcase_username
|
||||||
before_validation :set_current_language, :post => :create
|
before_validation :set_current_language, :on => :create
|
||||||
|
|
||||||
validates_presence_of :username
|
validates_presence_of :username
|
||||||
validates_uniqueness_of :username
|
validates_uniqueness_of :username
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,10 @@
|
||||||
= link_to t('services.index.disconnect'), service_path(service), :confirm => t('services.index.really_disconnect', :service => service.provider), :method => :delete
|
= link_to t('services.index.disconnect'), service_path(service), :confirm => t('services.index.really_disconnect', :service => service.provider), :method => :delete
|
||||||
|
|
||||||
- unless @services.any?{|x| x.provider == 'twitter'}
|
- unless @services.any?{|x| x.provider == 'twitter'}
|
||||||
%h4= link_to t('services.index.connect_to_twitter'), "/auth/twitter" if SERVICES['twitter']['consumer_key']!= ""
|
%h4= link_to t('services.index.connect_to_twitter'), "/auth/twitter" if SERVICES['twitter'] && SERVICES['twitter']['consumer_key']!= ""
|
||||||
|
|
||||||
- unless @services.any?{|x| x.provider == 'facebook'}
|
- unless @services.any?{|x| x.provider == 'facebook'}
|
||||||
%h4= link_to t('services.index.connect_to_facebook'), "/auth/facebook" if SERVICES['facebook']['app_id'] !=""
|
%h4= link_to t('services.index.connect_to_facebook'), "/auth/facebook" if SERVICES['facebook'] && SERVICES['facebook']['app_id'] !=""
|
||||||
|
|
||||||
- unless @services.any?{|x| x.provider == 'tumblr'}
|
- unless @services.any?{|x| x.provider == 'tumblr'}
|
||||||
%h4= link_to t('services.index.connect_to_tumblr'), "/auth/tumblr" if SERVICES['tumblr']['consumer_key'] !=""
|
%h4= link_to t('services.index.connect_to_tumblr'), "/auth/tumblr" if SERVICES['tumblr'] && SERVICES['tumblr']['consumer_key'] !=""
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
# Copyright (c) 2010, Diaspora Inc. This file is
|
# Copyright (c) 2011, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
Rails.application.config.middleware.use OmniAuth::Builder do
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret']
|
if SERVICES['twitter'] && SERVICES['twitter']['consumer_key'] && SERVICES['twitter']['consumer_secret']
|
||||||
provider :tumblr, SERVICES['tumblr']['consumer_key'], SERVICES['tumblr']['consumer_secret']
|
provider :twitter, SERVICES['twitter']['consumer_key'], SERVICES['twitter']['consumer_secret']
|
||||||
provider :facebook, SERVICES['facebook']['app_id'], SERVICES['facebook']['app_secret'], :scope => "publish_stream,email,offline_access"
|
end
|
||||||
end
|
if SERVICES['tumblr'] && SERVICES['tumblr']['consumer_key'] && SERVICES['tumblr']['consumer_secret']
|
||||||
|
provider :tumblr, SERVICES['tumblr']['consumer_key'], SERVICES['tumblr']['consumer_secret']
|
||||||
|
end
|
||||||
|
if SERVICES['facebook'] && SERVICES['facebook']['app_id'] && SERVICES['facebook']['app_secret']
|
||||||
|
provider :facebook, SERVICES['facebook']['app_id'], SERVICES['facebook']['app_secret'], :scope => "publish_stream,email,offline_access"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (c) 2010, Diaspora Inc. This file is
|
# Copyright (c) 2011, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
|
|
@ -87,12 +87,15 @@ Diaspora::Application.routes.draw do
|
||||||
resources :aspect_memberships, :only => [:destroy, :create, :update]
|
resources :aspect_memberships, :only => [:destroy, :create, :update]
|
||||||
resources :post_visibilities, :only => [:update]
|
resources :post_visibilities, :only => [:update]
|
||||||
|
|
||||||
get 'people/tag_index' => 'people#tag_index'
|
|
||||||
resources :people, :except => [:edit, :update] do
|
resources :people, :except => [:edit, :update] do
|
||||||
resources :status_messages
|
resources :status_messages
|
||||||
resources :photos
|
resources :photos
|
||||||
get :contacts
|
get :contacts
|
||||||
post 'by_handle' => :retrieve_remote, :on => :collection, :as => 'person_by_handle'
|
collection do
|
||||||
|
post 'by_handle' => :retrieve_remote, :as => 'person_by_handle'
|
||||||
|
get :tag_index
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue