kit_cms 2.3.20 → 2.3.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/app/assets/images/kit/toolbar/smile.png +0 -0
  2. data/app/assets/images/kit/toolbar/wink.gif +0 -0
  3. data/app/assets/images/kit/toolbar/wink.png +0 -0
  4. data/app/assets/javascripts/codemirror/editor.js +55 -17
  5. data/app/assets/javascripts/codemirror/jquery.js +0 -1
  6. data/app/assets/javascripts/codemirror/ruby.js +196 -0
  7. data/app/assets/javascripts/jquery.js +3036 -2838
  8. data/app/assets/javascripts/kit/utilities.js +655 -586
  9. data/app/assets/stylesheets/codemirror/style.css +1 -1
  10. data/app/assets/stylesheets/codemirror/theme.css +23 -3
  11. data/app/assets/stylesheets/kit/calendar.css +6 -1
  12. data/app/assets/stylesheets/kit/cms/cms.css +36 -0
  13. data/app/assets/stylesheets/kit/forums.css +5 -1
  14. data/app/assets/stylesheets/kit/kit.css +3 -1
  15. data/app/controllers/account_controller.rb +306 -0
  16. data/app/controllers/ad_controller.rb +2 -0
  17. data/app/controllers/admin/ad_units_controller.rb +1 -1
  18. data/app/controllers/admin/ad_zones_controller.rb +15 -0
  19. data/app/controllers/admin/ads_controller.rb +5 -0
  20. data/app/controllers/admin/block_controller.rb +1 -65
  21. data/app/controllers/admin/blocks_controller.rb +2 -0
  22. data/app/controllers/admin/content_controller.rb +3 -1
  23. data/app/controllers/admin/dashboard_controller.rb +28 -4
  24. data/app/controllers/admin/dj_controller.rb +45 -0
  25. data/app/controllers/admin/help_controller.rb +1 -1
  26. data/app/controllers/admin/html_asset_controller.rb +0 -12
  27. data/app/controllers/admin/q_controller.rb +120 -0
  28. data/app/controllers/admin/user_controller.rb +4 -4
  29. data/app/controllers/api_controller.rb +34 -0
  30. data/app/controllers/calendar_controller.rb +1 -1
  31. data/app/controllers/form_controller.rb +3 -3
  32. data/app/controllers/forum_controller.rb +39 -29
  33. data/app/controllers/kit_controller.rb +42 -15
  34. data/app/controllers/pages_controller.rb +25 -5
  35. data/app/controllers/q_controller.rb +235 -0
  36. data/app/controllers/repo_controller.rb +7 -0
  37. data/app/controllers/user_controller.rb +14 -10
  38. data/app/controllers/utility_controller.rb +1 -1
  39. data/app/helpers/account_helper.rb +47 -0
  40. data/app/helpers/admin/layouts_helper.rb +8 -0
  41. data/app/helpers/admin/page_templates_helper.rb +8 -0
  42. data/app/helpers/ads_helper.rb +11 -12
  43. data/app/helpers/calendar_helper.rb +6 -2
  44. data/app/helpers/form_data_helper.rb +1 -1
  45. data/app/helpers/form_helper.rb +8 -0
  46. data/app/helpers/forum_helper.rb +5 -1
  47. data/app/helpers/kit_helper.rb +65 -35
  48. data/app/helpers/kit_modules_helper.rb +4 -0
  49. data/app/helpers/user_helper.rb +0 -28
  50. data/app/jobs/page_link_job.rb +34 -0
  51. data/app/jobs/queue_job.rb +134 -0
  52. data/app/mailers/notification.rb +10 -0
  53. data/app/mailers/queue_mailer.rb +13 -0
  54. data/app/models/ad.rb +6 -6
  55. data/app/models/ad_unit.rb +1 -1
  56. data/app/models/ad_zone.rb +4 -0
  57. data/app/models/block.rb +1 -1
  58. data/app/models/delayed_job.rb +3 -0
  59. data/app/models/form.rb +16 -4
  60. data/app/models/html_asset.rb +19 -4
  61. data/app/models/html_asset_usage.rb +3 -0
  62. data/app/models/html_assetable.rb +4 -0
  63. data/app/models/layout.rb +36 -6
  64. data/app/models/newsletter.rb +1 -1
  65. data/app/models/page.rb +36 -2
  66. data/app/models/page_link.rb +5 -0
  67. data/app/models/page_template.rb +22 -2
  68. data/app/models/preference.rb +1 -1
  69. data/app/models/q_event.rb +12 -0
  70. data/app/models/q_klass.rb +5 -0
  71. data/app/models/q_message.rb +9 -0
  72. data/app/models/q_publisher.rb +35 -0
  73. data/app/models/q_subscription.rb +7 -0
  74. data/app/models/q_user.rb +29 -0
  75. data/app/models/q_users_method.rb +6 -0
  76. data/app/models/q_users_publisher.rb +6 -0
  77. data/app/models/user.rb +127 -19
  78. data/app/models/user_login.rb +4 -0
  79. data/app/validators/email_validator.rb +14 -0
  80. data/app/views/account/_edit.html.haml +40 -0
  81. data/app/views/account/_edit_intro.html.haml +3 -0
  82. data/app/views/account/_forgotten.html.haml +20 -0
  83. data/app/views/account/_forgotten_intro.html.haml +5 -0
  84. data/app/views/account/_sign_in.html.haml +31 -0
  85. data/app/views/account/_sign_in_intro.html.haml +4 -0
  86. data/app/views/account/_sign_up.html.haml +51 -0
  87. data/app/views/account/_sign_up_intro.html.haml +4 -0
  88. data/app/views/account/edit.html.haml +1 -0
  89. data/app/views/account/forgotten.html.haml +1 -0
  90. data/app/views/account/sign_in.html.haml +2 -0
  91. data/app/views/account/sign_up.html.haml +1 -0
  92. data/app/views/ad/_buy.html.haml +2 -1
  93. data/app/views/admin/ad_zones/_form.html.haml +1 -1
  94. data/app/views/admin/ad_zones/show.html.haml +2 -0
  95. data/app/views/admin/blocks/_form.html.haml +11 -1
  96. data/app/views/admin/dashboard/broken_links.html.haml +9 -0
  97. data/app/views/admin/dashboard/system.html.haml +11 -0
  98. data/app/views/admin/dj/index.html.haml +43 -0
  99. data/app/views/admin/form/_form.html.haml +15 -10
  100. data/app/views/admin/group/index.html.haml +1 -1
  101. data/app/views/admin/help/edit.html.haml +1 -1
  102. data/app/views/admin/html_asset/show.html.haml +9 -2
  103. data/app/views/admin/layouts/show.html.haml +10 -16
  104. data/app/views/admin/page_templates/_form.html.haml +9 -17
  105. data/app/views/admin/page_templates/show.html.haml +5 -4
  106. data/app/views/admin/q/events.html.haml +26 -0
  107. data/app/views/admin/q/index.html.haml +28 -0
  108. data/app/views/admin/q/klasses.html.haml +61 -0
  109. data/app/views/admin/q/messages.html.haml +37 -0
  110. data/app/views/admin/q/show.html.haml +98 -0
  111. data/app/views/admin/q/subscriptions.html.haml +26 -0
  112. data/app/views/admin/q/users.html.haml +27 -0
  113. data/app/views/admin/snippet/edit.html.erb +1 -1
  114. data/app/views/admin/snippet/new.html.erb +1 -1
  115. data/app/views/admin/stylesheet/show.html.haml +1 -1
  116. data/app/views/admin/user/index.html.erb +15 -6
  117. data/app/views/admin/user/view.html.erb +5 -4
  118. data/app/views/admin/views/_form.html.haml +3 -3
  119. data/app/views/calendar/_buy_tickets.html.haml +1 -1
  120. data/app/views/calendar/_calendar_entry.html.haml +1 -1
  121. data/app/views/calendar/_month.html.haml +7 -7
  122. data/app/views/form/_show.html.haml +1 -1
  123. data/app/views/forum/_add_post.html.haml +7 -8
  124. data/app/views/forum/_mod_thread.js.erb +46 -6
  125. data/app/views/forum/_post_moderation.html.haml +2 -1
  126. data/app/views/forum/_post_preview.html.haml +1 -9
  127. data/app/views/forum/_post_scripts.js.erb +29 -5
  128. data/app/views/forum/fetch_raw.html.haml +1 -0
  129. data/app/views/forum/moderate.html.haml +1 -0
  130. data/app/views/forum/topic_index.html.haml +4 -0
  131. data/app/views/notification/{event.txt.erb → event.text.erb} +0 -0
  132. data/app/views/notification/forgotten_password.text.erb +2 -0
  133. data/app/views/pages/content_edit.html.haml +1 -1
  134. data/app/views/pages/info.html.erb +13 -2
  135. data/app/views/pages/links.html.haml +63 -0
  136. data/app/views/user/edit_profile.html.haml +1 -1
  137. data/app/views/utility/_cm_editor.html.erb +13 -10
  138. data/app/views/utility/_cm_toolbar_markdown.html.haml +8 -1
  139. data/app/views/utility/_menu.html.haml +4 -0
  140. data/app/views/utility/mercury_html.html.haml +1 -0
  141. data/config/initializers/elastic_search.rb +6 -3
  142. data/config/initializers/extend_controller.rb +3 -0
  143. data/config/initializers/string.rb +9 -6
  144. data/config/initializers/warden.rb +49 -0
  145. data/config/locales/en.yml +29 -1
  146. data/config/routes.rb +35 -2
  147. data/lib/kit_cms.rb +7 -2
  148. data/lib/tasks/kit.rake +90 -2
  149. metadata +139 -27
  150. data/app/controllers/user/confirmations_controller.rb +0 -11
  151. data/app/controllers/user/passwords_controller.rb +0 -13
  152. data/app/controllers/user/registrations_controller.rb +0 -110
  153. data/app/controllers/user/sessions_controller.rb +0 -33
  154. data/app/controllers/user/unlocks_controller.rb +0 -13
  155. data/app/views/devise/_links.erb +0 -25
  156. data/app/views/devise/confirmations/new.html.erb +0 -12
  157. data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  158. data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
  159. data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
  160. data/app/views/devise/passwords/edit.html.erb +0 -16
  161. data/app/views/devise/passwords/new.html.erb +0 -12
  162. data/app/views/devise/registrations/edit.html.erb +0 -28
  163. data/app/views/devise/registrations/new.html.erb +0 -18
  164. data/app/views/devise/sessions/new.html.erb +0 -18
  165. data/app/views/devise/shared/_links.erb +0 -25
  166. data/app/views/devise/unlocks/new.html.erb +0 -12
  167. data/app/views/pages/links.html.erb +0 -8
  168. data/app/views/user/shared/_links.erb +0 -25
  169. data/config/initializers/devise.rb +0 -196
  170. data/config/initializers/devise_extender.rb +0 -39
