muck-users 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +27 -0
- data/Rakefile +96 -0
- data/VERSION +1 -0
- data/app/controllers/admin/muck/roles_controller.rb +57 -0
- data/app/controllers/admin/muck/users_controller.rb +122 -0
- data/app/controllers/muck/activations_controller.rb +31 -0
- data/app/controllers/muck/password_resets_controller.rb +81 -0
- data/app/controllers/muck/user_sessions_controller.rb +40 -0
- data/app/controllers/muck/username_request_controller.rb +43 -0
- data/app/controllers/muck/users_controller.rb +211 -0
- data/app/models/muck_user_mailer.rb +53 -0
- data/app/models/permission.rb +17 -0
- data/app/models/role.rb +25 -0
- data/app/views/admin/roles/_role.html.erb +9 -0
- data/app/views/admin/roles/edit.html.erb +17 -0
- data/app/views/admin/roles/index.html.erb +8 -0
- data/app/views/admin/roles/new.html.erb +16 -0
- data/app/views/admin/roles/show.html.erb +7 -0
- data/app/views/admin/users/_activate.html.erb +5 -0
- data/app/views/admin/users/_ajax_search_box.html.erb +6 -0
- data/app/views/admin/users/_row.html.erb +6 -0
- data/app/views/admin/users/_search_box.html.erb +6 -0
- data/app/views/admin/users/_table.html.erb +21 -0
- data/app/views/admin/users/_user_navigation.html.erb +11 -0
- data/app/views/admin/users/do_search.html.erb +5 -0
- data/app/views/admin/users/inactive.html.erb +8 -0
- data/app/views/admin/users/inactive_emails.html.erb +6 -0
- data/app/views/admin/users/index.html.erb +12 -0
- data/app/views/admin/users/search.html.erb +5 -0
- data/app/views/muck_user_mailer/activation_confirmation.html.erb +7 -0
- data/app/views/muck_user_mailer/activation_instructions.html.erb +7 -0
- data/app/views/muck_user_mailer/password_not_active_instructions.html.erb +10 -0
- data/app/views/muck_user_mailer/password_reset_instructions.html.erb +10 -0
- data/app/views/muck_user_mailer/username_request.html.erb +3 -0
- data/app/views/muck_user_mailer/welcome_notification.html.erb +5 -0
- data/app/views/password_resets/edit.html.erb +9 -0
- data/app/views/password_resets/new.html.erb +11 -0
- data/app/views/user_sessions/new.html.erb +17 -0
- data/app/views/username_request/new.html.erb +11 -0
- data/app/views/users/_user.html.erb +15 -0
- data/app/views/users/activation_confirmation.html.erb +1 -0
- data/app/views/users/activation_instructions.html.erb +1 -0
- data/app/views/users/edit.html.erb +45 -0
- data/app/views/users/new.html.erb +51 -0
- data/app/views/users/show.html.erb +4 -0
- data/app/views/users/welcome.html.erb +4 -0
- data/config/muck_users_routes.rb +56 -0
- data/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +16 -0
- data/db/migrate/20090512013727_add_photo_to_user.rb +13 -0
- data/install.rb +1 -0
- data/lib/action_controller/authentic_application.rb +213 -0
- data/lib/active_record/acts/muck_user.rb +192 -0
- data/lib/muck-users/exceptions.rb +5 -0
- data/lib/muck-users/initialize_routes.rb +8 -0
- data/lib/muck-users/tasks.rb +46 -0
- data/lib/muck-users.rb +7 -0
- data/locales/ar.yml +124 -0
- data/locales/bg.yml +124 -0
- data/locales/ca.yml +124 -0
- data/locales/cs.yml +124 -0
- data/locales/da.yml +124 -0
- data/locales/de.yml +124 -0
- data/locales/el.yml +124 -0
- data/locales/en.yml +127 -0
- data/locales/es.yml +124 -0
- data/locales/fr.yml +124 -0
- data/locales/it.yml +124 -0
- data/locales/iw.yml +124 -0
- data/locales/ja.yml +124 -0
- data/locales/ko.yml +124 -0
- data/locales/lt.yml +124 -0
- data/locales/lv.yml +124 -0
- data/locales/nl.yml +124 -0
- data/locales/no.yml +125 -0
- data/locales/pl.yml +124 -0
- data/locales/pt.yml +124 -0
- data/locales/ro.yml +124 -0
- data/locales/ru.yml +124 -0
- data/locales/sk.yml +124 -0
- data/locales/sl.yml +124 -0
- data/locales/sr.yml +124 -0
- data/locales/sv.yml +124 -0
- data/locales/tl.yml +124 -0
- data/locales/uk.yml +124 -0
- data/locales/vi.yml +124 -0
- data/locales/zh-CN.yml +124 -0
- data/locales/zh-TW.yml +124 -0
- data/locales/zh.yml +124 -0
- data/muck-users.gemspec +170 -0
- data/pkg/muck-users-0.1.0.gem +0 -0
- data/public/images/profile_default.jpg +0 -0
- data/rails/init.rb +18 -0
- data/tasks/muck_users_engine.rake +27 -0
- data/tasks/rails.rake +2 -0
- data/test/factories.rb +56 -0
- data/test/functional/activations_controller_test.rb +73 -0
- data/test/functional/admin/roles_controller_test.rb +10 -0
- data/test/functional/admin/users_controller_test.rb +55 -0
- data/test/functional/password_resets_controller_test.rb +60 -0
- data/test/functional/user_sessions_controller_test.rb +62 -0
- data/test/functional/users_controller_test.rb +255 -0
- data/test/shoulda_macros/controller.rb +43 -0
- data/test/shoulda_macros/forms.rb +28 -0
- data/test/shoulda_macros/models.rb +34 -0
- data/test/shoulda_macros/pagination.rb +48 -0
- data/test/shoulda_macros/plugins.rb +30 -0
- data/test/test_helper.rb +36 -0
- data/test/unit/muck_user_mailer_test.rb +64 -0
- data/test/unit/permission_test.rb +19 -0
- data/test/unit/role_test.rb +17 -0
- data/uninstall.rb +1 -0
- metadata +198 -0
data/locales/zh-TW.yml
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
zh-TW:
|
|
3
|
+
muck:
|
|
4
|
+
roles:
|
|
5
|
+
assign_role: 分配角色
|
|
6
|
+
edit_roles: 編輯角色
|
|
7
|
+
remove_role: 刪除角色
|
|
8
|
+
role_created: 作用已成功創建。
|
|
9
|
+
roles: 角色
|
|
10
|
+
users:
|
|
11
|
+
access_denied: 您沒有權限訪問請求的網頁。
|
|
12
|
+
account_activated: 您的帳戶已經啟用!現在,您可以登錄。
|
|
13
|
+
account_not_activated: "您{{application_name}}帳戶尚未啟用。"
|
|
14
|
+
activation_complete: 激活完成
|
|
15
|
+
activation_instructions: 啟動說明
|
|
16
|
+
activation_not_found: 激活碼沒有找到。請嘗試創建一個新帳戶。
|
|
17
|
+
admin:
|
|
18
|
+
activate_all_inactive_users: 激活所有閒置用戶
|
|
19
|
+
activate_all_inactive_users_confirm: 您確定要激活所有閒置的用戶系統?這無法撤消!
|
|
20
|
+
search_users: 搜索用戶
|
|
21
|
+
show_emails: 查看電子郵件
|
|
22
|
+
unactivated_users: "有{{count}} unactivated用戶"
|
|
23
|
+
admin_users_title: 用戶管理
|
|
24
|
+
all_users: 所有用戶
|
|
25
|
+
already_activated: 您的帳戶已經啟用。您可以登錄以下。
|
|
26
|
+
already_logged_in: 您已經登錄,不必恢復您的密碼。
|
|
27
|
+
already_registered: 已經是會員了嗎?
|
|
28
|
+
cannot_deactivate_yourself: 您不能停用你自己!
|
|
29
|
+
change_password: 更改密碼
|
|
30
|
+
change_your_password: 更改您的密碼
|
|
31
|
+
choose_member_name: 會員名稱
|
|
32
|
+
complete_profile: 完成您的簡介
|
|
33
|
+
confirm_delete_account: "你確定要刪除您的帳戶嗎? \\ n此無法復原。"
|
|
34
|
+
confirm_password: 確認密碼
|
|
35
|
+
confirm_select_new_password: 確認密碼更改
|
|
36
|
+
could_not_find_reset_code: 找不到密碼重置代碼。請嘗試再次重設密碼。
|
|
37
|
+
could_not_find_user_with_email: 無法找到用戶與電子郵件地址。
|
|
38
|
+
current_password: 當前密碼
|
|
39
|
+
delete_my_account: 刪除我的用戶帳戶和我的所有數據。
|
|
40
|
+
delete_this_user: 刪除此用戶。
|
|
41
|
+
edit_profile: 編輯簡介
|
|
42
|
+
email_address: 電郵地址
|
|
43
|
+
email_available: 電子郵件可用
|
|
44
|
+
email_help: "請使用有效的,目前e - mail地址。我們決不會共享或垃圾郵件的電子郵件地址。"
|
|
45
|
+
email_not_available: "電郵已在使用中。 {{reset_password_help}}"
|
|
46
|
+
email_recover_prompt: 請提供電子郵件您註冊時使用的,以恢復您的密碼。
|
|
47
|
+
first_name: 名字
|
|
48
|
+
forgot_password: 忘記密碼
|
|
49
|
+
forgot_username: 忘了使用者名稱
|
|
50
|
+
forgot_your_password: 忘記了密碼?
|
|
51
|
+
forgot_your_username: 忘記了您的用戶?
|
|
52
|
+
invalid_username: 用戶名無效
|
|
53
|
+
join_application_name: 加入並做
|
|
54
|
+
last_name: 姓氏
|
|
55
|
+
login_fail: 我們深感抱歉,但我們卻不能認識到您的登錄信息。請再試一次。
|
|
56
|
+
login_out_success: 您已經登出。
|
|
57
|
+
login_requred: 您必須登錄才能訪問此功能。
|
|
58
|
+
login_success: 登錄成功!
|
|
59
|
+
login_title: 登錄到您的帳戶
|
|
60
|
+
logout_required: 您必須先登錄,以訪問此頁面。
|
|
61
|
+
my_dashboard: 我的控制台
|
|
62
|
+
name: 名字
|
|
63
|
+
navigation:
|
|
64
|
+
all_users: 所有用戶
|
|
65
|
+
inactive_users: 沉默用戶
|
|
66
|
+
search_users: 搜索用戶
|
|
67
|
+
new_password_doesnt_match: 新密碼不匹配的密碼確認。
|
|
68
|
+
old_password_incorrect: 您的舊密碼不正確。
|
|
69
|
+
password: 密碼
|
|
70
|
+
password_cannot_be_blank: 密碼字段不能為空。
|
|
71
|
+
password_confirmation_help: 為了確保您的密碼是正確的,請再次輸入這裡。
|
|
72
|
+
password_help: 您的密碼至少應為6個字符。混合上,小寫字母和數字的作品以及
|
|
73
|
+
password_mismatch: 密碼不符。
|
|
74
|
+
password_not_reset: 密碼重置。
|
|
75
|
+
password_reset: 密碼重置。
|
|
76
|
+
password_reset_email_subject: "您已要求更改{{application_name}}密碼"
|
|
77
|
+
password_reset_link_sent: 重設密碼說明已發送給您。請檢查您的電子郵件。
|
|
78
|
+
password_updated: 密碼已成功更新。
|
|
79
|
+
permission_denied: 您沒有權限,以完成所要求的行動。
|
|
80
|
+
problem_changing_password: "有一個問題,改變您的密碼。 {{errors}}"
|
|
81
|
+
problem_creating_account: 有一個問題,創建您的帳戶。請更正下列錯誤:
|
|
82
|
+
problem_editing_account: 有一個問題,更新您的信息。
|
|
83
|
+
recover_password: 恢復密碼
|
|
84
|
+
recover_password_prompt: (如果您忘記了密碼恢復它在這裡)
|
|
85
|
+
register_account: "註冊{{application_name}}帳戶"
|
|
86
|
+
register_for_account: 註冊帳戶
|
|
87
|
+
remember_me: 記住我
|
|
88
|
+
remove_my_account: 刪除我的帳戶
|
|
89
|
+
request_username: 要求用戶名
|
|
90
|
+
reset_password: 重設密碼
|
|
91
|
+
reset_your_password: 重設密碼
|
|
92
|
+
select_new_password: 選擇新密碼
|
|
93
|
+
sign_in: 登陸
|
|
94
|
+
sign_in_now: 立即登錄!
|
|
95
|
+
sign_in_title: 登陸
|
|
96
|
+
sign_out_title: 登出
|
|
97
|
+
sign_up: 註冊
|
|
98
|
+
sign_up_now: 註冊現在
|
|
99
|
+
sorry_invalid_reset_code: 我們深感抱歉,但我們無法找到您的帳戶。如果您有問題,嘗試將此網址複製並粘貼到您的電子郵件到您的瀏覽器或重新啟動重置密碼的過程。
|
|
100
|
+
terms_and_service: "通過點擊'註冊現在變成了'你同意遵守{{tos_link_anchor}}Terms and Conditions{{link_end}}."
|
|
101
|
+
thanks_sign_up: 感謝您註冊!
|
|
102
|
+
thanks_sign_up_check: 您的帳戶已創建。請檢查您的電子郵箱為您的帳戶啟用指示!
|
|
103
|
+
thanks_sign_up_login: 感謝您註冊!現在您可以登錄
|
|
104
|
+
update_profile: 更新您的個人資料
|
|
105
|
+
update_user: 更新您的用戶信息
|
|
106
|
+
upload_photo: 上傳照片:
|
|
107
|
+
user_account_deleted: 您已成功刪除您的帳戶。
|
|
108
|
+
user_disable_problem: 有問題停用此用戶。
|
|
109
|
+
user_disabled: 用戶停用
|
|
110
|
+
user_enable_problem: 有問題,使該用戶。
|
|
111
|
+
user_enabled: 用戶啟用
|
|
112
|
+
user_marked_active: 用戶已被標記為活動
|
|
113
|
+
user_marked_inactive: 用戶已被標記為無效
|
|
114
|
+
user_successfully_deleted: "用戶{{login}}已成功刪除。"
|
|
115
|
+
user_update: 您的用戶信息已更新。
|
|
116
|
+
username: 用戶名
|
|
117
|
+
username_available: 用戶可用
|
|
118
|
+
username_help: 您可以使用6至20個字符。如果你想要的名稱沒有添加數字或標點符號。
|
|
119
|
+
username_not_available: 用戶無法使用
|
|
120
|
+
username_recover_prompt: 請提供電子郵件,您使用您建立帳戶時,您的用戶將通過電子郵件發送給您。
|
|
121
|
+
username_sent: 您的用戶名已發送電子郵件發送給您。請檢查您的電子郵件。
|
|
122
|
+
welcome: 歡迎
|
|
123
|
+
welcome_email_subject: "歡迎{{application_name}}"
|
|
124
|
+
what_is_the_email: 什麼是電子郵件地址用於創建您的帳戶嗎?
|
data/locales/zh.yml
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
zh:
|
|
3
|
+
muck:
|
|
4
|
+
roles:
|
|
5
|
+
assign_role: 分配角色
|
|
6
|
+
edit_roles: 编辑角色
|
|
7
|
+
remove_role: 删除角色
|
|
8
|
+
role_created: 作用已成功创建。
|
|
9
|
+
roles: 角色
|
|
10
|
+
users:
|
|
11
|
+
access_denied: 您没有权限访问请求的网页。
|
|
12
|
+
account_activated: 您的帐户已经启用!现在,您可以登录。
|
|
13
|
+
account_not_activated: "您{{application_name}}帐户尚未启用。"
|
|
14
|
+
activation_complete: 激活完成
|
|
15
|
+
activation_instructions: 启动说明
|
|
16
|
+
activation_not_found: 激活码没有找到。请尝试创建一个新帐户。
|
|
17
|
+
admin:
|
|
18
|
+
activate_all_inactive_users: 激活所有闲置用户
|
|
19
|
+
activate_all_inactive_users_confirm: 您确定要激活所有闲置的用户系统?这无法撤消!
|
|
20
|
+
search_users: 搜索用户
|
|
21
|
+
show_emails: 查看电子邮件
|
|
22
|
+
unactivated_users: "有{{count}} unactivated用户"
|
|
23
|
+
admin_users_title: 用户管理
|
|
24
|
+
all_users: 所有用户
|
|
25
|
+
already_activated: 您的帐户已经启用。您可以登录以下。
|
|
26
|
+
already_logged_in: 您已经登录,不必恢复您的密码。
|
|
27
|
+
already_registered: 已经是会员了吗?
|
|
28
|
+
cannot_deactivate_yourself: 您不能停用你自己!
|
|
29
|
+
change_password: 更改密码
|
|
30
|
+
change_your_password: 更改您的密码
|
|
31
|
+
choose_member_name: 会员名称
|
|
32
|
+
complete_profile: 完成您的简介
|
|
33
|
+
confirm_delete_account: "你确定要删除您的帐户吗? \\ n此无法复原。"
|
|
34
|
+
confirm_password: 确认密码
|
|
35
|
+
confirm_select_new_password: 确认密码更改
|
|
36
|
+
could_not_find_reset_code: 找不到密码重置代码。请尝试再次重设密码。
|
|
37
|
+
could_not_find_user_with_email: 无法找到用户与电子邮件地址。
|
|
38
|
+
current_password: 当前密码
|
|
39
|
+
delete_my_account: 删除我的用户帐户和我的所有数据。
|
|
40
|
+
delete_this_user: 删除此用户。
|
|
41
|
+
edit_profile: 编辑简介
|
|
42
|
+
email_address: 电邮地址
|
|
43
|
+
email_available: 电子邮件可用
|
|
44
|
+
email_help: "请使用有效的,目前e - mail地址。我们决不会共享或垃圾邮件的电子邮件地址。"
|
|
45
|
+
email_not_available: "电邮已在使用中。 {{reset_password_help}}"
|
|
46
|
+
email_recover_prompt: 请提供电子邮件您注册时使用的,以恢复您的密码。
|
|
47
|
+
first_name: 名字
|
|
48
|
+
forgot_password: 忘记密码
|
|
49
|
+
forgot_username: 忘了使用者名称
|
|
50
|
+
forgot_your_password: 忘记了密码?
|
|
51
|
+
forgot_your_username: 忘记了您的用户?
|
|
52
|
+
invalid_username: 用户名无效
|
|
53
|
+
join_application_name: 加入并做
|
|
54
|
+
last_name: 姓氏
|
|
55
|
+
login_fail: 我们深感抱歉,但我们却不能认识到您的登录信息。请再试一次。
|
|
56
|
+
login_out_success: 您已经登出。
|
|
57
|
+
login_requred: 您必须登录才能访问此功能。
|
|
58
|
+
login_success: 登录成功!
|
|
59
|
+
login_title: 登录到您的帐户
|
|
60
|
+
logout_required: 您必须先登录,以访问此页面。
|
|
61
|
+
my_dashboard: 我的控制台
|
|
62
|
+
name: 名字
|
|
63
|
+
navigation:
|
|
64
|
+
all_users: 所有用户
|
|
65
|
+
inactive_users: 沉默用户
|
|
66
|
+
search_users: 搜索用户
|
|
67
|
+
new_password_doesnt_match: 新密码不匹配的密码确认。
|
|
68
|
+
old_password_incorrect: 您的旧密码不正确。
|
|
69
|
+
password: 密码
|
|
70
|
+
password_cannot_be_blank: 密码字段不能为空。
|
|
71
|
+
password_confirmation_help: 为了确保您的密码是正确的,请再次输入这里。
|
|
72
|
+
password_help: 您的密码至少应为6个字符。混合上,小写字母和数字的作品以及
|
|
73
|
+
password_mismatch: 密码不符。
|
|
74
|
+
password_not_reset: 密码重置。
|
|
75
|
+
password_reset: 密码重置。
|
|
76
|
+
password_reset_email_subject: "您已要求更改{{application_name}}密码"
|
|
77
|
+
password_reset_link_sent: 重设密码说明已发送给您。请检查您的电子邮件。
|
|
78
|
+
password_updated: 密码已成功更新。
|
|
79
|
+
permission_denied: 您没有权限,以完成所要求的行动。
|
|
80
|
+
problem_changing_password: "有一个问题,改变您的密码。 {{errors}}"
|
|
81
|
+
problem_creating_account: 有一个问题,创建您的帐户。请更正下列错误:
|
|
82
|
+
problem_editing_account: 有一个问题,更新您的信息。
|
|
83
|
+
recover_password: 恢复密码
|
|
84
|
+
recover_password_prompt: (如果您忘记了密码恢复它在这里)
|
|
85
|
+
register_account: "注册{{application_name}}帐户"
|
|
86
|
+
register_for_account: 注册帐户
|
|
87
|
+
remember_me: 记住我
|
|
88
|
+
remove_my_account: 删除我的帐户
|
|
89
|
+
request_username: 要求用户名
|
|
90
|
+
reset_password: 重设密码
|
|
91
|
+
reset_your_password: 重设密码
|
|
92
|
+
select_new_password: 选择新密码
|
|
93
|
+
sign_in: 登陆
|
|
94
|
+
sign_in_now: 立即登录!
|
|
95
|
+
sign_in_title: 登陆
|
|
96
|
+
sign_out_title: 登出
|
|
97
|
+
sign_up: 注册
|
|
98
|
+
sign_up_now: 注册现在
|
|
99
|
+
sorry_invalid_reset_code: 我们深感抱歉,但我们无法找到您的帐户。如果您有问题,尝试将此网址复制并粘贴到您的电子邮件到您的浏览器或重新启动重置密码的过程。
|
|
100
|
+
terms_and_service: "通过点击'注册现在变成了'你同意遵守{{tos_link_anchor}}Terms and Conditions{{link_end}}."
|
|
101
|
+
thanks_sign_up: 感谢您注册!
|
|
102
|
+
thanks_sign_up_check: 您的帐户已创建。请检查您的电子邮箱为您的帐户启用指示!
|
|
103
|
+
thanks_sign_up_login: 感谢您注册!现在您可以登录
|
|
104
|
+
update_profile: 更新您的个人资料
|
|
105
|
+
update_user: 更新您的用户信息
|
|
106
|
+
upload_photo: 上传照片:
|
|
107
|
+
user_account_deleted: 您已成功删除您的帐户。
|
|
108
|
+
user_disable_problem: 有问题停用此用户。
|
|
109
|
+
user_disabled: 用户停用
|
|
110
|
+
user_enable_problem: 有问题,使该用户。
|
|
111
|
+
user_enabled: 用户启用
|
|
112
|
+
user_marked_active: 用户已被标记为活动
|
|
113
|
+
user_marked_inactive: 用户已被标记为无效
|
|
114
|
+
user_successfully_deleted: "用户{{login}}已成功删除。"
|
|
115
|
+
user_update: 您的用户信息已更新。
|
|
116
|
+
username: 用户名
|
|
117
|
+
username_available: 用户可用
|
|
118
|
+
username_help: 您可以使用6至20个字符。如果你想要的名称没有添加数字或标点符号。
|
|
119
|
+
username_not_available: 用户无法使用
|
|
120
|
+
username_recover_prompt: 请提供电子邮件,您使用您建立帐户时,您的用户将通过电子邮件发送给您。
|
|
121
|
+
username_sent: 您的用户名已发送电子邮件发送给您。请检查您的电子邮件。
|
|
122
|
+
welcome: 欢迎
|
|
123
|
+
welcome_email_subject: "欢迎{{application_name}}"
|
|
124
|
+
what_is_the_email: 什么是电子邮件地址用于创建您的帐户吗?
|
data/muck-users.gemspec
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = %q{muck-users}
|
|
5
|
+
s.version = "0.1.0"
|
|
6
|
+
|
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
8
|
+
s.authors = ["Justin Ball"]
|
|
9
|
+
s.date = %q{2009-06-11}
|
|
10
|
+
s.description = %q{Easily add user signup, login and other features to your application}
|
|
11
|
+
s.email = %q{justinball@gmail.com}
|
|
12
|
+
s.extra_rdoc_files = [
|
|
13
|
+
"README.rdoc"
|
|
14
|
+
]
|
|
15
|
+
s.files = [
|
|
16
|
+
"MIT-LICENSE",
|
|
17
|
+
"README.rdoc",
|
|
18
|
+
"Rakefile",
|
|
19
|
+
"VERSION",
|
|
20
|
+
"app/controllers/admin/muck/roles_controller.rb",
|
|
21
|
+
"app/controllers/admin/muck/users_controller.rb",
|
|
22
|
+
"app/controllers/muck/activations_controller.rb",
|
|
23
|
+
"app/controllers/muck/password_resets_controller.rb",
|
|
24
|
+
"app/controllers/muck/user_sessions_controller.rb",
|
|
25
|
+
"app/controllers/muck/username_request_controller.rb",
|
|
26
|
+
"app/controllers/muck/users_controller.rb",
|
|
27
|
+
"app/models/muck_user_mailer.rb",
|
|
28
|
+
"app/models/permission.rb",
|
|
29
|
+
"app/models/role.rb",
|
|
30
|
+
"app/views/admin/roles/_role.html.erb",
|
|
31
|
+
"app/views/admin/roles/edit.html.erb",
|
|
32
|
+
"app/views/admin/roles/index.html.erb",
|
|
33
|
+
"app/views/admin/roles/new.html.erb",
|
|
34
|
+
"app/views/admin/roles/show.html.erb",
|
|
35
|
+
"app/views/admin/users/_activate.html.erb",
|
|
36
|
+
"app/views/admin/users/_ajax_search_box.html.erb",
|
|
37
|
+
"app/views/admin/users/_row.html.erb",
|
|
38
|
+
"app/views/admin/users/_search_box.html.erb",
|
|
39
|
+
"app/views/admin/users/_table.html.erb",
|
|
40
|
+
"app/views/admin/users/_user_navigation.html.erb",
|
|
41
|
+
"app/views/admin/users/do_search.html.erb",
|
|
42
|
+
"app/views/admin/users/inactive.html.erb",
|
|
43
|
+
"app/views/admin/users/inactive_emails.html.erb",
|
|
44
|
+
"app/views/admin/users/index.html.erb",
|
|
45
|
+
"app/views/admin/users/search.html.erb",
|
|
46
|
+
"app/views/muck_user_mailer/activation_confirmation.html.erb",
|
|
47
|
+
"app/views/muck_user_mailer/activation_instructions.html.erb",
|
|
48
|
+
"app/views/muck_user_mailer/password_not_active_instructions.html.erb",
|
|
49
|
+
"app/views/muck_user_mailer/password_reset_instructions.html.erb",
|
|
50
|
+
"app/views/muck_user_mailer/username_request.html.erb",
|
|
51
|
+
"app/views/muck_user_mailer/welcome_notification.html.erb",
|
|
52
|
+
"app/views/password_resets/edit.html.erb",
|
|
53
|
+
"app/views/password_resets/new.html.erb",
|
|
54
|
+
"app/views/user_sessions/new.html.erb",
|
|
55
|
+
"app/views/username_request/new.html.erb",
|
|
56
|
+
"app/views/users/_user.html.erb",
|
|
57
|
+
"app/views/users/activation_confirmation.html.erb",
|
|
58
|
+
"app/views/users/activation_instructions.html.erb",
|
|
59
|
+
"app/views/users/edit.html.erb",
|
|
60
|
+
"app/views/users/new.html.erb",
|
|
61
|
+
"app/views/users/show.html.erb",
|
|
62
|
+
"app/views/users/welcome.html.erb",
|
|
63
|
+
"config/muck_users_routes.rb",
|
|
64
|
+
"db/migrate/20090320174818_create_muck_permissions_and_roles.rb",
|
|
65
|
+
"db/migrate/20090512013727_add_photo_to_user.rb",
|
|
66
|
+
"install.rb",
|
|
67
|
+
"lib/action_controller/authentic_application.rb",
|
|
68
|
+
"lib/active_record/acts/muck_user.rb",
|
|
69
|
+
"lib/muck-users.rb",
|
|
70
|
+
"lib/muck-users/exceptions.rb",
|
|
71
|
+
"lib/muck-users/initialize_routes.rb",
|
|
72
|
+
"lib/muck-users/tasks.rb",
|
|
73
|
+
"locales/ar.yml",
|
|
74
|
+
"locales/bg.yml",
|
|
75
|
+
"locales/ca.yml",
|
|
76
|
+
"locales/cs.yml",
|
|
77
|
+
"locales/da.yml",
|
|
78
|
+
"locales/de.yml",
|
|
79
|
+
"locales/el.yml",
|
|
80
|
+
"locales/en.yml",
|
|
81
|
+
"locales/es.yml",
|
|
82
|
+
"locales/fr.yml",
|
|
83
|
+
"locales/it.yml",
|
|
84
|
+
"locales/iw.yml",
|
|
85
|
+
"locales/ja.yml",
|
|
86
|
+
"locales/ko.yml",
|
|
87
|
+
"locales/lt.yml",
|
|
88
|
+
"locales/lv.yml",
|
|
89
|
+
"locales/nl.yml",
|
|
90
|
+
"locales/no.yml",
|
|
91
|
+
"locales/pl.yml",
|
|
92
|
+
"locales/pt.yml",
|
|
93
|
+
"locales/ro.yml",
|
|
94
|
+
"locales/ru.yml",
|
|
95
|
+
"locales/sk.yml",
|
|
96
|
+
"locales/sl.yml",
|
|
97
|
+
"locales/sr.yml",
|
|
98
|
+
"locales/sv.yml",
|
|
99
|
+
"locales/tl.yml",
|
|
100
|
+
"locales/uk.yml",
|
|
101
|
+
"locales/vi.yml",
|
|
102
|
+
"locales/zh-CN.yml",
|
|
103
|
+
"locales/zh-TW.yml",
|
|
104
|
+
"locales/zh.yml",
|
|
105
|
+
"muck-users.gemspec",
|
|
106
|
+
"pkg/muck-users-0.1.0.gem",
|
|
107
|
+
"public/images/profile_default.jpg",
|
|
108
|
+
"rails/init.rb",
|
|
109
|
+
"tasks/muck_users_engine.rake",
|
|
110
|
+
"tasks/rails.rake",
|
|
111
|
+
"test/factories.rb",
|
|
112
|
+
"test/functional/activations_controller_test.rb",
|
|
113
|
+
"test/functional/admin/roles_controller_test.rb",
|
|
114
|
+
"test/functional/admin/users_controller_test.rb",
|
|
115
|
+
"test/functional/password_resets_controller_test.rb",
|
|
116
|
+
"test/functional/user_sessions_controller_test.rb",
|
|
117
|
+
"test/functional/users_controller_test.rb",
|
|
118
|
+
"test/shoulda_macros/controller.rb",
|
|
119
|
+
"test/shoulda_macros/forms.rb",
|
|
120
|
+
"test/shoulda_macros/models.rb",
|
|
121
|
+
"test/shoulda_macros/pagination.rb",
|
|
122
|
+
"test/shoulda_macros/plugins.rb",
|
|
123
|
+
"test/test_helper.rb",
|
|
124
|
+
"test/unit/muck_user_mailer_test.rb",
|
|
125
|
+
"test/unit/permission_test.rb",
|
|
126
|
+
"test/unit/role_test.rb",
|
|
127
|
+
"uninstall.rb"
|
|
128
|
+
]
|
|
129
|
+
s.has_rdoc = true
|
|
130
|
+
s.homepage = %q{http://github.com/jbasdf/muck-users}
|
|
131
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
|
132
|
+
s.require_paths = ["lib"]
|
|
133
|
+
s.rubyforge_project = %q{muck-users}
|
|
134
|
+
s.rubygems_version = %q{1.3.1}
|
|
135
|
+
s.summary = %q{Easy to use user engine for Rails}
|
|
136
|
+
s.test_files = [
|
|
137
|
+
"test/factories.rb",
|
|
138
|
+
"test/functional/activations_controller_test.rb",
|
|
139
|
+
"test/functional/admin/roles_controller_test.rb",
|
|
140
|
+
"test/functional/admin/users_controller_test.rb",
|
|
141
|
+
"test/functional/password_resets_controller_test.rb",
|
|
142
|
+
"test/functional/user_sessions_controller_test.rb",
|
|
143
|
+
"test/functional/users_controller_test.rb",
|
|
144
|
+
"test/shoulda_macros/controller.rb",
|
|
145
|
+
"test/shoulda_macros/forms.rb",
|
|
146
|
+
"test/shoulda_macros/models.rb",
|
|
147
|
+
"test/shoulda_macros/pagination.rb",
|
|
148
|
+
"test/shoulda_macros/plugins.rb",
|
|
149
|
+
"test/test_helper.rb",
|
|
150
|
+
"test/unit/muck_user_mailer_test.rb",
|
|
151
|
+
"test/unit/permission_test.rb",
|
|
152
|
+
"test/unit/role_test.rb"
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
if s.respond_to? :specification_version then
|
|
156
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
157
|
+
s.specification_version = 2
|
|
158
|
+
|
|
159
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
160
|
+
s.add_runtime_dependency(%q<authlogic>, [">= 0"])
|
|
161
|
+
s.add_runtime_dependency(%q<muck-engine>, [">= 0"])
|
|
162
|
+
else
|
|
163
|
+
s.add_dependency(%q<authlogic>, [">= 0"])
|
|
164
|
+
s.add_dependency(%q<muck-engine>, [">= 0"])
|
|
165
|
+
end
|
|
166
|
+
else
|
|
167
|
+
s.add_dependency(%q<authlogic>, [">= 0"])
|
|
168
|
+
s.add_dependency(%q<muck-engine>, [">= 0"])
|
|
169
|
+
end
|
|
170
|
+
end
|
|
Binary file
|
|
Binary file
|
data/rails/init.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
ActiveSupport::Dependencies.load_once_paths << lib_path
|
|
2
|
+
|
|
3
|
+
if config.respond_to?(:gems)
|
|
4
|
+
config.gem "authlogic", :lib => 'authlogic', :version => ">=2.0.13"
|
|
5
|
+
else
|
|
6
|
+
begin
|
|
7
|
+
require 'authlogic'
|
|
8
|
+
rescue LoadError
|
|
9
|
+
begin
|
|
10
|
+
gem 'authlogic', '>=2.0.13'
|
|
11
|
+
rescue Gem::LoadError
|
|
12
|
+
puts "Please install the authlogic gem"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
require 'muck-users'
|
|
18
|
+
require 'muck-users/initialize_routes'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
namespace :muck do
|
|
2
|
+
namespace :users do
|
|
3
|
+
desc "Sync files from muck users."
|
|
4
|
+
task :sync do
|
|
5
|
+
system "rsync -ruv vendor/plugins/muck-users/db ."
|
|
6
|
+
system "rsync -ruv vendor/plugins/muck-users/public ."
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
desc "Setup default admin user"
|
|
10
|
+
task :create_admin => :environment do
|
|
11
|
+
['administrator'].each {|r| Role.create(:rolename => r) }
|
|
12
|
+
user = User.new
|
|
13
|
+
user.login = "admin"
|
|
14
|
+
user.email = GlobalConfig.admin_email
|
|
15
|
+
user.password = "asdfasdf"
|
|
16
|
+
user.password_confirmation = "asdfasdf"
|
|
17
|
+
user.first_name = "Administrator"
|
|
18
|
+
user.last_name = "Administrator"
|
|
19
|
+
user.save
|
|
20
|
+
user.activate!
|
|
21
|
+
|
|
22
|
+
user.roles << Role.find_by_rolename('administrator')
|
|
23
|
+
|
|
24
|
+
puts 'created admin user'
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
data/tasks/rails.rake
ADDED
data/test/factories.rb
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Factory.sequence :email do |n|
|
|
2
|
+
"somebody#{n}@example.com"
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
Factory.sequence :login do |n|
|
|
6
|
+
"inquire#{n}"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
Factory.sequence :name do |n|
|
|
10
|
+
"a_name#{n}"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
Factory.sequence :abbr do |n|
|
|
14
|
+
"abbr#{n}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Factory.sequence :description do |n|
|
|
18
|
+
"This is the description: #{n}"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Factory.define :state do |f|
|
|
22
|
+
f.name { Factory.next(:name) }
|
|
23
|
+
f.abbreviation { Factory.next(:abbr) }
|
|
24
|
+
f.country {|a| a.association(:country) }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Factory.define :country do |f|
|
|
28
|
+
f.name { Factory.next(:name) }
|
|
29
|
+
f.abbreviation { Factory.next(:abbr) }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
Factory.define :user do |f|
|
|
33
|
+
f.login { Factory.next(:login) }
|
|
34
|
+
f.email { Factory.next(:email) }
|
|
35
|
+
f.password 'inquire_pass'
|
|
36
|
+
f.password_confirmation 'inquire_pass'
|
|
37
|
+
f.first_name 'test'
|
|
38
|
+
f.last_name 'guy'
|
|
39
|
+
f.terms_of_service true
|
|
40
|
+
f.activated_at DateTime.now
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Factory.define :content_page do |f|
|
|
44
|
+
f.creator {|a| a.association(:user)}
|
|
45
|
+
f.title { Factory.next(:name) }
|
|
46
|
+
f.body_raw { Factory.next(:description) }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
Factory.define :permission do |f|
|
|
50
|
+
f.role {|a| a.association(:role)}
|
|
51
|
+
f.user {|a| a.association(:user)}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
Factory.define :role do |f|
|
|
55
|
+
f.rolename 'administrator'
|
|
56
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
+
|
|
3
|
+
class Muck::ActivationsControllerTest < ActionController::TestCase
|
|
4
|
+
|
|
5
|
+
def setup
|
|
6
|
+
@controller = Muck::ActivationsController.new
|
|
7
|
+
@request = ActionController::TestRequest.new
|
|
8
|
+
@response = ActionController::TestResponse.new
|
|
9
|
+
activate_authlogic
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
context "activations controller" do
|
|
13
|
+
context "not logged in" do
|
|
14
|
+
setup do
|
|
15
|
+
@password = 'testpass'
|
|
16
|
+
@login = 'testuser'
|
|
17
|
+
@user = Factory(:user, :login => @login, :password => @password,
|
|
18
|
+
:password_confirmation => @password, :activated_at => nil)
|
|
19
|
+
end
|
|
20
|
+
context "activate user" do
|
|
21
|
+
setup do
|
|
22
|
+
get :new, :id => @user.perishable_token
|
|
23
|
+
end
|
|
24
|
+
should_set_the_flash_to(/Your account has been activated! You can now login/i)
|
|
25
|
+
should_redirect_to("welcome path") { welcome_user_path(@user) }
|
|
26
|
+
should "be able to login" do
|
|
27
|
+
user_session = UserSession.new(:login => @login, :password => @password)
|
|
28
|
+
assert user_session.save
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
context "attempt to activate already activated user" do
|
|
32
|
+
setup do
|
|
33
|
+
@user.activate!
|
|
34
|
+
get :new, :id => @user.perishable_token
|
|
35
|
+
end
|
|
36
|
+
should_set_the_flash_to(/Your account has already been activated. You can log in below/i)
|
|
37
|
+
should_redirect_to("login") { login_path }
|
|
38
|
+
end
|
|
39
|
+
context "don't activate user without key" do
|
|
40
|
+
setup do
|
|
41
|
+
get :new
|
|
42
|
+
end
|
|
43
|
+
should_set_the_flash_to(/Activation code not found. Please try creating a new account/i)
|
|
44
|
+
should_redirect_to("signup") { new_user_path }
|
|
45
|
+
end
|
|
46
|
+
context "don't activate user with blank key" do
|
|
47
|
+
setup do
|
|
48
|
+
get :new, :id => ''
|
|
49
|
+
end
|
|
50
|
+
should_set_the_flash_to(/Activation code not found. Please try creating a new account/i)
|
|
51
|
+
should_redirect_to("signup") { new_user_path }
|
|
52
|
+
end
|
|
53
|
+
context "don't activate user with bad key" do
|
|
54
|
+
setup do
|
|
55
|
+
get :new, :id => 'asdfasdfasdf'
|
|
56
|
+
end
|
|
57
|
+
should_set_the_flash_to(/Activation code not found. Please try creating a new account/i)
|
|
58
|
+
should_redirect_to("signup") { new_user_path }
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
context "logged in" do
|
|
63
|
+
setup do
|
|
64
|
+
@activated_user = Factory(:user)
|
|
65
|
+
login_as @activated_user
|
|
66
|
+
get :new, :id => @activated_user.perishable_token
|
|
67
|
+
end
|
|
68
|
+
should_redirect_to("already logged in page") { @activated_user }
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../../test_helper'
|
|
2
|
+
|
|
3
|
+
class Admin::Muck::RolesControllerTest < ActionController::TestCase
|
|
4
|
+
|
|
5
|
+
tests Admin::Muck::RolesController
|
|
6
|
+
|
|
7
|
+
# should_require_login :index => :get, :show => :get, :new => :get, :create => :post, :update => :put, :login_url => '/login'
|
|
8
|
+
# should_require_role(:admin, '/login', :index)
|
|
9
|
+
|
|
10
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/../../test_helper'
|
|
2
|
+
|
|
3
|
+
class Admin::Muck::UsersControllerTest < ActionController::TestCase
|
|
4
|
+
|
|
5
|
+
tests Admin::Muck::UsersController
|
|
6
|
+
|
|
7
|
+
should_require_login :index => :get, :inactive => :get, :inactive_emails => :get, :activate_all => :get, :search => :get, :login_url => '/login'
|
|
8
|
+
|
|
9
|
+
#:enable => :get, :disable => :get, :update => :post
|
|
10
|
+
#should_require_role(:admin, '/login', :index)
|
|
11
|
+
|
|
12
|
+
context "logged in as admin" do
|
|
13
|
+
setup do
|
|
14
|
+
@admin = Factory(:user)
|
|
15
|
+
@admin_role = Factory(:role, :rolename => 'administrator')
|
|
16
|
+
@admin.roles << @admin_role
|
|
17
|
+
activate_authlogic
|
|
18
|
+
login_as @admin
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
context "GET index" do
|
|
22
|
+
setup do
|
|
23
|
+
get :index
|
|
24
|
+
end
|
|
25
|
+
should_respond_with :success
|
|
26
|
+
should_render_template :index
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context "GET inactive" do
|
|
30
|
+
setup do
|
|
31
|
+
get :inactive
|
|
32
|
+
end
|
|
33
|
+
should_respond_with :success
|
|
34
|
+
should_render_template :inactive
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
context "GET search" do
|
|
38
|
+
setup do
|
|
39
|
+
get :search
|
|
40
|
+
end
|
|
41
|
+
should_respond_with :success
|
|
42
|
+
should_render_template :search
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
context 'on DELETE to :destroy' do
|
|
46
|
+
setup do
|
|
47
|
+
@user = Factory(:user)
|
|
48
|
+
delete :destroy, {:id => @user.to_param}
|
|
49
|
+
end
|
|
50
|
+
should_redirect_to("Main user screen") { admin_users_path }
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|