oxen_account 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.envrc +0 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +6 -0
- data/Guardfile +77 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +10 -0
- data/app/controllers/accounts_controller.rb +90 -0
- data/app/controllers/users/base/invitations_controller.rb +61 -0
- data/app/controllers/users/base/users_controller.rb +68 -0
- data/app/helpers/accounts_helper.rb +7 -0
- data/app/models/account.rb +8 -0
- data/app/models/user.rb +18 -0
- data/app/policies/account_policy.rb +43 -0
- data/app/policies/user_policy.rb +35 -0
- data/app/views/accounts/_form.html.haml +32 -0
- data/app/views/accounts/index.html.haml +37 -0
- data/app/views/accounts/index.json.jbuilder +4 -0
- data/app/views/accounts/show.html.haml +16 -0
- data/app/views/accounts/show.json.jbuilder +1 -0
- data/app/views/devise/confirmations/new.html.haml +13 -0
- data/app/views/devise/mailer/invitation_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.haml +21 -0
- data/app/views/devise/passwords/new.html.haml +10 -0
- data/app/views/devise/registrations/edit.html.haml +51 -0
- data/app/views/devise/registrations/new.html.haml +32 -0
- data/app/views/devise/sessions/new.html.haml +25 -0
- data/app/views/devise/shared/_links.html.haml +24 -0
- data/app/views/devise/unlocks/new.html.haml +13 -0
- data/app/views/users/_account_user.html.haml +6 -0
- data/app/views/users/_account_users.html.haml +13 -0
- data/app/views/users/_form.html.haml +50 -0
- data/app/views/users/_user.html.erb +12 -0
- data/app/views/users/index.html.haml +43 -0
- data/app/views/users/invitations/_new.html.haml +37 -0
- data/app/views/users/invitations/create.html.haml +21 -0
- data/app/views/users/invitations/edit.html.haml +22 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/config/initializers/devise.rb +303 -0
- data/config/initializers/devise_permitted_parameters.rb +17 -0
- data/config/locales/devise.da.yml +58 -0
- data/config/locales/devise.en.yml +61 -0
- data/config/locales/devise_invitable.da.yml +26 -0
- data/config/locales/devise_invitable.en.yml +23 -0
- data/config/routes.rb +8 -0
- data/lib/generators/oxen_account/account_generator.rb +26 -0
- data/lib/generators/oxen_account/templates/account.rb +10 -0
- data/lib/generators/oxen_account/templates/user_permission.rb +14 -0
- data/lib/oxen_account/engine.rb +17 -0
- data/lib/oxen_account/version.rb +3 -0
- data/lib/oxen_account.rb +7 -0
- data/oxen_account.gemspec +55 -0
- metadata +381 -0
@@ -0,0 +1,303 @@
|
|
1
|
+
require 'devise'
|
2
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
3
|
+
# Many of these configuration options can be set straight in your model.
|
4
|
+
Devise.setup do |config|
|
5
|
+
# The secret key used by Devise. Devise uses this key to generate
|
6
|
+
# random tokens. Changing this key will render invalid all existing
|
7
|
+
# confirmation, reset password and unlock tokens in the database.
|
8
|
+
# config.secret_key = '9443b88a35d00851d85f3d87bd8ba61298bf0ccb57b1971589140626f5a9da4351e8214811da0002f212e3bc107650e06c5097e63da74e6ffa092bc4a54a3f2e'
|
9
|
+
|
10
|
+
# ==> Mailer Configuration
|
11
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
12
|
+
# note that it will be overwritten if you use your own mailer class
|
13
|
+
# with default "from" parameter.
|
14
|
+
config.mailer_sender = 'no-reply@' + Rails.application.secrets.domain_name
|
15
|
+
|
16
|
+
# Configure the class responsible to send e-mails.
|
17
|
+
# config.mailer = 'Devise::Mailer'
|
18
|
+
|
19
|
+
# ==> ORM configuration
|
20
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
21
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
22
|
+
# available as additional gems.
|
23
|
+
require 'devise/orm/active_record'
|
24
|
+
|
25
|
+
# ==> Configuration for any authentication mechanism
|
26
|
+
# Configure which keys are used when authenticating a user. The default is
|
27
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
28
|
+
# authenticating a user, both parameters are required. Remember that those
|
29
|
+
# parameters are used only when authenticating and not when retrieving from
|
30
|
+
# session. If you need permissions, you should implement that in a before filter.
|
31
|
+
# You can also supply a hash where the value is a boolean determining whether
|
32
|
+
# or not authentication should be aborted when the value is not present.
|
33
|
+
# config.authentication_keys = [ :email ]
|
34
|
+
|
35
|
+
# Configure parameters from the request object used for authentication. Each entry
|
36
|
+
# given should be a request method and it will automatically be passed to the
|
37
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
38
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
39
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
40
|
+
# config.request_keys = []
|
41
|
+
|
42
|
+
# Configure which authentication keys should be case-insensitive.
|
43
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
44
|
+
# to authenticate or find a user. Default is :email.
|
45
|
+
config.case_insensitive_keys = [ :email ]
|
46
|
+
|
47
|
+
# Configure which authentication keys should have whitespace stripped.
|
48
|
+
# These keys will have whitespace before and after removed upon creating or
|
49
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
50
|
+
config.strip_whitespace_keys = [ :email ]
|
51
|
+
|
52
|
+
# Tell if authentication through request.params is enabled. True by default.
|
53
|
+
# It can be set to an array that will enable params authentication only for the
|
54
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
55
|
+
# enable it only for database (email + password) authentication.
|
56
|
+
# config.params_authenticatable = true
|
57
|
+
|
58
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
59
|
+
# It can be set to an array that will enable http authentication only for the
|
60
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
61
|
+
# enable it only for database authentication. The supported strategies are:
|
62
|
+
# :database = Support basic authentication with authentication key + password
|
63
|
+
# config.http_authenticatable = false
|
64
|
+
|
65
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
66
|
+
# config.http_authenticatable_on_xhr = true
|
67
|
+
|
68
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
69
|
+
# config.http_authentication_realm = 'Application'
|
70
|
+
|
71
|
+
# It will change confirmation, password recovery and other workflows
|
72
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
73
|
+
# Does not affect registerable.
|
74
|
+
# config.paranoid = true
|
75
|
+
|
76
|
+
# By default Devise will store the user in session. You can skip storage for
|
77
|
+
# particular strategies by setting this option.
|
78
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
79
|
+
# may want to disable generating routes to Devise's sessions controller by
|
80
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
81
|
+
config.skip_session_storage = [:http_auth]
|
82
|
+
|
83
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
84
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
85
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
86
|
+
# from the server. You can disable this option at your own risk.
|
87
|
+
# config.clean_up_csrf_token_on_authentication = true
|
88
|
+
|
89
|
+
# ==> Configuration for :database_authenticatable
|
90
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
91
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
92
|
+
#
|
93
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
94
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
95
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
96
|
+
# encryptor), the cost increases exponentially with the number of stretches (e.g.
|
97
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
98
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
99
|
+
|
100
|
+
# Setup a pepper to generate the encrypted password.
|
101
|
+
# config.pepper = '0070067faf6611d9d72133ff9b9a50d9142b12bdb0d4620f69e4bc68f9ec44384727587d593285397bd083e97da1e830c9e464e33ec811e7e3a77c111780b1e5'
|
102
|
+
|
103
|
+
# ==> Configuration for :invitable
|
104
|
+
# The period the generated invitation token is valid, after
|
105
|
+
# this period, the invited resource won't be able to accept the invitation.
|
106
|
+
# When invite_for is 0 (the default), the invitation won't expire.
|
107
|
+
# config.invite_for = 2.weeks
|
108
|
+
|
109
|
+
# Number of invitations users can send.
|
110
|
+
# - If invitation_limit is nil, there is no limit for invitations, users can
|
111
|
+
# send unlimited invitations, invitation_limit column is not used.
|
112
|
+
# - If invitation_limit is 0, users can't send invitations by default.
|
113
|
+
# - If invitation_limit n > 0, users can send n invitations.
|
114
|
+
# You can change invitation_limit column for some users so they can send more
|
115
|
+
# or less invitations, even with global invitation_limit = 0
|
116
|
+
# Default: nil
|
117
|
+
# config.invitation_limit = 5
|
118
|
+
|
119
|
+
# The key to be used to check existing users when sending an invitation
|
120
|
+
# and the regexp used to test it when validate_on_invite is not set.
|
121
|
+
# config.invite_key = {:email => /\A[^@]+@[^@]+\z/}
|
122
|
+
# config.invite_key = {:email => /\A[^@]+@[^@]+\z/, :username => nil}
|
123
|
+
|
124
|
+
# Flag that force a record to be valid before being actually invited
|
125
|
+
# Default: false
|
126
|
+
# config.validate_on_invite = true
|
127
|
+
|
128
|
+
# Resend invitation if user with invited status is invited again
|
129
|
+
# Default: true
|
130
|
+
# config.resend_invitation = false
|
131
|
+
|
132
|
+
# The class name of the inviting model. If this is nil,
|
133
|
+
# the #invited_by association is declared to be polymorphic.
|
134
|
+
# Default: nil
|
135
|
+
# config.invited_by_class_name = 'User'
|
136
|
+
|
137
|
+
# The column name used for counter_cache column. If this is nil,
|
138
|
+
# the #invited_by association is declared without counter_cache.
|
139
|
+
# Default: nil
|
140
|
+
# config.invited_by_counter_cache = :invitations_count
|
141
|
+
|
142
|
+
# ==> Configuration for :confirmable
|
143
|
+
# A period that the user is allowed to access the website even without
|
144
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
145
|
+
# able to access the website for two days without confirming their account,
|
146
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
147
|
+
# the user cannot access the website without confirming their account.
|
148
|
+
# config.allow_unconfirmed_access_for = 2.days
|
149
|
+
|
150
|
+
# A period that the user is allowed to confirm their account before their
|
151
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
152
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
153
|
+
# their account can't be confirmed with the token any more.
|
154
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
155
|
+
# before confirming their account.
|
156
|
+
# config.confirm_within = 3.days
|
157
|
+
|
158
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
159
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
160
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
161
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
162
|
+
config.reconfirmable = true
|
163
|
+
|
164
|
+
# Defines which key will be used when confirming an account
|
165
|
+
# config.confirmation_keys = [ :email ]
|
166
|
+
|
167
|
+
# ==> Configuration for :rememberable
|
168
|
+
# The time the user will be remembered without asking for credentials again.
|
169
|
+
# config.remember_for = 2.weeks
|
170
|
+
|
171
|
+
# Invalidates all the remember me tokens when the user signs out.
|
172
|
+
config.expire_all_remember_me_on_sign_out = true
|
173
|
+
|
174
|
+
# If true, extends the user's remember period when remembered via cookie.
|
175
|
+
# config.extend_remember_period = false
|
176
|
+
|
177
|
+
# Options to be passed to the created cookie. For instance, you can set
|
178
|
+
# secure: true in order to force SSL only cookies.
|
179
|
+
# config.rememberable_options = {}
|
180
|
+
|
181
|
+
# ==> Configuration for :validatable
|
182
|
+
# Range for password length.
|
183
|
+
config.password_length = 8..128
|
184
|
+
|
185
|
+
#
|
186
|
+
# zxcvbnable provides strength
|
187
|
+
config.min_password_score = 0
|
188
|
+
|
189
|
+
# Email regex used to validate email formats. It simply asserts that
|
190
|
+
# one (and only one) @ exists in the given string. This is mainly
|
191
|
+
# to give user feedback and not to assert the e-mail validity.
|
192
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
193
|
+
|
194
|
+
# ==> Configuration for :timeoutable
|
195
|
+
# The time you want to timeout the user session without activity. After this
|
196
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
197
|
+
# config.timeout_in = 30.minutes
|
198
|
+
|
199
|
+
# If true, expires auth token on session timeout.
|
200
|
+
# config.expire_auth_token_on_timeout = false
|
201
|
+
|
202
|
+
# ==> Configuration for :lockable
|
203
|
+
# Defines which strategy will be used to lock an account.
|
204
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
205
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
206
|
+
# config.lock_strategy = :failed_attempts
|
207
|
+
|
208
|
+
# Defines which key will be used when locking and unlocking an account
|
209
|
+
# config.unlock_keys = [ :email ]
|
210
|
+
|
211
|
+
# Defines which strategy will be used to unlock an account.
|
212
|
+
# :email = Sends an unlock link to the user email
|
213
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
214
|
+
# :both = Enables both strategies
|
215
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
216
|
+
# config.unlock_strategy = :both
|
217
|
+
|
218
|
+
# Number of authentication tries before locking an account if lock_strategy
|
219
|
+
# is failed attempts.
|
220
|
+
# config.maximum_attempts = 20
|
221
|
+
|
222
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
223
|
+
# config.unlock_in = 1.hour
|
224
|
+
|
225
|
+
# Warn on the last attempt before the account is locked.
|
226
|
+
# config.last_attempt_warning = true
|
227
|
+
|
228
|
+
# ==> Configuration for :recoverable
|
229
|
+
#
|
230
|
+
# Defines which key will be used when recovering the password for an account
|
231
|
+
# config.reset_password_keys = [ :email ]
|
232
|
+
|
233
|
+
# Time interval you can reset your password with a reset password key.
|
234
|
+
# Don't put a too small interval or your users won't have the time to
|
235
|
+
# change their passwords.
|
236
|
+
config.reset_password_within = 6.hours
|
237
|
+
|
238
|
+
# ==> Configuration for :encryptable
|
239
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
240
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
241
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
242
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
243
|
+
# REST_AUTH_SITE_KEY to pepper).
|
244
|
+
#
|
245
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
246
|
+
# config.encryptor = :sha512
|
247
|
+
|
248
|
+
# ==> Scopes configuration
|
249
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
250
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
251
|
+
# are using only default views.
|
252
|
+
# config.scoped_views = false
|
253
|
+
|
254
|
+
# Configure the default scope given to Warden. By default it's the first
|
255
|
+
# devise role declared in your routes (usually :user).
|
256
|
+
# config.default_scope = :user
|
257
|
+
|
258
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
259
|
+
# only the current scope. By default, Devise signs out all scopes.
|
260
|
+
# config.sign_out_all_scopes = true
|
261
|
+
|
262
|
+
# ==> Navigation configuration
|
263
|
+
# Lists the formats that should be treated as navigational. Formats like
|
264
|
+
# :html, should redirect to the sign in page when the user does not have
|
265
|
+
# access, but formats like :xml or :json, should return 401.
|
266
|
+
#
|
267
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
268
|
+
# should add them to the navigational formats lists.
|
269
|
+
#
|
270
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
271
|
+
# config.navigational_formats = ['*/*', :html]
|
272
|
+
|
273
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
274
|
+
config.sign_out_via = :delete
|
275
|
+
|
276
|
+
# ==> OmniAuth
|
277
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
278
|
+
# up on your models and hooks.
|
279
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
280
|
+
|
281
|
+
# ==> Warden configuration
|
282
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
283
|
+
# change the failure app, you can configure them inside the config.warden block.
|
284
|
+
#
|
285
|
+
# config.warden do |manager|
|
286
|
+
# manager.intercept_401 = false
|
287
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
288
|
+
# end
|
289
|
+
|
290
|
+
# ==> Mountable engine configurations
|
291
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
292
|
+
# is mountable, there are some extra configurations to be taken into account.
|
293
|
+
# The following options are available, assuming the engine is mounted as:
|
294
|
+
#
|
295
|
+
# mount MyEngine, at: '/my_engine'
|
296
|
+
#
|
297
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
298
|
+
# config.router_name = :my_engine
|
299
|
+
#
|
300
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
301
|
+
# so you need to do it manually. For the users scope, it would be:
|
302
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
303
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# module DevisePermittedParameters
|
2
|
+
# extend ActiveSupport::Concern
|
3
|
+
#
|
4
|
+
# included do
|
5
|
+
# before_filter :configure_permitted_parameters
|
6
|
+
# end
|
7
|
+
#
|
8
|
+
# protected
|
9
|
+
#
|
10
|
+
# def configure_permitted_parameters
|
11
|
+
# devise_parameter_sanitizer.for(:sign_up) << :name
|
12
|
+
# devise_parameter_sanitizer.for(:account_update) << :name
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# DeviseController.send :include, DevisePermittedParameters
|
@@ -0,0 +1,58 @@
|
|
1
|
+
da:
|
2
|
+
devise:
|
3
|
+
confirmations:
|
4
|
+
confirmed: "Din konto er blevet bekræftet."
|
5
|
+
send_instructions: "Om få minutter vil du modtage en email med instruktioner om aktivering af din konto."
|
6
|
+
send_paranoid_instructions: "Hvis din e-mail adresse findes i vores database vil du modtage en e-mail med instruktioner om hvordan du kan aktivere din konto."
|
7
|
+
failure:
|
8
|
+
already_authenticated: "Du er allerede logget ind."
|
9
|
+
inactive: "Din konto er ikke bekræftet."
|
10
|
+
invalid: "Email eller password er ikke gyldig."
|
11
|
+
locked: "Din konto er låst."
|
12
|
+
last_attempt: "Du har et mere forsøg inden din konto vil blive låst."
|
13
|
+
not_found_in_database: "Email eller password er ikke gyldig."
|
14
|
+
timeout: "Din session er udløbet. Log ind igen for at kunne fortsætte."
|
15
|
+
unauthenticated: "Du skal logge ind for at kunne fortsætte."
|
16
|
+
unconfirmed: "Du skal bekræfte din konto for at kunne fortsætte."
|
17
|
+
mailer:
|
18
|
+
confirmation_instructions:
|
19
|
+
subject: "Bekræft din konto"
|
20
|
+
reset_password_instructions:
|
21
|
+
subject: "Nulstilling af password"
|
22
|
+
unlock_instructions:
|
23
|
+
subject: "Genåbning af konto"
|
24
|
+
omniauth_callbacks:
|
25
|
+
failure: "Du kunne ikke logges ind med din %{kind} konto: \"%{reason}\"."
|
26
|
+
success: "Du er nu logget ind med din %{kind} konto."
|
27
|
+
passwords:
|
28
|
+
no_token: "Du har kun adgang til denne side via link fra en email ang. nulstilling af password. Hvis du kommer fra denne email skal du sikre dig at du bruge hele URL'en."
|
29
|
+
send_instructions: "Du vil om et øjeblik modtage en email vedrørende nulstilling af password."
|
30
|
+
send_paranoid_instructions: "Hvis din e-mail adresse findes i vores database vil du modtage et link til hvor du kan nulstille dit password."
|
31
|
+
updated: "Dit password er ændret og du er nu logget ind."
|
32
|
+
updated_not_active: "Dit password er ændret."
|
33
|
+
registrations:
|
34
|
+
destroyed: "Farvel. Din konto er nu lukket."
|
35
|
+
signed_up: "Din registrering er godkendt."
|
36
|
+
signed_up_but_inactive: "Din registrering er godkendt, men vi kunne ikke logge dig ind, da din konto endnu ikke er blevet aktiveret."
|
37
|
+
signed_up_but_locked: "Din registrering er godkendt, men vi kunne ikke logge dig ind, da din konto er låst."
|
38
|
+
signed_up_but_unconfirmed: "En besked med bekræftelses link er blevet sendt til din email adresse. Åbn venligst linket for at aktivere din konto."
|
39
|
+
update_needs_confirmation: "Din konto er blevet opdateret, men vi er nødt til at bekræfte din nye email. Check venligst din mail og klik på bekræftelses linket for at bekræfte din nye email."
|
40
|
+
updated: "Din konto er opdateret."
|
41
|
+
sessions:
|
42
|
+
signed_in: "Du er nu logget ind."
|
43
|
+
signed_out: "Du er nu logget ud."
|
44
|
+
unlocks:
|
45
|
+
send_instructions: 'Om få minutter vil du modtage en email med instruktioner om genåbning af din konto.'
|
46
|
+
send_paranoid_instructions: 'Hvis din e-mail adresse findes i vores database vil du modtage in e-mail med instutioner om hvordan du kan låse din konto op.'
|
47
|
+
unlocked: 'Din konto er genåbnet og du er nu logget ind.'
|
48
|
+
errors:
|
49
|
+
messages:
|
50
|
+
weak_password: "er ikke stærk nok! Overvej at tilføje et ciffer, et symbol - eller flere bogstaver for at hærde det!"
|
51
|
+
already_confirmed: "er allerede bekræftet"
|
52
|
+
confirmation_period_expired: "skal bekræftes inden %{period}, anmod venligst om en ny"
|
53
|
+
expired: "er udløbet. Vær venlig at bede om en ny"
|
54
|
+
not_found: "ikke fundet"
|
55
|
+
not_locked: "var ikke låst"
|
56
|
+
not_saved:
|
57
|
+
one: "1 fejl medførte at denne %{resource} ikke kunne gemmes:"
|
58
|
+
other: "%{count} fejl medførte at denne %{resource} ikke kunne gemmes:"
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
omniauth_callbacks:
|
27
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
28
|
+
success: "Successfully authenticated from %{kind} account."
|
29
|
+
passwords:
|
30
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
31
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
32
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
33
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
34
|
+
updated_not_active: "Your password has been changed successfully."
|
35
|
+
registrations:
|
36
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
37
|
+
signed_up: "Welcome! You have signed up successfully."
|
38
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
39
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
40
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
41
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
42
|
+
updated: "Your account has been updated successfully."
|
43
|
+
sessions:
|
44
|
+
signed_in: "Signed in successfully."
|
45
|
+
signed_out: "Signed out successfully."
|
46
|
+
already_signed_out: "Signed out successfully."
|
47
|
+
unlocks:
|
48
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
49
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
50
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
51
|
+
errors:
|
52
|
+
messages:
|
53
|
+
weak_password: "is not strong enough. Consider adding a number, symbols or more letters to make it stronger."
|
54
|
+
already_confirmed: "was already confirmed, please try signing in"
|
55
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
56
|
+
expired: "has expired, please request a new one"
|
57
|
+
not_found: "not found"
|
58
|
+
not_locked: "was not locked"
|
59
|
+
not_saved:
|
60
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
61
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
da:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "Du mangler at acceptere din invitation! Se den i din indbakke"
|
5
|
+
missing_data: "Du skal udfylde navn og email med korrekte oplysninger!"
|
6
|
+
invitations:
|
7
|
+
send_instructions: "En email med en invitation til at logge på er blevet sendt til %{email}."
|
8
|
+
invitation_token_invalid: "Du har anvendt en invitation som ikke er gyldig!"
|
9
|
+
updated: "Din adgangskode blev gemt korrekt! Du er nu logget ind!"
|
10
|
+
no_invitations_remaining: "No invitations remaining"
|
11
|
+
invitation_removed: "Your invitation was removed."
|
12
|
+
new:
|
13
|
+
header: "Send invitation"
|
14
|
+
submit_button: "Send an invitation"
|
15
|
+
edit:
|
16
|
+
title: "Invitation"
|
17
|
+
header: "Herligt at du tog imod invitationen!"
|
18
|
+
instructions: 'Nu mangler du bare at vælge en adgangskode for at du er igang!'
|
19
|
+
submit_button: "Gem"
|
20
|
+
mailer:
|
21
|
+
invitation_instructions:
|
22
|
+
subject: "Invitation instructions"
|
23
|
+
hello: "Hello %{email}"
|
24
|
+
someone_invited_you: "Someone has invited you to %{url}, you can accept it through the link below."
|
25
|
+
accept: "Accept invitation"
|
26
|
+
ignore: "If you don't want to accept the invitation, please ignore this email.<br />Your account won't be created until you access the link above and set your password."
|
@@ -0,0 +1,23 @@
|
|
1
|
+
en:
|
2
|
+
devise:
|
3
|
+
failure:
|
4
|
+
invited: "You have a pending invitation, accept it to finish creating your account."
|
5
|
+
invitations:
|
6
|
+
send_instructions: "An invitation email has been sent to %{email}."
|
7
|
+
invitation_token_invalid: "The invitation token provided is not valid!"
|
8
|
+
updated: "Your password was set successfully. You are now signed in."
|
9
|
+
no_invitations_remaining: "No invitations remaining"
|
10
|
+
invitation_removed: "Your invitation was removed."
|
11
|
+
new:
|
12
|
+
header: "Send invitation"
|
13
|
+
submit_button: "Send an invitation"
|
14
|
+
edit:
|
15
|
+
header: "Set your password"
|
16
|
+
submit_button: "Set my password"
|
17
|
+
mailer:
|
18
|
+
invitation_instructions:
|
19
|
+
subject: "Invitation instructions"
|
20
|
+
hello: "Hello %{email}"
|
21
|
+
someone_invited_you: "Someone has invited you to %{url}, you can accept it through the link below."
|
22
|
+
accept: "Accept invitation"
|
23
|
+
ignore: "If you don't want to accept the invitation, please ignore this email.<br />Your account won't be created until you access the link above and set your password."
|
data/config/routes.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/migration'
|
3
|
+
|
4
|
+
module OxenAccount
|
5
|
+
module Generators
|
6
|
+
class AccountGenerator < Rails::Generators::Base
|
7
|
+
include Rails::Generators::Migration
|
8
|
+
def self.source_root
|
9
|
+
@source_root ||= File.join(File.dirname(__FILE__), 'templates')
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.next_migration_number(dirname)
|
13
|
+
if ActiveRecord::Base.timestamped_migrations
|
14
|
+
Time.new.utc.strftime("%Y%m%d%H%M%S")
|
15
|
+
else
|
16
|
+
"%.3d" % (current_migration_number(dirname) + 1)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_migration_file
|
21
|
+
migration_template 'account.rb', 'db/migrate/create_accounts.rb'
|
22
|
+
migration_template 'user_permission.rb', 'db/migrate/create_user_permissions.rb'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateUserPermissions < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :user_permissions do |t|
|
4
|
+
t.references :account, index: true
|
5
|
+
t.references :user, index: true
|
6
|
+
t.string :email
|
7
|
+
t.string :permissions
|
8
|
+
|
9
|
+
t.timestamps null: false
|
10
|
+
end
|
11
|
+
add_foreign_key :user_permissions, :accounts
|
12
|
+
add_foreign_key :user_permissions, :users
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module OxenAccount
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
config.generators do |g|
|
4
|
+
g.test_framework :rspec,
|
5
|
+
:fixture => false,
|
6
|
+
:fixtures => true,
|
7
|
+
:view_specs => false,
|
8
|
+
:helper_specs => false,
|
9
|
+
:routing_specs => false,
|
10
|
+
:controller_specs => true,
|
11
|
+
:request_specs => true
|
12
|
+
g.fixture_replacement :factory_girl, :dir => "spec/factories"
|
13
|
+
g.assets false
|
14
|
+
g.helper false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/oxen_account.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'oxen_account/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "oxen_account"
|
8
|
+
spec.version = OxenAccount::VERSION
|
9
|
+
spec.authors = ["Walther H Diechmann"]
|
10
|
+
spec.email = ["walther@diechmann.net"]
|
11
|
+
|
12
|
+
# if spec.respond_to?(:metadata)
|
13
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
14
|
+
# end
|
15
|
+
|
16
|
+
spec.summary = %q{Offers an account table for customer accounts}
|
17
|
+
spec.description = %q{The account table is strictly for managing customer accounts}
|
18
|
+
spec.homepage = "http://gitserver.alco.dk/oxen_account"
|
19
|
+
spec.license = "MIT"
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_runtime_dependency 'devise'
|
27
|
+
spec.add_runtime_dependency 'devise_invitable'
|
28
|
+
spec.add_runtime_dependency 'devise_zxcvbn'
|
29
|
+
|
30
|
+
spec.add_runtime_dependency "paper_trail"
|
31
|
+
spec.add_runtime_dependency 'pundit'
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
|
36
|
+
spec.add_development_dependency 'combustion', '~> 0.5.3'
|
37
|
+
spec.add_development_dependency "sqlite3"
|
38
|
+
# spec.add_development_dependency "railties", ">= 3.2.6", "< 5"
|
39
|
+
# spec.add_development_dependency "activerecord", ">= 3.2.6"
|
40
|
+
# spec.add_development_dependency "bundler", "~> 1.7"
|
41
|
+
# spec.add_development_dependency "rake", "~> 10.0"
|
42
|
+
spec.add_development_dependency 'factory_girl_rails'
|
43
|
+
spec.add_development_dependency 'database_cleaner'
|
44
|
+
spec.add_development_dependency 'capybara'
|
45
|
+
#
|
46
|
+
spec.add_development_dependency "rspec"
|
47
|
+
spec.add_development_dependency 'rspec-rails'
|
48
|
+
spec.add_development_dependency "rspec-nc"
|
49
|
+
spec.add_development_dependency "guard"
|
50
|
+
spec.add_development_dependency "guard-rspec"
|
51
|
+
spec.add_development_dependency "pry"
|
52
|
+
spec.add_development_dependency "pry-remote"
|
53
|
+
spec.add_development_dependency "pry-nav"
|
54
|
+
|
55
|
+
end
|