zen 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gems +34 -0
- data/.travis.yml +7 -0
- data/AUTHORS +5 -0
- data/CHANGELOG +14 -0
- data/{license.txt → LICENSE} +0 -0
- data/MANIFEST +67 -51
- data/README.md +18 -25
- data/Rakefile +2 -3
- data/bin/zen +2 -2
- data/lib/zen.rb +93 -57
- data/lib/zen/asset.rb +7 -8
- data/lib/zen/bin/app.rb +0 -2
- data/lib/zen/controller/admin_controller.rb +4 -9
- data/lib/zen/controller/base_controller.rb +0 -25
- data/lib/zen/controller/main_controller.rb +5 -5
- data/lib/zen/controller/preview.rb +50 -0
- data/lib/zen/helper/common.rb +4 -68
- data/lib/zen/helper/message.rb +82 -0
- data/lib/zen/helper/theme.rb +2 -2
- data/lib/zen/language.rb +68 -38
- data/lib/zen/language/en/zen_general.yml +1 -4
- data/lib/zen/language/nl/zen_general.yml +28 -0
- data/lib/zen/language/nl/zen_models.yml +13 -0
- data/lib/zen/layout/admin.xhtml +1 -1
- data/lib/zen/layout/login.xhtml +1 -1
- data/lib/zen/model/settings.rb +2 -0
- data/lib/zen/package.rb +29 -25
- data/lib/zen/package/all.rb +1 -1
- data/lib/zen/package/categories/lib/categories/controller/categories.rb +51 -63
- data/lib/zen/package/categories/lib/categories/controller/category_groups.rb +45 -52
- data/lib/zen/package/categories/lib/categories/language/en/categories.yml +2 -2
- data/lib/zen/package/categories/lib/categories/language/nl/categories.yml +39 -0
- data/lib/zen/package/categories/lib/categories/language/nl/category_groups.yml +33 -0
- data/lib/zen/package/categories/lib/categories/plugin/categories.rb +2 -2
- data/lib/zen/package/comments/lib/comments.rb +31 -2
- data/lib/zen/package/comments/lib/comments/controller/comments.rb +42 -57
- data/lib/zen/package/comments/lib/comments/controller/comments_form.rb +36 -51
- data/lib/zen/package/comments/lib/comments/language/en/comments.yml +7 -3
- data/lib/zen/package/comments/lib/comments/language/nl/comments.yml +48 -0
- data/lib/zen/package/comments/lib/comments/model/comment.rb +45 -4
- data/lib/zen/package/comments/lib/comments/plugin/anti_spam.rb +152 -0
- data/lib/zen/package/comments/lib/comments/plugin/comments.rb +5 -6
- data/lib/zen/package/comments/lib/comments/view/admin/comments/index.xhtml +2 -2
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_field_groups.rb +43 -52
- data/lib/zen/package/custom_fields/lib/custom_fields/controller/custom_fields.rb +68 -67
- data/lib/zen/package/custom_fields/lib/custom_fields/language/en/custom_fields.yml +1 -1
- data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_field_groups.yml +32 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/language/nl/custom_fields.yml +52 -0
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field.rb +3 -3
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_group.rb +4 -7
- data/lib/zen/package/custom_fields/lib/custom_fields/model/custom_field_value.rb +3 -3
- data/lib/zen/package/menus/lib/menus/controller/menu_items.rb +37 -44
- data/lib/zen/package/menus/lib/menus/controller/menus.rb +33 -43
- data/lib/zen/package/menus/lib/menus/helper/menu_item.rb +5 -10
- data/lib/zen/package/menus/lib/menus/language/nl/menu_items.yml +41 -0
- data/lib/zen/package/menus/lib/menus/language/nl/menus.yml +39 -0
- data/lib/zen/package/menus/lib/menus/model/menu.rb +3 -3
- data/lib/zen/package/menus/lib/menus/model/menu_item.rb +3 -3
- data/lib/zen/package/menus/lib/menus/plugin/menus.rb +5 -6
- data/lib/zen/package/menus/migrations/1297184342_create_schema.rb +1 -1
- data/lib/zen/package/sections/lib/sections.rb +20 -0
- data/lib/zen/package/sections/lib/sections/controller/section_entries.rb +85 -79
- data/lib/zen/package/sections/lib/sections/controller/sections.rb +58 -66
- data/lib/zen/package/sections/lib/sections/language/en/sections.yml +0 -1
- data/lib/zen/package/sections/lib/sections/language/nl/section_entries.yml +43 -0
- data/lib/zen/package/sections/lib/sections/language/nl/sections.yml +47 -0
- data/lib/zen/package/sections/lib/sections/model/section.rb +11 -15
- data/lib/zen/package/sections/lib/sections/model/section_entry.rb +9 -5
- data/lib/zen/package/sections/lib/sections/plugin/section_entries.rb +7 -8
- data/lib/zen/package/sections/lib/sections/plugin/sections.rb +3 -4
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/form.xhtml +0 -4
- data/lib/zen/package/sections/lib/sections/view/admin/section-entries/index.xhtml +8 -2
- data/lib/zen/package/sections/migrations/1306772479_remove_unique_slug.rb +28 -0
- data/lib/zen/package/settings/lib/settings.rb +21 -34
- data/lib/zen/package/settings/lib/settings/controller/settings.rb +29 -22
- data/lib/zen/package/settings/lib/settings/language/en/settings.yml +7 -5
- data/lib/zen/package/settings/lib/settings/language/nl/settings.yml +39 -0
- data/lib/zen/package/settings/lib/settings/model/setting.rb +3 -5
- data/lib/zen/package/settings/lib/settings/plugin/group_base.rb +3 -4
- data/lib/zen/package/settings/lib/settings/plugin/setting_base.rb +3 -5
- data/lib/zen/package/settings/lib/settings/plugin/settings.rb +11 -4
- data/lib/zen/package/settings/lib/settings/view/admin/settings/index.xhtml +5 -5
- data/lib/zen/package/settings/migrations/1299538742_add_language_key.rb +8 -8
- data/lib/zen/package/settings/migrations/1303196915_settings_plugin.rb +2 -5
- data/lib/zen/package/users/lib/users/controller/access_rules.rb +54 -61
- data/lib/zen/package/users/lib/users/controller/user_groups.rb +49 -57
- data/lib/zen/package/users/lib/users/controller/users.rb +58 -73
- data/lib/zen/package/users/lib/users/language/en/users.yml +6 -0
- data/lib/zen/package/users/lib/users/language/nl/access_rules.yml +37 -0
- data/lib/zen/package/users/lib/users/language/nl/user_groups.yml +31 -0
- data/lib/zen/package/users/lib/users/language/nl/users.yml +56 -0
- data/lib/zen/package/users/lib/users/model/user.rb +16 -1
- data/lib/zen/package/users/lib/users/view/admin/users/form.xhtml +27 -2
- data/lib/zen/package/users/lib/users/view/admin/users/index.xhtml +15 -3
- data/lib/zen/package/users/migrations/1304939855_user_settings.rb +15 -0
- data/lib/zen/plugin.rb +7 -9
- data/lib/zen/public/admin/css/{buttons.css → zen/buttons.css} +11 -7
- data/lib/zen/public/admin/css/{datepicker.css → zen/datepicker.css} +0 -0
- data/lib/zen/public/admin/css/{editor.css → zen/editor.css} +10 -5
- data/lib/zen/public/admin/css/{forms.css → zen/forms.css} +1 -1
- data/lib/zen/public/admin/css/{general.css → zen/general.css} +7 -7
- data/lib/zen/public/admin/css/{grid.css → zen/grid.css} +0 -0
- data/lib/zen/public/admin/css/{layout.css → zen/layout.css} +4 -5
- data/lib/zen/public/admin/css/zen/messages.css +61 -0
- data/lib/zen/public/admin/css/{notifications.css → zen/notifications.css} +4 -4
- data/lib/zen/public/admin/css/{reset.css → zen/reset.css} +0 -0
- data/lib/zen/public/admin/css/{tables.css → zen/tables.css} +3 -3
- data/lib/zen/public/admin/css/{tabs.css → zen/tabs.css} +5 -5
- data/lib/zen/public/admin/css/zen/window.css +79 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/accept.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/add.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/back.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/bold.png +0 -0
- data/lib/zen/public/admin/images/zen/icons/close.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/delete.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/edit.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/error.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/help.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/info.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/italic.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/large/error.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/large/notice.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/large/success.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/link.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/logout.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/ol.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/pdf.png +0 -0
- data/lib/zen/public/admin/images/zen/icons/preview.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/ul.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/user.png +0 -0
- data/lib/zen/public/admin/images/{icons → zen/icons}/view.png +0 -0
- data/lib/zen/public/admin/js/zen/core.js +73 -0
- data/lib/zen/public/admin/js/zen/editor.js +527 -0
- data/lib/zen/public/admin/js/zen/editor/markdown.js +84 -0
- data/lib/zen/public/admin/js/zen/editor/textile.js +84 -0
- data/lib/zen/public/admin/js/zen/init.js +12 -66
- data/lib/zen/public/admin/js/zen/tabs.js +5 -0
- data/lib/zen/public/admin/js/zen/window.js +206 -0
- data/lib/zen/task/build.rake +23 -6
- data/lib/zen/task/clean.rake +6 -7
- data/lib/zen/task/db.rake +7 -9
- data/lib/zen/task/package.rake +6 -6
- data/lib/zen/task/test.rake +6 -0
- data/lib/zen/task/theme.rake +3 -3
- data/lib/zen/theme.rb +3 -4
- data/lib/zen/validation.rb +7 -9
- data/lib/zen/version.rb +3 -4
- data/lib/zen/view/bottom.xhtml +0 -5
- data/lib/zen/view/main.xhtml +2 -0
- data/proto/app/app.rb +6 -4
- data/proto/app/config/config.rb +1 -7
- data/proto/app/config/database.rb +47 -43
- data/proto/app/config/middlewares.rb +0 -40
- data/proto/app/start.rb +1 -6
- data/proto/app/{vendor → theme}/.gitkeep +0 -0
- data/proto/migration.rb +3 -3
- data/proto/package/lib/package.rb +0 -1
- data/proto/package/lib/package/controller/controllers.rb +7 -40
- data/proto/package/lib/package/model/model.rb +3 -3
- metadata +106 -79
- data/CHANGELOG.md +0 -27
- data/ROADMAP.md +0 -53
- data/lib/zen/database.rb +0 -112
- data/lib/zen/logger.rb +0 -56
- data/lib/zen/public/admin/css/modals.css +0 -63
- data/lib/zen/public/admin/images/icons/close.png +0 -0
- data/lib/zen/public/admin/js/vendor/yepnope.js +0 -1
- data/lib/zen/public/admin/js/zen/editor/base.js +0 -262
- data/lib/zen/public/admin/js/zen/editor/drivers/html.js +0 -89
- data/lib/zen/public/admin/js/zen/editor/drivers/markdown.js +0 -87
- data/lib/zen/public/admin/js/zen/editor/drivers/textile.js +0 -87
- data/lib/zen/public/admin/js/zen/modal.js +0 -146
- data/lib/zen/public/admin/js/zen/notification.js +0 -211
- data/proto/app/config/requires.rb +0 -10
- data/proto/app/vendor/theme/.gitkeep +0 -0
- data/proto/package/lib/package/view/admin/package/edit.xhtml +0 -0
- data/proto/package/lib/package/view/admin/package/form.xhtml +0 -0
- data/proto/package/lib/package/view/admin/package/new.xhtml +0 -0
@@ -18,13 +18,13 @@ module Users
|
|
18
18
|
include ::Users::Model
|
19
19
|
|
20
20
|
map('/admin/users')
|
21
|
-
|
21
|
+
|
22
22
|
before_all do
|
23
23
|
csrf_protection(:save, :delete) do
|
24
24
|
respond(lang('zen_general.errors.csrf'), 403)
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
# Every action should use the admin layout except the 'login' method,
|
29
29
|
# that one will use a trimmed down version of the admin layout.
|
30
30
|
layout do |path, format|
|
@@ -34,7 +34,7 @@ module Users
|
|
34
34
|
:admin
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
##
|
39
39
|
# Load our language packs, set the form URLs and define our page title.
|
40
40
|
#
|
@@ -47,13 +47,13 @@ module Users
|
|
47
47
|
#
|
48
48
|
def initialize
|
49
49
|
super
|
50
|
-
|
50
|
+
|
51
51
|
@form_save_url = Users.r(:save)
|
52
52
|
@form_delete_url = Users.r(:delete)
|
53
53
|
@form_login_url = Users.r(:login)
|
54
54
|
|
55
55
|
Zen::Language.load('users')
|
56
|
-
|
56
|
+
|
57
57
|
# Set the page title
|
58
58
|
if !action.method.nil?
|
59
59
|
method = action.method.to_sym
|
@@ -65,7 +65,7 @@ module Users
|
|
65
65
|
'closed' => lang('users.special.status_hash.closed')
|
66
66
|
}
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
##
|
70
70
|
# Show an overview of all users and allow the current user
|
71
71
|
# to manage these users.
|
@@ -81,12 +81,12 @@ module Users
|
|
81
81
|
if !user_authorized?([:read])
|
82
82
|
respond(lang('zen_general.errors.not_authorized'), 403)
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
set_breadcrumbs(lang('users.titles.index'))
|
86
|
-
|
86
|
+
|
87
87
|
@users = User.all
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
90
|
##
|
91
91
|
# Edit an existing user based on the ID.
|
92
92
|
#
|
@@ -103,12 +103,12 @@ module Users
|
|
103
103
|
if !user_authorized?([:read, :update])
|
104
104
|
respond(lang('zen_general.errors.not_authorized'), 403)
|
105
105
|
end
|
106
|
-
|
106
|
+
|
107
107
|
set_breadcrumbs(
|
108
|
-
anchor_to(lang('users.titles.index'), Users.r(:index)),
|
108
|
+
anchor_to(lang('users.titles.index'), Users.r(:index)),
|
109
109
|
lang('users.titles.edit')
|
110
110
|
)
|
111
|
-
|
111
|
+
|
112
112
|
if flash[:form_data]
|
113
113
|
@user = flash[:form_data]
|
114
114
|
else
|
@@ -117,7 +117,7 @@ module Users
|
|
117
117
|
|
118
118
|
@user_group_pks = UserGroup.pk_hash(:name)
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
##
|
122
122
|
# Create a new user.
|
123
123
|
#
|
@@ -133,16 +133,16 @@ module Users
|
|
133
133
|
if !user_authorized?([:read, :create])
|
134
134
|
respond(lang('zen_general.errors.not_authorized'), 403)
|
135
135
|
end
|
136
|
-
|
136
|
+
|
137
137
|
set_breadcrumbs(
|
138
|
-
anchor_to(lang('users.titles.index'), Users.r(:index)),
|
138
|
+
anchor_to(lang('users.titles.index'), Users.r(:index)),
|
139
139
|
lang('users.titles.new')
|
140
140
|
)
|
141
|
-
|
141
|
+
|
142
142
|
@user = User.new
|
143
143
|
@user_group_pks = UserGroup.pk_hash(:name)
|
144
144
|
end
|
145
|
-
|
145
|
+
|
146
146
|
##
|
147
147
|
# Show a form that allows a user to log in.
|
148
148
|
#
|
@@ -155,15 +155,15 @@ module Users
|
|
155
155
|
if user_login(request.subset(:email, :password))
|
156
156
|
# Update the last time the user logged in
|
157
157
|
User[:email => request.params['email']].update(:last_login => Time.new)
|
158
|
-
|
159
|
-
|
158
|
+
|
159
|
+
message(:success, lang('users.success.login'))
|
160
160
|
redirect(::Sections::Controller::Sections.r(:index))
|
161
161
|
else
|
162
|
-
|
162
|
+
message(:error, lang('users.errors.login'))
|
163
163
|
end
|
164
164
|
end
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
##
|
168
168
|
# Logout and destroy the user's session.
|
169
169
|
#
|
@@ -173,11 +173,11 @@ module Users
|
|
173
173
|
def logout
|
174
174
|
user_logout
|
175
175
|
session.clear
|
176
|
-
|
177
|
-
|
176
|
+
|
177
|
+
message(:success, lang('users.success.logout'))
|
178
178
|
redirect(Users.r(:login))
|
179
179
|
end
|
180
|
-
|
180
|
+
|
181
181
|
##
|
182
182
|
# Saves or creates a new user based on the POST data and a field named 'id'.
|
183
183
|
#
|
@@ -193,9 +193,12 @@ module Users
|
|
193
193
|
if !user_authorized?([:update, :create])
|
194
194
|
respond(lang('zen_general.errors.not_authorized'), 403)
|
195
195
|
end
|
196
|
-
|
197
|
-
post = request.
|
198
|
-
|
196
|
+
|
197
|
+
post = request.subset(
|
198
|
+
:id, :email, :name, :website, :new_password, :confirm_password, :status,
|
199
|
+
:language, :frontend_language, :date_format
|
200
|
+
)
|
201
|
+
|
199
202
|
if post['id'] and !post['id'].empty?
|
200
203
|
@user = User[post['id']]
|
201
204
|
save_action = :save
|
@@ -203,51 +206,45 @@ module Users
|
|
203
206
|
@user = User.new
|
204
207
|
save_action = :new
|
205
208
|
end
|
206
|
-
|
209
|
+
|
207
210
|
if !post['new_password'].nil? and !post['new_password'].empty?
|
208
211
|
if post['new_password'] != post['confirm_password']
|
209
|
-
|
210
|
-
:error,
|
211
|
-
lang('users.titles.index'),
|
212
|
-
lang('users.errors.no_password_match')
|
213
|
-
)
|
214
|
-
|
212
|
+
message(:error, lang('users.errors.no_password_match'))
|
215
213
|
redirect_referrer
|
216
214
|
else
|
217
215
|
post['password'] = post['new_password']
|
218
|
-
|
216
|
+
|
219
217
|
post.delete('new_password')
|
220
218
|
post.delete('confirm_password')
|
221
219
|
end
|
222
220
|
end
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
end
|
230
|
-
|
221
|
+
|
222
|
+
post.delete('id')
|
223
|
+
|
224
|
+
post['user_group_pks'] ||= []
|
225
|
+
post['user_group_pks'] = post['user_group_pks'].map { |value| value.to_i }
|
226
|
+
|
231
227
|
flash_success = lang("users.success.#{save_action}")
|
232
228
|
flash_error = lang("users.errors.#{save_action}")
|
233
229
|
|
234
230
|
begin
|
235
231
|
@user.update(post)
|
236
|
-
|
237
|
-
rescue
|
238
|
-
|
239
|
-
|
232
|
+
message(:success, flash_success)
|
233
|
+
rescue => e
|
234
|
+
Ramaze::Log.error(e.inspect)
|
235
|
+
message(:error, flash_error)
|
236
|
+
|
240
237
|
flash[:form_data] = @user
|
241
238
|
flash[:form_errors] = @user.errors
|
242
239
|
end
|
243
|
-
|
240
|
+
|
244
241
|
if @user.id
|
245
242
|
redirect(Users.r(:edit, @user.id))
|
246
243
|
else
|
247
244
|
redirect_referrer
|
248
245
|
end
|
249
246
|
end
|
250
|
-
|
247
|
+
|
251
248
|
##
|
252
249
|
# Delete all specified users.
|
253
250
|
#
|
@@ -262,36 +259,24 @@ module Users
|
|
262
259
|
if !user_authorized?([:delete])
|
263
260
|
respond(lang('zen_general.errors.not_authorized'), 403)
|
264
261
|
end
|
265
|
-
|
266
|
-
if !request.params['user_ids'] or request.params['user_ids'].empty?
|
267
|
-
notification(
|
268
|
-
:error,
|
269
|
-
lang('users.titles.index'),
|
270
|
-
lang('users.errors.no_delete')
|
271
|
-
)
|
272
262
|
|
263
|
+
if !request.params['user_ids'] or request.params['user_ids'].empty?
|
264
|
+
message(:error, lang('users.errors.no_delete'))
|
273
265
|
redirect_referrer
|
274
266
|
end
|
275
|
-
|
267
|
+
|
276
268
|
request.params['user_ids'].each do |id|
|
277
269
|
begin
|
278
|
-
User[id
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
)
|
284
|
-
rescue
|
285
|
-
notification(
|
286
|
-
:error,
|
287
|
-
lang('users.titles.index'),
|
288
|
-
lang('users.errors.delete') % id
|
289
|
-
)
|
270
|
+
User[id].destroy
|
271
|
+
message(:success, lang('users.success.delete'))
|
272
|
+
rescue => e
|
273
|
+
Ramaze::Log.error(e.inspect)
|
274
|
+
message(:error,lang('users.errors.delete') % id)
|
290
275
|
end
|
291
276
|
end
|
292
|
-
|
277
|
+
|
293
278
|
redirect_referrer
|
294
279
|
end
|
295
|
-
end
|
296
|
-
end
|
297
|
-
end
|
280
|
+
end # Users
|
281
|
+
end # Controller
|
282
|
+
end # Users
|
@@ -18,6 +18,12 @@ labels:
|
|
18
18
|
updated_at : 'Updated'
|
19
19
|
last_login : 'Last login'
|
20
20
|
user_groups : 'User groups'
|
21
|
+
language : 'Language'
|
22
|
+
frontend_language: 'Frontend language'
|
23
|
+
date_format : 'Date format'
|
24
|
+
|
25
|
+
placeholders:
|
26
|
+
date_format: 'A custom format to use for all dates displayed in the backend.'
|
21
27
|
|
22
28
|
special:
|
23
29
|
status_hash:
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
titles:
|
3
|
+
index: 'Toegangs regels'
|
4
|
+
edit : 'Toegangs regel aanpassen'
|
5
|
+
new : 'Toegangs regel aanmaken'
|
6
|
+
|
7
|
+
labels:
|
8
|
+
id : '#'
|
9
|
+
package : 'Pakket'
|
10
|
+
controller : 'Controller'
|
11
|
+
rule_appleis : 'Betrekking tot'
|
12
|
+
create : 'Aanmaken'
|
13
|
+
read : 'Lezen'
|
14
|
+
update : 'Aanpassen'
|
15
|
+
delete : 'Verwijderen'
|
16
|
+
user : 'Gebruiker'
|
17
|
+
user_group : 'Gebruikers groep'
|
18
|
+
all_controllers: 'Alle controllers'
|
19
|
+
|
20
|
+
messages:
|
21
|
+
no_rules: 'Er zijn nog geen toegangs regels aangemaakt.'
|
22
|
+
|
23
|
+
success:
|
24
|
+
new : 'De toegangs regel is aangemaakt.'
|
25
|
+
save : 'De toegangs regel is aangepast.'
|
26
|
+
delete: 'Alle gespecificeerde regels zijn verwijderd.'
|
27
|
+
|
28
|
+
errors:
|
29
|
+
new : 'De toegangs regel kon niet worden aangemaakt.'
|
30
|
+
save : 'De toegangs regel kon niet worden aangepast.'
|
31
|
+
delete : 'De toegangs regel met ID #%s kon niet worden verwijderd.'
|
32
|
+
no_delete: 'U moet ten minste 1 regel specificeren om te verwijderen.'
|
33
|
+
|
34
|
+
buttons:
|
35
|
+
new : 'Regel toevoegen'
|
36
|
+
save : 'Regel opslaan'
|
37
|
+
delete: 'Geselecteerde regels verwijderen'
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
titles:
|
3
|
+
index: 'Gebruikers groepen'
|
4
|
+
edit : 'Gebruikers groep aanpassen'
|
5
|
+
new : 'Gebruikers groep aanmaken'
|
6
|
+
|
7
|
+
labels:
|
8
|
+
id : '#'
|
9
|
+
name : 'Naam'
|
10
|
+
slug : 'Slug'
|
11
|
+
description: 'Beschrijving'
|
12
|
+
super_group: 'Beheerders groep'
|
13
|
+
|
14
|
+
messages:
|
15
|
+
no_groups: 'Er zijn nog geen gebruikers groepen aangemaakt.'
|
16
|
+
|
17
|
+
success:
|
18
|
+
new : 'De gebruikers groep is aangemaakt.'
|
19
|
+
save : 'De gebruikers groep is aangepast.'
|
20
|
+
delete: 'De geselecteerde groepen zijn verwijderd.'
|
21
|
+
|
22
|
+
errors:
|
23
|
+
new : 'De gebruikers groep kon niet worden aangemaakt.'
|
24
|
+
save : 'De gebruikers groep kon niet worden aangepast.'
|
25
|
+
delete : 'De gebruikers groep met ID #%s kon niet worden verwijderd.'
|
26
|
+
no_delete: 'U moet ten minste 1 groep specificeren om te verwijderen.'
|
27
|
+
|
28
|
+
buttons:
|
29
|
+
new : 'Groep toevoegen'
|
30
|
+
delete: 'Geselecteerde groepen verwijderen'
|
31
|
+
save : 'Groep opslaan'
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
titles:
|
3
|
+
index: 'Gebruikers'
|
4
|
+
edit : 'Gebruiker aanpassen'
|
5
|
+
new : 'Gebruiker aanmaken'
|
6
|
+
login: 'Inloggen'
|
7
|
+
|
8
|
+
labels:
|
9
|
+
id : '#'
|
10
|
+
email : 'Email'
|
11
|
+
name : 'Naam'
|
12
|
+
website : 'Website'
|
13
|
+
password : 'Wachtwoord'
|
14
|
+
new_password : 'Nieuw wachtwoord'
|
15
|
+
confirm_password : 'Bevestig wachtwoord'
|
16
|
+
status : 'Status'
|
17
|
+
created_at : 'Aanmaak datum'
|
18
|
+
updated_at : 'Aanpas datum'
|
19
|
+
last_login : 'Login datum'
|
20
|
+
user_groups : 'Gebruikers groepen'
|
21
|
+
language : 'Taal'
|
22
|
+
frontend_language: 'Bezoekers taal'
|
23
|
+
date_format : 'Datum formaat'
|
24
|
+
|
25
|
+
placeholders:
|
26
|
+
date_format: 'Het formaat van de datums in het admin gedeelte.'
|
27
|
+
|
28
|
+
special:
|
29
|
+
status_hash:
|
30
|
+
open : 'Open'
|
31
|
+
closed: 'Gesloten'
|
32
|
+
|
33
|
+
messages:
|
34
|
+
no_users: 'Er zijn nog geen gebruikers aangemaakt.'
|
35
|
+
|
36
|
+
success:
|
37
|
+
new : 'De gebruiker is aangemaakt.'
|
38
|
+
save : 'De gebruiker is aangepast.'
|
39
|
+
delete: 'Alle gespecificeerde gebruikers zijn verwijderd.'
|
40
|
+
login : 'U bent nu ingelogd.'
|
41
|
+
logout: 'U bent nu uitgelogd.'
|
42
|
+
|
43
|
+
errors:
|
44
|
+
new : 'De gebruiker kon niet worden aangemaakt.'
|
45
|
+
save : 'De gebruiker kon niet worden aangepast.'
|
46
|
+
delete : 'De gebruiker met ID #%s kon niet worden verwijderd.'
|
47
|
+
no_delete : 'U moet ten minste 1 gebruiker specificeren om te verwijderen.'
|
48
|
+
no_password_match: 'De opgegeven wachtwoorden komen niet overeen.'
|
49
|
+
login : 'U kon niet worden ingelogd.'
|
50
|
+
logout : 'U kon niet worden uitgelogd, misschien bent u al uitgelogd.'
|
51
|
+
|
52
|
+
buttons:
|
53
|
+
login : 'Inloggen'
|
54
|
+
new : 'Gebruiker toevoegen'
|
55
|
+
save : 'Gebruiker opslaan'
|
56
|
+
delete: 'Geselecteerde gebruikers verwijderen'
|
@@ -20,6 +20,10 @@ module Users
|
|
20
20
|
# @since 0.1
|
21
21
|
#
|
22
22
|
class User < Sequel::Model
|
23
|
+
class << self
|
24
|
+
include ::Innate::Trinity
|
25
|
+
end
|
26
|
+
|
23
27
|
plugin :timestamps, :create => :created_at, :update => :updated_at
|
24
28
|
|
25
29
|
many_to_many :user_groups, :class => "Users::Model::UserGroup", :eager => [:access_rules]
|
@@ -49,7 +53,18 @@ module Users
|
|
49
53
|
user = self[:email => email]
|
50
54
|
|
51
55
|
if !user.nil? and user.password == password and user.status == 'open'
|
52
|
-
|
56
|
+
# Overwrite all the global settings with the user specific ones
|
57
|
+
::Zen.settings.each do |k, v|
|
58
|
+
if user.respond_to?(k)
|
59
|
+
got = user.send(k)
|
60
|
+
|
61
|
+
if got.nil? or got.empty?
|
62
|
+
user.send("#{k}=", v)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
action.node.session[:user] = user
|
53
68
|
return user
|
54
69
|
else
|
55
70
|
return false
|
@@ -41,9 +41,34 @@
|
|
41
41
|
:user_group_pks,
|
42
42
|
:values => @user_group_pks,
|
43
43
|
:selected => @user.user_group_pks,
|
44
|
-
:multiple => :multiple
|
44
|
+
:multiple => :multiple,
|
45
|
+
:size => 1
|
45
46
|
)
|
46
|
-
|
47
|
+
|
48
|
+
f.select(
|
49
|
+
lang('users.labels.language'),
|
50
|
+
:language,
|
51
|
+
:values => ::Zen::Language::Languages,
|
52
|
+
:selected => @user.language,
|
53
|
+
:size => 1
|
54
|
+
)
|
55
|
+
|
56
|
+
f.select(
|
57
|
+
lang('users.labels.frontend_language'),
|
58
|
+
:frontend_language,
|
59
|
+
:values => ::Zen::Language::Languages,
|
60
|
+
:selected => @user.frontend_language,
|
61
|
+
:size => 1
|
62
|
+
)
|
63
|
+
|
64
|
+
f.select(
|
65
|
+
lang('users.labels.date_format'),
|
66
|
+
:date_format,
|
67
|
+
:values => plugin(:settings, :get, 'date_format').values,
|
68
|
+
:selected => @user.date_format,
|
69
|
+
:size => 1
|
70
|
+
)
|
71
|
+
|
47
72
|
f.g.div(:class => 'clearfix') do
|
48
73
|
f.g.div(:class => 'button') do
|
49
74
|
f.g.input(:type => 'submit', :value => lang('users.buttons.save'))
|