@@ -1,11 +0,0 @@
1
- class User::ConfirmationsController < Devise::ConfirmationsController
2
- append_view_path Layout.resolver
3
- include DomainController
4
- include DeviseExtender
5
-
6
- before_filter :set_system
7
- before_filter { params[:user][:system_id] = _sids if params[:user]}
8
-
9
- layout "application"
10
-
11
- end
@@ -1,13 +0,0 @@
1
- class User::PasswordsController < Devise::PasswordsController
2
- append_view_path Layout.resolver
3
- include DomainController
4
- include DeviseExtender
5
-
6
- helper_method :stylesheets
7
-
8
- before_filter :set_system
9
- before_filter { params[:user][:system_id] = _sids if params[:user]}
10
-
11
- layout "application"
12
-
13
- end
@@ -1,110 +0,0 @@
1
- class User::RegistrationsController < Devise::RegistrationsController
2
- append_view_path Layout.resolver
3
- include DomainController
4
- include DeviseExtender
5
-
6
- before_filter :set_system
7
- before_filter { params[:user][:system_id] = _sids if params[:user]}
8
- before_filter :check_captcha, :only=>[:create]
9
- layout "application"
10
-
11
- def after_sign_up_path_for(resource)
12
- path = session[:return_to] || "/"
13
- session[:return_to] = nil
14
- return path.to_s
15
- end
16
-
17
- def create
18
- self.kit_template = "user/register"
19
- build_resource
20
- @attributes = UserAttribute.sys(_sid).where(:show_on_signup=>1).all
21
-
22
- if resource.save
23
- user = resource
24
- @attributes.each do |attr|
25
- if params[attr.code_name]
26
- uav = UserAttributeValue.new
27
- uav.user_attribute_id = attr.id
28
- uav.user = user
29
- uav.value = params[attr.code_name]
30
- uav.updated_by = current_user
31
- uav.system_id = _sid
32
- uav.save
33
- end
34
- end if @attributes
35
- if params[:groups]
36
- params[:groups].split(',').each do |gg|
37
- group = Group.find_sys_id(_sid, gg)
38
- user.groups << group
39
- end
40
- end
41
- resource.update_index
42
- if resource.active_for_authentication?
43
- set_flash_message :notice, :signed_up if is_navigational_format?
44
- sign_in(resource_name, resource)
45
- redirect_to after_sign_up_path_for(resource)
46
- else
47
- set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
48
- expire_session_data_after_sign_in!
49
- respond_with resource, :location => after_inactive_sign_up_path_for(resource)
50
- end
51
- else
52
- clean_up_passwords resource
53
- respond_with resource
54
- end
55
- end
56
-
57
- def new
58
- @page_title = "Sign Up"
59
- self.kit_template = "user/register"
60
-
61
- session[:captcha_okay] = true
62
- if params[:return_to]
63
- session[:return_to] = params[:return_to]
64
- elsif url = Preference.get_cached(_sid, "url_after_sign_up")
65
- session[:return_to] = url
66
- else
67
- session[:return_to] ||= request.referer
68
- end
69
-
70
- @attributes = UserAttribute.sys(_sid).where(:show_on_signup=>1).all
71
- super
72
- end
73
-
74
- def update
75
- @page_title = "Edit Account"
76
- self.kit_template = "user/edit"
77
- super
78
- end
79
-
80
- def edit
81
- @page_title = "Edit Account"
82
- self.kit_template = "user/edit"
83
- super
84
- end
85
-
86
- private
87
- def check_captcha
88
- if Preference.get(_sid, "use_captcha")=='true'
89
- unless captcha_okay?
90
- flash[:error] = "You didn't answer the 'Are you human?' question correctly"
91
- redirect_to request.referer
92
- return false
93
- end
94
- end
95
-
96
- return true
97
- end
98
-
99
- def captcha_okay?
100
- if session[:captcha_okay]==true || Form.validate_captcha_answer(params[:q_a], params[:q_q])
101
- session[:captcha_okay] = true
102
- return true
103
- else
104
- logger.info "*** ANTI SPAM: Failed captcha #{request.remote_ip} #{params[:controller]}##{params[:action]}"
105
- Event.store("captcha-failure", request, nil )
106
- return false
107
- end
108
- end
109
-
110
- end
@@ -1,33 +0,0 @@
1
- class User::SessionsController < Devise::SessionsController
2
- append_view_path Layout.resolver
3
- include DomainController
4
- include DeviseExtender
5
-
6
- before_filter :set_system
7
- before_filter { params[:user][:system_id] = _sids if params[:user]}
8
-
9
- helper_method :stylesheets
10
-
11
- layout "application"
12
-
13
- def after_sign_in_path_for(resource)
14
- path = session[:return_to] || "/"
15
- session[:return_to] = nil
16
- return path.to_s
17
- end
18
-
19
- def new
20
- @page_title = "Sign In"
21
- self.kit_template = "user/sign-in"
22
- if params[:return_to]
23
- session[:return_to] = params[:return_to]
24
- elsif url = Preference.get_cached(_sid, "url_after_sign_up")
25
- session[:return_to] = url
26
- else
27
- session[:return_to] ||= request.referer
28
- end
29
-
30
- super
31
- end
32
-
33
- end
@@ -1,13 +0,0 @@
1
- class User::UnlocksController < Devise::UnlocksController
2
- append_view_path Layout.resolver
3
- include DomainController
4
- include DeviseExtender
5
-
6
- helper_method :stylesheets
7
-
8
- before_filter :set_system
9
- before_filter { params[:user][:system_id] = _sids if params[:user]}
10
-
11
- layout "application"
12
-
13
- end
@@ -1,25 +0,0 @@
1
- <%- if controller_name != 'sessions' %>
2
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
3
- <% end -%>
4
-
5
- <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
- <% end -%>
8
-
9
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
- <% end -%>
12
-
13
- <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
- <% end -%>
16
-
17
- <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
- <% end -%>
20
-
21
- <%- if devise_mapping.omniauthable? %>
22
- <%- resource_class.omniauth_providers.each do |provider| %>
23
- <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
24
- <% end -%>
25
- <% end -%>
@@ -1,12 +0,0 @@
1
- <h2>Resend confirmation instructions</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= devise_error_messages! %>
5
-
6
- <div><%= f.label :email %><br />
7
- <%= f.email_field :email %></div>
8
-
9
- <div><%= f.submit "Resend confirmation instructions" %></div>
10
- <% end %>
11
-
12
- <%= render "links" %>
@@ -1,5 +0,0 @@
1
- <p>Welcome <%= @resource.email %>!</p>
2
-
3
- <p>You can confirm your account email through the link below:</p>
4
-
5
- <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -1,8 +0,0 @@
1
- <p>Hello <%= @resource.email %>!</p>
2
-
3
- <p>Someone has requested a link to change your password, and you can do this through the link below.</p>
4
-
5
- <p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
6
-
7
- <p>If you didn't request this, please ignore this email.</p>
8
- <p>Your password won't change until you access the link above and create a new one.</p>
@@ -1,7 +0,0 @@
1
- <p>Hello <%= @resource.email %>!</p>
2
-
3
- <p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
4
-
5
- <p>Click the link below to unlock your account:</p>
6
-
7
- <p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
@@ -1,16 +0,0 @@
1
- <h2>Change your password</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
4
- <%= devise_error_messages! %>
5
- <%= f.hidden_field :reset_password_token %>
6
-
7
- <div><%= f.label :password, "New password" %><br />
8
- <%= f.password_field :password %></div>
9
-
10
- <div><%= f.label :password_confirmation, "Confirm new password" %><br />
11
- <%= f.password_field :password_confirmation %></div>
12
-
13
- <div><%= f.submit "Change my password" %></div>
14
- <% end %>
15
-
16
- <%= render "links" %>
@@ -1,12 +0,0 @@
1
- <h2>Forgot your password?</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= devise_error_messages! %>
5
-
6
- <div><%= f.label :email %><br />
7
- <%= f.email_field :email %></div>
8
-
9
- <div><%= f.submit "Send me reset password instructions" %></div>
10
- <% end %>
11
-
12
- <%= render "links" %>
@@ -1,28 +0,0 @@
1
- <div id="edit_account">
2
- <h2>Edit <%= resource_name.to_s.humanize %></h2>
3
-
4
- <%= link_to "Edit Profile", "/user/profile" %>
5
- <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
6
- <%= devise_error_messages! %>
7
-
8
- <div><%= f.label :email %><br />
9
- <%= f.email_field :email %></div>
10
-
11
- <div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
12
- <%= f.password_field :password, :autocomplete => "off" %></div>
13
-
14
- <div><%= f.label :password_confirmation %><br />
15
- <%= f.password_field :password_confirmation %></div>
16
-
17
- <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
18
- <%= f.password_field :current_password %></div>
19
-
20
- <div><%= f.submit "Update" %></div>
21
- <% end %>
22
-
23
-
24
- <p><%= link_to "Log Out", "/users/sign_out" %></p>
25
-
26
- <p class="link_back"> <%= link_to "Back", :back %></p>
27
-
28
- </div>
@@ -1,18 +0,0 @@
1
- <h2>Sign up</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4
- <%= devise_error_messages! %>
5
-
6
- <div><%= f.label :email %>
7
- <%= f.email_field :email %></div>
8
-
9
- <div><%= f.label :password %>
10
- <%= f.password_field :password %></div>
11
-
12
- <div><%= f.label :password_confirmation %>
13
- <%= f.password_field :password_confirmation %></div>
14
-
15
- <div><%= f.submit "Sign up" %></div>
16
- <% end %>
17
-
18
- <%= render "links" %>
@@ -1,18 +0,0 @@
1
- <h2>Sign in</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
4
-
5
- <div><%= f.label :email %>xx
6
- <%= f.email_field :email %></div>
7
-
8
- <div><%= f.label :password %>
9
- <%= f.password_field :password %></div>
10
-
11
- <% if devise_mapping.rememberable? -%>
12
- <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
13
- <% end -%>
14
-
15
- <div><%= f.submit "Sign in" %></div>
16
- <% end %>
17
-
18
- <%= render "links" %>
@@ -1,25 +0,0 @@
1
- <%- if controller_name != 'sessions' %>
2
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
3
- <% end -%>
4
-
5
- <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
- <% end -%>
8
-
9
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
- <% end -%>
12
-
13
- <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
- <% end -%>
16
-
17
- <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
- <% end -%>
20
-
21
- <%- if devise_mapping.omniauthable? %>
22
- <%- resource_class.omniauth_providers.each do |provider| %>
23
- <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
24
- <% end -%>
25
- <% end -%>
@@ -1,12 +0,0 @@
1
- <h2>Resend unlock instructions</h2>
2
-
3
- <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
4
- <%= devise_error_messages! %>
5
-
6
- <div><%= f.label :email %><br />
7
- <%= f.email_field :email %></div>
8
-
9
- <div><%= f.submit "Resend unlock instructions" %></div>
10
- <% end %>
11
-
12
- <%= render "links" %>
@@ -1,8 +0,0 @@
1
- <% content_for :main do %>
2
- <ul>
3
- <li><%= link_to "Sign In", "/users/sign_in" %></li>
4
- <li><%= link_to "Sign Out", "/users/sign_out" %></li>
5
- <li><%= link_to "Edit User", "/users/edit" %></li>
6
- <li><%= link_to "Dashboard", "/db" %></li>
7
- </ul>
8
- <% end %>
@@ -1,25 +0,0 @@
1
- <%- if controller_name != 'sessions' %>
2
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
3
- <% end -%>
4
-
5
- <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
- <% end -%>
8
-
9
- <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
- <% end -%>
12
-
13
- <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
- <% end -%>
16
-
17
- <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
- <% end -%>
20
-
21
- <%- if devise_mapping.omniauthable? %>
22
- <%- resource_class.omniauth_providers.each do |provider| %>
23
- <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
24
- <% end -%>
25
- <% end -%>
@@ -1,196 +0,0 @@
1
- require "digest/sha1"
2
-
3
-
4
- # Use this hook to configure devise mailer, warden hooks and so forth. The first
5
- # four configuration values can also be set straight in your models.
6
- Devise.setup do |config|
7
- # ==> Mailer Configuration
8
- # Configure the e-mail address which will be shown in DeviseMailer.
9
- config.mailer_sender = Preference.get_cached(1, "notifications_from") rescue ''
10
-
11
- # Configure the class responsible to send e-mails.
12
- # config.mailer = "Devise::Mailer"
13
-
14
- # ==> ORM configuration
15
- # Load and configure the ORM. Supports :active_record (default) and
16
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
17
- # available as additional gems.
18
- require 'devise/orm/active_record'
19
-
20
- # ==> Configuration for any authentication mechanism
21
- # Configure which keys are used when authenticating a user. The default is
22
- # just :email. You can configure it to use [:username, :subdomain], so for
23
- # authenticating a user, both parameters are required. Remember that those
24
- # parameters are used only when authenticating and not when retrieving from
25
- # session. If you need permissions, you should implement that in a before filter.
26
- # You can also supply a hash where the value is a boolean determining whether
27
- # or not authentication should be aborted when the value is not present.
28
- # config.authentication_keys = [ :email ]
29
-
30
- # Configure parameters from the request object used for authentication. Each entry
31
- # given should be a request method and it will automatically be passed to the
32
- # find_for_authentication method and considered in your model lookup. For instance,
33
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
34
- # The same considerations mentioned for authentication_keys also apply to request_keys.
35
- # config.request_keys = []
36
-
37
- # Configure which authentication keys should be case-insensitive.
38
- # These keys will be downcased upon creating or modifying a user and when used
39
- # to authenticate or find a user. Default is :email.
40
- config.case_insensitive_keys = [ :system_id, :email ]
41
-
42
- # Tell if authentication through request.params is enabled. True by default.
43
- # config.params_authenticatable = true
44
-
45
- # Tell if authentication through HTTP Basic Auth is enabled. False by default.
46
- # config.http_authenticatable = false
47
-
48
- # If http headers should be returned for AJAX requests. True by default.
49
- # config.http_authenticatable_on_xhr = true
50
-
51
- # The realm used in Http Basic Authentication. "Application" by default.
52
- # config.http_authentication_realm = "Application"
53
-
54
- # ==> Configuration for :database_authenticatable
55
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
56
- # using other encryptors, it sets how many times you want the password re-encrypted.
57
- config.stretches = 1
58
-
59
- # Setup a pepper to generate the encrypted password.
60
- # config.pepper = "c4bf2c9dfeb6364353947268facdec91fb0f3c00f977297226eee1b6428c8767f324a091bb45347fb6c6302bd1e04ec11eb0f02bd7240c89b6cf9badf7151e5d"
61
- #
62
- config.pepper = ''
63
-
64
- # ==> Configuration for :confirmable
65
- # The time you want to give your user to confirm his account. During this time
66
- # he will be able to access your application without confirming. Default is 0.days
67
- # When confirm_within is zero, the user won't be able to sign in without confirming.
68
- # You can use this to let your user access some features of your application
69
- # without confirming the account, but blocking it after a certain period
70
- # (ie 2 days).
71
- # config.confirm_within = 2.days
72
-
73
- # Defines which key will be used when confirming an account
74
- # config.confirmation_keys = [ :email ]
75
-
76
- # ==> Configuration for :rememberable
77
- # The time the user will be remembered without asking for credentials again.
78
- config.remember_for = 2.weeks
79
-
80
- # If true, a valid remember token can be re-used between multiple browsers.
81
- # config.remember_across_browsers = true
82
-
83
- # If true, extends the user's remember period when remembered via cookie.
84
- # config.extend_remember_period = false
85
-
86
- # Options to be passed to the created cookie. For instance, you can set
87
- # :secure => true in order to force SSL only cookies.
88
- # config.cookie_options = {}
89
-
90
- # ==> Configuration for :validatable
91
- # Range for password length. Default is 6..128.
92
- # config.password_length = 6..128
93
-
94
- # Regex to use to validate the email address
95
- # config.email_regexp = /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i
96
-
97
- # ==> Configuration for :timeoutable
98
- # The time you want to timeout the user session without activity. After this
99
- # time the user will be asked for credentials again. Default is 30 minutes.
100
- # config.timeout_in = 30.minutes
101
-
102
- # ==> Configuration for :lockable
103
- # Defines which strategy will be used to lock an account.
104
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
105
- # :none = No lock strategy. You should handle locking by yourself.
106
- config.lock_strategy = :failed_attempts
107
-
108
- # Defines which key will be used when locking and unlocking an account
109
- # config.unlock_keys = [ :email ]
110
-
111
- # Defines which strategy will be used to unlock an account.
112
- # :email = Sends an unlock link to the user email
113
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
114
- # :both = Enables both strategies
115
- # :none = No unlock strategy. You should handle unlocking by yourself.
116
- config.unlock_strategy = :time
117
-
118
- # Number of authentication tries before locking an account if lock_strategy
119
- # is failed attempts.
120
- config.maximum_attempts = 10
121
-
122
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
123
- config.unlock_in = 1.hour
124
-
125
- # ==> Configuration for :recoverable
126
- #
127
- # Defines which key will be used when recovering the password for an account
128
- # config.reset_password_keys = [ :email ]
129
-
130
- # Time interval you can reset your password with a reset password key.
131
- # Don't put a too small interval or your users won't have the time to
132
- # change their passwords.
133
- config.reset_password_within = 24.hours
134
-
135
- # ==> Configuration for :encryptable
136
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
137
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
138
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
139
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
140
- # REST_AUTH_SITE_KEY to pepper)
141
- # config.encryptor = :sha512
142
- config.encryptor = :resftul_authentication_sha1
143
-
144
- # ==> Configuration for :token_authenticatable
145
- # Defines name of the authentication token params key
146
- # config.token_authentication_key = :auth_token
147
-
148
- # If true, authentication through token does not store user in session and needs
149
- # to be supplied on each request. Useful if you are using the token as API token.
150
- # config.stateless_token = false
151
-
152
- # ==> Scopes configuration
153
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
154
- # "users/sessions/new". It's turned off by default because it's slower if you
155
- # are using only default views.
156
- # config.scoped_views = false
157
-
158
- # Configure the default scope given to Warden. By default it's the first
159
- # devise role declared in your routes (usually :user).
160
- # config.default_scope = :user
161
-
162
- # Configure sign_out behavior.
163
- # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
164
- # The default is true, which means any logout action will sign out all active scopes.
165
- # config.sign_out_all_scopes = true
166
-
167
- # ==> Navigation configuration
168
- # Lists the formats that should be treated as navigational. Formats like
169
- # :html, should redirect to the sign in page when the user does not have
170
- # access, but formats like :xml or :json, should return 401.
171
- #
172
- # If you have any extra navigational formats, like :iphone or :mobile, you
173
- # should add them to the navigational formats lists.
174
- #
175
- # The :"*/*" and "*/*" formats below is required to match Internet
176
- # Explorer requests.
177
- # config.navigational_formats = [:"*/*", "*/*", :html]
178
-
179
- # The default HTTP method used to sign out a resource. Default is :get.
180
- # config.sign_out_via = :get
181
-
182
- # ==> OmniAuth
183
- # Add a new OmniAuth provider. Check the wiki for more information on setting
184
- # up on your models and hooks.
185
- # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
186
-
187
- # ==> Warden configuration
188
- # If you want to use other strategies, that are not supported by Devise, or
189
- # change the failure app, you can configure them inside the config.warden block.
190
- #
191
- # config.warden do |manager|
192
- # manager.failure_app = AnotherApp
193
- # manager.intercept_401 = false
194
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
195
- # end
196
- end