phoenix_auth 0.2.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/app/assets/stylesheets/user.css +0 -0
- data/app/controllers/phoenix/base_controller_decorator.rb +8 -0
- data/app/controllers/phoenix/confirmations_controller.rb +16 -0
- data/app/controllers/phoenix/passwords_controller.rb +16 -0
- data/app/controllers/phoenix/profiles_controller.rb +17 -0
- data/app/controllers/phoenix/registrations_controller.rb +52 -0
- data/app/controllers/phoenix/sessions_controller.rb +35 -0
- data/app/controllers/phoenix/users_controller.rb +32 -0
- data/app/helpers/phoenix/users_helper.rb +4 -0
- data/app/mailers/phoenix/user_mailer.rb +30 -0
- data/app/models/phoenix/profile.rb +10 -0
- data/app/models/phoenix/user.rb +69 -0
- data/app/models/phoenix/user_observer.rb +7 -0
- data/app/views/phoenix/confirmations/new.html.haml +16 -0
- data/app/views/phoenix/layouts/login.html.erb +24 -0
- data/app/views/phoenix/layouts/login.html.haml +19 -0
- data/app/views/phoenix/layouts/mailer.html.haml +7 -0
- data/app/views/phoenix/passwords/edit.html.haml +21 -0
- data/app/views/phoenix/passwords/new.html.haml +13 -0
- data/app/views/phoenix/profiles/index.html.haml +2 -0
- data/app/views/phoenix/registrations/edit.html.haml +5 -0
- data/app/views/phoenix/registrations/new.html.erb +12 -0
- data/app/views/phoenix/registrations/new.html.haml +14 -0
- data/app/views/phoenix/sessions/authorization_failure.html.haml +23 -0
- data/app/views/phoenix/sessions/new.html.erb +41 -0
- data/app/views/phoenix/sessions/new.html.haml +27 -0
- data/app/views/phoenix/user_mailer/confirmation_instructions.html.haml +8 -0
- data/app/views/phoenix/user_mailer/reset_password_instructions.html.haml +16 -0
- data/app/views/phoenix/user_mailer/welcome_instructions.html.haml +2 -0
- data/app/views/phoenix/users/edit.html.haml +1 -0
- data/app/views/phoenix/users/index.html.haml +12 -0
- data/app/views/phoenix/users/profile.html.erb +8 -0
- data/app/views/phoenix/users/profile.html.haml +7 -0
- data/app/views/phoenix/users/show.html.haml +12 -0
- data/config/initializers/custom_devise_failure.rb +8 -0
- data/config/initializers/devise.rb +136 -0
- data/config/locales/devise/en.yml +51 -0
- data/config/locales/devise/zh-CN.yml +120 -0
- data/config/locales/devise/zh-TW.yml +119 -0
- data/config/routes.rb +21 -0
- data/lib/phoenix/auth.rb +10 -0
- data/lib/phoenix/auth/engine.rb +33 -0
- data/lib/phoenix/token_resource.rb +17 -0
- data/lib/phoenix_auth.rb +1 -0
- data/lib/tasks/phoenix_auth_tasks.rake +4 -0
- metadata +113 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
# Copyright (c) 2011, Phoenix Project.
|
2
|
+
# Devise i18n Chinese Traditional.
|
3
|
+
|
4
|
+
zh-TW:
|
5
|
+
devise:
|
6
|
+
confirmations:
|
7
|
+
confirmed: "帳號已確認成功. 你已經登入了."
|
8
|
+
new:
|
9
|
+
resend_confirmation: "重送確認步驟"
|
10
|
+
send_instructions: 幾分鐘內你會收到一封說明如何確認帳號的信件.
|
11
|
+
failure:
|
12
|
+
inactive: 你的帳號尚未開通.
|
13
|
+
invalid: 用戶名稱或密碼有誤.
|
14
|
+
invalid_token: 認證信物無效.
|
15
|
+
locked: 你的帳號已鎖定.
|
16
|
+
timeout: "工作階段已逾時, 若要繼續請重新登入."
|
17
|
+
unauthenticated: 繼續之前你必須先登入或登記.
|
18
|
+
unconfirmed: 你必須先確認帳號才能繼續.
|
19
|
+
invitations:
|
20
|
+
invitation_token_invalid: "很抱歉! 此邀請信物無效."
|
21
|
+
send_instructions: 邀請函已寄出.
|
22
|
+
updated: "密碼已設定成功. 你已經登入了."
|
23
|
+
mailer:
|
24
|
+
confirmation_instructions:
|
25
|
+
confirm: "帳號確認"
|
26
|
+
subject: "確認步驟"
|
27
|
+
you_can_confirm: "你可以使用以下連結確認帳號:"
|
28
|
+
hello: "你好, %{email}!"
|
29
|
+
invitation_instructions:
|
30
|
+
accept: "接受邀請"
|
31
|
+
arrived: "你一直在等待的社交網路來了. 精心修整, 更安全, 也更好玩, %{strong_diaspora} 已經準備好要幫助你, 用一種嶄新的方式來分享與探索網路世界."
|
32
|
+
be_yourself: "做自己"
|
33
|
+
be_yourself_paragraph: "網際網路為我們創造了表達我們自己的嶄新方式. %{strong_diaspora} 讓你做你自己, 分享你想分享的, 不管你用真名假名."
|
34
|
+
cubbies: Cubbi.es
|
35
|
+
displaying_correctly: "電子郵件無法正確顯示嗎? %{link}"
|
36
|
+
email_address: questions@joindiaspora.com
|
37
|
+
email_us: "對 Diaspora 帳號需要諮詢服務或協助, 請寄信到 %{email} 給我們."
|
38
|
+
finally: "終於 - 來了"
|
39
|
+
friends_saying: 你的朋友怎麼說...
|
40
|
+
get_connected: "來聯繫"
|
41
|
+
get_connected_paragraph: "這個社群, 是一個對更好的網路環境有共同願景的國際性運動, 是 %{strong_diaspora} 的最大特色. 來和新面孔相遇, 和朋友保持聯繫, 和大家一起玩吧."
|
42
|
+
have_fun: "盡情玩"
|
43
|
+
have_fun_paragraph: "%{strong_diaspora} 就是用來探索線上令人驚奇的新事物與人物. %{link}, 這個世界上第一個 %{strong_diaspora} 應用程式, 只是個開始. 在榮耀的網路上收集並分享它的一切吧."
|
44
|
+
help_fund: "贊助 Diaspora"
|
45
|
+
here: "這裡"
|
46
|
+
ignore: "如果你不想接受邀請,請不用管這封信."
|
47
|
+
join_team: "加入我們的團隊"
|
48
|
+
love: "愛你的,"
|
49
|
+
made_by_people: "%{strong_diaspora} 是由和你一樣熱愛網際網路的人所創作的. %{jointeam}, 或是%{helpfund}吧!"
|
50
|
+
more_people: 有更多人很想要見到你!
|
51
|
+
no_account_till: "在你按了以上連結並註冊後,你的帳號才會成功開戶."
|
52
|
+
or: "或是"
|
53
|
+
sign_up_now: "現在就來註冊 →"
|
54
|
+
subject: "有人邀請你加入 Diaspora!"
|
55
|
+
team_diaspora: "Diaspora 團隊"
|
56
|
+
unsubscribe: "要取消訂閱請按%{link}."
|
57
|
+
view_in: 用瀏覽器檢視看看.
|
58
|
+
inviter:
|
59
|
+
accept_at: "於 %{url}, 你可以透過以下連結來接受."
|
60
|
+
has_invited_you: "%{name}"
|
61
|
+
have_invited_you: "%{names} 邀請你加入 Diaspora"
|
62
|
+
reset_password_instructions:
|
63
|
+
change: "更改密碼"
|
64
|
+
ignore: "如果你沒請求過, 請忽略這封信件."
|
65
|
+
someone_requested: "有人要求更改你的密碼, 若確定要這麼做, 請使用以下連結."
|
66
|
+
subject: "密碼重設步驟"
|
67
|
+
wont_change: "在使用以上連結設定新的密碼後, 你的密碼才會改變."
|
68
|
+
unlock_instructions:
|
69
|
+
account_locked: 你的帳號因為登入失敗太多次而被鎖定了.
|
70
|
+
click_to_unlock: "點一下以下連結以將你的帳號解鎖:"
|
71
|
+
subject: "解鎖步驟"
|
72
|
+
unlock: "帳號解鎖"
|
73
|
+
welcome: "歡迎你, %{email}!"
|
74
|
+
passwords:
|
75
|
+
edit:
|
76
|
+
change_password: "更改密碼"
|
77
|
+
new:
|
78
|
+
forgot_password: 忘記密碼?
|
79
|
+
no_account: "無此電子信箱關聯的帳號. 如果你是在等邀請函, 我們會盡快寄出."
|
80
|
+
send_password_instructions: "傳送密碼重設的步驟給我"
|
81
|
+
send_instructions: 幾分鐘內你會收到一封說明如何重設密碼的信件.
|
82
|
+
updated: "密碼更改成功. 你已經登入了."
|
83
|
+
registrations:
|
84
|
+
destroyed: "再會! 你的帳號已經取消了. 希望不久後再見."
|
85
|
+
signed_up: "你已經成功登記了. 如果有設定的話, 確認信會送到你的信箱."
|
86
|
+
updated: 帳號更新成功.
|
87
|
+
sessions:
|
88
|
+
new:
|
89
|
+
alpha_software: 你將要使用剛開發的軟體.
|
90
|
+
bugs_and_feedback: "給你個忠告, 你將會遭遇到臭蟲. 遇到任何不順, 都請你使用瀏覽器右手邊的\"回饋\"按鈕向我們回報! 我們會盡快處理你回報的任何問題."
|
91
|
+
bugs_and_feedback_mobile: "給你個忠告, 你將會遭遇到臭蟲. 遇到任何不順都請你向我們回報! 我們會盡快處理你回報的任何問題."
|
92
|
+
login: "登入"
|
93
|
+
modern_browsers: 只支援摩登的瀏覽器.
|
94
|
+
password: "密碼"
|
95
|
+
remember_me: "記住我"
|
96
|
+
sign_in: "登入"
|
97
|
+
username: "用戶名稱"
|
98
|
+
signed_in: 登入成功.
|
99
|
+
signed_out: 登出成功.
|
100
|
+
shared:
|
101
|
+
links:
|
102
|
+
forgot_your_password: 忘記密碼?
|
103
|
+
receive_confirmation: 沒收到確認步驟?
|
104
|
+
receive_unlock: 沒收到解鎖步驟?
|
105
|
+
sign_in: "登入"
|
106
|
+
sign_up: "登記"
|
107
|
+
sign_up_closed: 目前不開放公開登記.
|
108
|
+
mail_signup_form:
|
109
|
+
sign_up_for_an_invite: 邀請函登記!
|
110
|
+
unlocks:
|
111
|
+
new:
|
112
|
+
resend_unlock: "重送解鎖步驟"
|
113
|
+
send_instructions: 幾分鐘後你將收到一封說明如何將你的帳號解鎖的信件.
|
114
|
+
unlocked: "帳號解鎖成功. 你已經登入了."
|
115
|
+
errors:
|
116
|
+
messages:
|
117
|
+
already_confirmed: "已確認"
|
118
|
+
not_found: "沒找到"
|
119
|
+
not_locked: "沒鎖定"
|
data/config/routes.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Phoenix::Core::Engine.routes.draw do
|
2
|
+
devise_for :users,
|
3
|
+
:class_name => 'Phoenix::User',
|
4
|
+
:controllers => { :registrations => "phoenix/registrations",
|
5
|
+
:confirmations => "phoenix/confirmations",
|
6
|
+
:passwords => "phoenix/passwords",
|
7
|
+
:sessions => 'phoenix/sessions'}
|
8
|
+
|
9
|
+
devise_scope :user do
|
10
|
+
get '/signup' => 'registrations#new', :as => :signup
|
11
|
+
get '/login' => 'sessions#new', :as => :login
|
12
|
+
get "/logout" => "sessions#destroy", :as => :logout
|
13
|
+
#get "forgot_password" => "passwords#new", :as => :forgotpassword
|
14
|
+
#get "confirmation" => "confirmations#new", :as => :confirmation
|
15
|
+
end
|
16
|
+
|
17
|
+
#resources :users, :only => [:index, :show, :edit, :update] do
|
18
|
+
resources :users do
|
19
|
+
resources :profile, :controller => 'profiles'
|
20
|
+
end
|
21
|
+
end
|
data/lib/phoenix/auth.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'mongoid'
|
2
|
+
|
3
|
+
module Phoenix
|
4
|
+
module Auth
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
isolate_namespace Phoenix
|
7
|
+
engine_name 'phoenix_auth'
|
8
|
+
|
9
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
10
|
+
# Load the locals under sub-folder
|
11
|
+
config.i18n.load_path += Dir[File.join(config.root, 'config', 'locales', '**', '*.{rb,yml}').to_s]
|
12
|
+
|
13
|
+
# Register Mongoid observers
|
14
|
+
config.mongoid.observers = :'phoenix/user_observer'
|
15
|
+
|
16
|
+
def self.activate
|
17
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../../app/**/*_decorator*.rb")) do |c|
|
18
|
+
Rails.application.config.cache_classes ? require(c) : load(c)
|
19
|
+
end
|
20
|
+
|
21
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../../../app/overrides/*.rb")) do |c|
|
22
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
config.to_prepare &method(:activate).to_proc
|
27
|
+
|
28
|
+
initializer "phoenix.auth.environment", :after => 'phoenix.environment' do |app|
|
29
|
+
#Phoenix::Auth::Config = Phoenix::AuthConfiguration.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/phoenix_auth.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "phoenix/auth/engine"
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: phoenix_auth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0.beta
|
5
|
+
prerelease: 6
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Lanvige Jiang
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: phoenix_core
|
16
|
+
requirement: &70263879288940 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - =
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.2.0.beta
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70263879288940
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: devise
|
27
|
+
requirement: &70263879288460 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70263879288460
|
36
|
+
description: Required dependency for Phoenix
|
37
|
+
email: lanvige@gmail.com
|
38
|
+
executables: []
|
39
|
+
extensions: []
|
40
|
+
extra_rdoc_files: []
|
41
|
+
files:
|
42
|
+
- app/assets/stylesheets/user.css
|
43
|
+
- app/controllers/phoenix/base_controller_decorator.rb
|
44
|
+
- app/controllers/phoenix/confirmations_controller.rb
|
45
|
+
- app/controllers/phoenix/passwords_controller.rb
|
46
|
+
- app/controllers/phoenix/profiles_controller.rb
|
47
|
+
- app/controllers/phoenix/registrations_controller.rb
|
48
|
+
- app/controllers/phoenix/sessions_controller.rb
|
49
|
+
- app/controllers/phoenix/users_controller.rb
|
50
|
+
- app/helpers/phoenix/users_helper.rb
|
51
|
+
- app/mailers/phoenix/user_mailer.rb
|
52
|
+
- app/models/phoenix/profile.rb
|
53
|
+
- app/models/phoenix/user.rb
|
54
|
+
- app/models/phoenix/user_observer.rb
|
55
|
+
- app/views/phoenix/confirmations/new.html.haml
|
56
|
+
- app/views/phoenix/layouts/login.html.erb
|
57
|
+
- app/views/phoenix/layouts/login.html.haml
|
58
|
+
- app/views/phoenix/layouts/mailer.html.haml
|
59
|
+
- app/views/phoenix/passwords/edit.html.haml
|
60
|
+
- app/views/phoenix/passwords/new.html.haml
|
61
|
+
- app/views/phoenix/profiles/index.html.haml
|
62
|
+
- app/views/phoenix/registrations/edit.html.haml
|
63
|
+
- app/views/phoenix/registrations/new.html.erb
|
64
|
+
- app/views/phoenix/registrations/new.html.haml
|
65
|
+
- app/views/phoenix/sessions/authorization_failure.html.haml
|
66
|
+
- app/views/phoenix/sessions/new.html.erb
|
67
|
+
- app/views/phoenix/sessions/new.html.haml
|
68
|
+
- app/views/phoenix/user_mailer/confirmation_instructions.html.haml
|
69
|
+
- app/views/phoenix/user_mailer/reset_password_instructions.html.haml
|
70
|
+
- app/views/phoenix/user_mailer/welcome_instructions.html.haml
|
71
|
+
- app/views/phoenix/users/edit.html.haml
|
72
|
+
- app/views/phoenix/users/index.html.haml
|
73
|
+
- app/views/phoenix/users/profile.html.erb
|
74
|
+
- app/views/phoenix/users/profile.html.haml
|
75
|
+
- app/views/phoenix/users/show.html.haml
|
76
|
+
- config/initializers/custom_devise_failure.rb
|
77
|
+
- config/initializers/devise.rb
|
78
|
+
- config/locales/devise/en.yml
|
79
|
+
- config/locales/devise/zh-CN.yml
|
80
|
+
- config/locales/devise/zh-TW.yml
|
81
|
+
- config/routes.rb
|
82
|
+
- lib/phoenix/auth/engine.rb
|
83
|
+
- lib/phoenix/auth.rb
|
84
|
+
- lib/phoenix/token_resource.rb
|
85
|
+
- lib/phoenix_auth.rb
|
86
|
+
- lib/tasks/phoenix_auth_tasks.rake
|
87
|
+
- README.md
|
88
|
+
homepage: http://lanvige.com
|
89
|
+
licenses: []
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 1.9.2
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ! '>'
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.3.1
|
106
|
+
requirements:
|
107
|
+
- none
|
108
|
+
rubyforge_project: phoenix_auth
|
109
|
+
rubygems_version: 1.8.13
|
110
|
+
signing_key:
|
111
|
+
specification_version: 3
|
112
|
+
summary: The Authentication Module for Phoenix Engine.
|
113
|
+
test_files: []
|