mcms_authentication 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +17 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/images/background/page_bg.png +0 -0
  5. data/app/assets/images/background/text_field_background.png +0 -0
  6. data/app/assets/images/icons/accept.png +0 -0
  7. data/app/assets/images/icons/add.png +0 -0
  8. data/app/assets/images/icons/application_edit.png +0 -0
  9. data/app/assets/images/icons/cancel.png +0 -0
  10. data/app/assets/images/icons/delete.png +0 -0
  11. data/app/assets/images/icons/email_go.png +0 -0
  12. data/app/assets/images/rails.png +0 -0
  13. data/app/assets/javascripts/application.js +42 -0
  14. data/app/assets/javascripts/authentication_global.js +17 -0
  15. data/app/assets/stylesheets/application.css +33 -0
  16. data/app/assets/stylesheets/authentication_global.css +424 -0
  17. data/app/controllers/application_controller.rb +36 -0
  18. data/app/controllers/home_controller.rb +44 -0
  19. data/app/controllers/roles_controller.rb +375 -0
  20. data/app/controllers/users_controller.rb +202 -0
  21. data/app/models/ability.rb +82 -0
  22. data/app/models/existing_model.rb +24 -0
  23. data/app/models/plugin.rb +30 -0
  24. data/app/models/role.rb +70 -0
  25. data/app/models/roles_user.rb +33 -0
  26. data/app/models/user.rb +90 -0
  27. data/app/views/home/index.html.erb +18 -0
  28. data/app/views/layouts/users/_javascript.html.erb +3 -0
  29. data/app/views/layouts/users/_stylesheet.html.erb +3 -0
  30. data/app/views/layouts/users/devise.html.erb +40 -0
  31. data/app/views/layouts/users/home.html.erb +99 -0
  32. data/app/views/roles/_form.html.erb +240 -0
  33. data/app/views/roles/_form.js.erb +113 -0
  34. data/app/views/roles/edit.html.erb +26 -0
  35. data/app/views/roles/index.html.erb +73 -0
  36. data/app/views/roles/new.html.erb +25 -0
  37. data/app/views/users/_role.js.erb +47 -0
  38. data/app/views/users/confirmations/new.html.erb +29 -0
  39. data/app/views/users/edit.html.erb +131 -0
  40. data/app/views/users/index.html.erb +81 -0
  41. data/app/views/users/mailer/confirmation_instructions.html.erb +22 -0
  42. data/app/views/users/mailer/reset_password_instructions.html.erb +26 -0
  43. data/app/views/users/mailer/unlock_instructions.html.erb +24 -0
  44. data/app/views/users/new.html.erb +113 -0
  45. data/app/views/users/passwords/edit.html.erb +38 -0
  46. data/app/views/users/passwords/new.html.erb +32 -0
  47. data/app/views/users/sessions/new.html.erb +84 -0
  48. data/app/views/users/shared/_links.erb +39 -0
  49. data/app/views/users/unlocks/new.html.erb +25 -0
  50. data/config/initializers/constants.rb +30 -0
  51. data/config/initializers/devise.rb +217 -0
  52. data/config/locales/devise.en.yml +57 -0
  53. data/config/locales/en.yml +10 -0
  54. data/config/routes.rb +24 -0
  55. data/db/migrate/20120605112804_devise_create_users.rb +68 -0
  56. data/db/migrate/20120608104637_create_roles.rb +30 -0
  57. data/db/migrate/20120608140424_create_roles_users.rb +25 -0
  58. data/db/migrate/20120612050932_create_plugins.rb +14 -0
  59. data/db/migrate/20120625114340_create_existing_models.rb +9 -0
  60. data/db/migrate/20120711064709_add_username_to_users.rb +9 -0
  61. data/db/seeds.rb +29 -0
  62. data/lib/generators/mcms_authentication/USAGE +8 -0
  63. data/lib/generators/mcms_authentication/mcms_authentication_generator.rb +110 -0
  64. data/lib/generators/mcms_authentication/templates/asset_manager.rb +117 -0
  65. data/lib/generators/mcms_authentication/templates/models.rb +189 -0
  66. data/lib/mcms_authentication.rb +4 -0
  67. data/lib/mcms_authentication/engine.rb +20 -0
  68. data/lib/mcms_authentication/seeds.rb +14 -0
  69. data/lib/mcms_authentication/version.rb +3 -0
  70. data/lib/tasks/mcms_authentication_tasks.rake +4 -0
  71. data/test/dummy/README.rdoc +261 -0
  72. data/test/dummy/Rakefile +7 -0
  73. data/test/dummy/app/assets/javascripts/application.js +15 -0
  74. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  75. data/test/dummy/app/controllers/application_controller.rb +3 -0
  76. data/test/dummy/app/helpers/application_helper.rb +2 -0
  77. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  78. data/test/dummy/config.ru +4 -0
  79. data/test/dummy/config/application.rb +59 -0
  80. data/test/dummy/config/boot.rb +10 -0
  81. data/test/dummy/config/database.yml +25 -0
  82. data/test/dummy/config/environment.rb +5 -0
  83. data/test/dummy/config/environments/development.rb +37 -0
  84. data/test/dummy/config/environments/production.rb +67 -0
  85. data/test/dummy/config/environments/test.rb +37 -0
  86. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  87. data/test/dummy/config/initializers/inflections.rb +15 -0
  88. data/test/dummy/config/initializers/mime_types.rb +5 -0
  89. data/test/dummy/config/initializers/secret_token.rb +7 -0
  90. data/test/dummy/config/initializers/session_store.rb +8 -0
  91. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  92. data/test/dummy/config/locales/en.yml +5 -0
  93. data/test/dummy/config/routes.rb +58 -0
  94. data/test/dummy/public/404.html +26 -0
  95. data/test/dummy/public/422.html +26 -0
  96. data/test/dummy/public/500.html +25 -0
  97. data/test/dummy/public/favicon.ico +0 -0
  98. data/test/dummy/script/rails +6 -0
  99. data/test/fixtures/existing_models.yml +11 -0
  100. data/test/functional/home_controller_test.rb +7 -0
  101. data/test/integration/navigation_test.rb +10 -0
  102. data/test/mcms_authentication_test.rb +7 -0
  103. data/test/test_helper.rb +15 -0
  104. data/test/unit/existing_model_test.rb +7 -0
  105. data/test/unit/helpers/home_helper_test.rb +4 -0
  106. metadata +234 -0
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,17 @@
1
+ = McmsAuthentication
2
+
3
+ =installation procedure
4
+
5
+ gemfile "mcms_authentication"
6
+
7
+ bundle
8
+
9
+ rails g mcms_authentication install
10
+
11
+ follow the commands provided
12
+
13
+ = License
14
+
15
+ created by : Indranil Mukherjee
16
+
17
+ This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'McmsAuthentication'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,42 @@
1
+ /*
2
+
3
+ @File Name :application.js
4
+
5
+ @Company Name :Mindfire Solutions Pvt. Ltd.
6
+
7
+ @Creator Name :Indranil Mukherjee
8
+
9
+ @Date Created :2012-06-04
10
+
11
+ @Date Modified :2012-06-15
12
+
13
+ @Last Modification Details :Making it as mcms project standard
14
+
15
+ @Purpose :Default js
16
+
17
+ */
18
+
19
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
20
+ // listed below.
21
+ //
22
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
23
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
24
+ //
25
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
26
+ // the compiled file.
27
+ //
28
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
29
+ // GO AFTER THE REQUIRES BELOW.
30
+ //
31
+ // I require jquery everywhere
32
+
33
+ //= require jquery
34
+
35
+ // I require jquery_ujs everywhere
36
+
37
+ //= require jquery_ujs
38
+
39
+ // I didn't included the tree because I may or may not require all javascripts in pages
40
+
41
+ // require_tree .
42
+
@@ -0,0 +1,17 @@
1
+ /*
2
+
3
+ @File Name :authentication_global.js
4
+
5
+ @Company Name :Mindfire Solutions Pvt. Ltd.
6
+
7
+ @Creator Name :Indranil Mukherjee
8
+
9
+ @Date Created :2012-06-04
10
+
11
+ @Date Modified :2012-06-15
12
+
13
+ @Last Modification Details :Making it as mcms project standard
14
+
15
+ @Purpose :Global js
16
+
17
+ */
@@ -0,0 +1,33 @@
1
+ /*
2
+
3
+ @File Name :application.css
4
+
5
+ @Company Name :Mindfire Solutions Pvt. Ltd.
6
+
7
+ @Creator Name :Indranil Mukherjee
8
+
9
+ @Date Created :2012-06-04
10
+
11
+ @Date Modified :2012-06-15
12
+
13
+ @Last Modification Details :Making it as mcms project standard
14
+
15
+ @Purpose :Default css
16
+
17
+ */
18
+
19
+ /*
20
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
21
+ * listed below.
22
+ *
23
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
24
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
25
+ *
26
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
27
+ * compiled file, but it's generally better to create a new file per style scope.
28
+ *
29
+ * require_self
30
+ * require_tree .
31
+
32
+ */
33
+
@@ -0,0 +1,424 @@
1
+ /*
2
+
3
+ @File Name :authentication_global.css
4
+
5
+ @Company Name :Mindfire Solutions Pvt. Ltd.
6
+
7
+ @Creator Name :Indranil Mukherjee
8
+
9
+ @Date Created :2012-06-04
10
+
11
+ @Date Modified :2012-06-15
12
+
13
+ @Last Modification Details :Making it as mcms project standard
14
+
15
+ @Purpose :Global css
16
+
17
+ */
18
+
19
+ /*
20
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
21
+ * listed below.
22
+ *
23
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
24
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
25
+ *
26
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
27
+ * compiled file, but it's generally better to create a new file per style scope.
28
+ *
29
+ * require_self
30
+ * require_tree .
31
+
32
+ */
33
+
34
+ /*
35
+
36
+ Defining css for the whole application
37
+ It can be overridden easily
38
+
39
+ */
40
+
41
+ /* Setting the font parameters throughout the application */
42
+
43
+ * {
44
+ color: #41403C;
45
+ font-family: Arial;
46
+ font-size: 13px;
47
+ }
48
+
49
+ /* body css */
50
+
51
+ body{
52
+
53
+ background: url("/assets/background/page_bg.png") repeat scroll 0 0 #303030;
54
+ color: #41403C;
55
+ font-family: Arial;
56
+ font-size: 13px;
57
+ }
58
+
59
+ /* login page css */
60
+
61
+
62
+ .new-session{
63
+
64
+ background: #fff;
65
+ width: 40%;
66
+ margin: auto;
67
+ padding-bottom: 10px;
68
+ }
69
+
70
+ /* common anchors inside body css */
71
+
72
+ body a{
73
+
74
+ font-size: 14px;
75
+ color: #ccc;
76
+ }
77
+
78
+ /* login page css h2 */
79
+
80
+ .new-session h2{
81
+
82
+ min-height: 40px;
83
+ background: none repeat scroll 0 0 #EAEAEA;
84
+ color: #41403C;
85
+ font-size: 18px;
86
+ font-weight: bold;
87
+ line-height: 30px;
88
+ padding-bottom: 0;
89
+ padding-top: 15px;
90
+ text-align: center;
91
+ vertical-align: middle;
92
+ margin: auto;
93
+
94
+ }
95
+
96
+ /* css for flash notice area /div */
97
+
98
+ .flash-notice{
99
+
100
+ background: url("/assets/icons/accept.png") no-repeat scroll 7px 7px #E0F5E0;
101
+ border: 1px solid #00A017;
102
+ color: #00A017;
103
+ border: 1px solid #00A017;
104
+ margin-bottom: 15px;
105
+ padding: 8px 8px 8px 30px;
106
+ position: relative;
107
+ font-family: Arial;
108
+ font-size: 13px;
109
+
110
+ }
111
+
112
+ /* css for error display area */
113
+
114
+ #error-explanation{
115
+
116
+ background: url("/assets/icons/cancel.png") no-repeat scroll 7px 10px #FFB1B1;
117
+ border: 1px solid red;
118
+ font-weight: bold;
119
+ margin-bottom: 5px;
120
+ margin-top: 5px;
121
+ padding: 0 5px 5px 30px;
122
+ margin-left: 5px;
123
+ margin-right: 5px;
124
+ margin-bottom: 10px;
125
+
126
+ }
127
+
128
+ /* close flash notice link css */
129
+
130
+ #flash-close{
131
+
132
+ text-transform: lowercase;
133
+ }
134
+
135
+ /* flash notice mother div css */
136
+
137
+ .flash {
138
+
139
+ margin-left: 100px;
140
+ margin-right: 100px;
141
+ }
142
+
143
+ /* anchor inside flash notice css */
144
+
145
+ .flash a{
146
+
147
+ position: absolute;
148
+ right: 9px;
149
+ top: 7px;
150
+ }
151
+
152
+ /* partial css for fields */
153
+
154
+ #loginContainer .field{
155
+
156
+ position: relative;
157
+ width: 100%;
158
+ }
159
+
160
+ /* any field css */
161
+
162
+ .field {
163
+
164
+ margin-bottom: 20px;
165
+ }
166
+
167
+ /* fixing display */
168
+
169
+ .clearfix {
170
+
171
+ display: block;
172
+ }
173
+
174
+ /* label for fields css */
175
+
176
+ .field label{
177
+
178
+ font-size: 14px;
179
+ display: block;
180
+ font-weight: bold;
181
+ margin-left: 5px;
182
+ }
183
+
184
+ /* input css */
185
+
186
+ .field input {
187
+ background: url("/assets/background/text_field_background.png") repeat-x scroll 0 0 white;
188
+ height: 31px;
189
+ border: 1px solid #7F9DB9;
190
+ line-height: 20px;
191
+ padding: 0.4% 0.5%;
192
+ width: 520px;
193
+ margin-left: 5px;
194
+ }
195
+
196
+ /* form for user crud css */
197
+
198
+ .new-user-form input{
199
+
200
+ height: 22px ;
201
+
202
+ }
203
+
204
+
205
+ /* user crud actions css */
206
+
207
+ .form-actions{
208
+
209
+ background-color: #F2F2F2;
210
+ border: 1px solid #CCCCCC;
211
+ height: 45px;
212
+ margin-top: 10px;
213
+ position: relative;
214
+ margin-left: 5px;
215
+ margin-right: 5px;
216
+
217
+ }
218
+
219
+ /* custom positioning of a particular div */
220
+
221
+ .field form-actions form-actions-left{
222
+
223
+ left: 10px;
224
+
225
+ }
226
+
227
+ /* user crud actions css special attributes */
228
+
229
+ .form-actions-right{
230
+
231
+ float: right;
232
+ margin-top: -35px;
233
+ margin-right: 5px;
234
+
235
+ }
236
+
237
+ /* user crud actions css special attributes */
238
+
239
+ .delete-dialog{
240
+
241
+ background: none repeat scroll 0 0 #EE1100 !important;
242
+ text-decoration:none;
243
+ }
244
+
245
+
246
+ .remembers{
247
+
248
+ color: #41403C;
249
+ font-family: Arial;
250
+ font-size: 13px;
251
+ font-weight: bold;
252
+ }
253
+
254
+
255
+ .close-dialog{
256
+
257
+ background: none repeat scroll 0 0 #BCBCBC !important;
258
+ text-decoration:none;
259
+ }
260
+
261
+ /* css for buttons */
262
+
263
+ a.button {
264
+ padding-bottom: 3px;
265
+ background: none repeat scroll 0 0 #22A7F2;
266
+ border: 0 none;
267
+ color: white;
268
+ cursor: pointer;
269
+ display: inline-block;
270
+ font-size: 14px;
271
+ height: 25px;
272
+ line-height: 25px;
273
+ margin-bottom: 0px;
274
+ margin-top: 10px;
275
+ margin-left: 5px;
276
+ padding: 0 14px;
277
+
278
+ border-radius: 6px 6px 6px 6px;
279
+ -moz-box-sizing: border-box;
280
+
281
+
282
+
283
+ }
284
+
285
+ input.button {
286
+ padding-bottom: 3px;
287
+ background: none repeat scroll 0 0 #22A7F2;
288
+ border: 0 none;
289
+ color: white;
290
+ cursor: pointer;
291
+ display: inline-block;
292
+ font-size: 14px;
293
+ height: 25px;
294
+ line-height: 25px;
295
+ margin-bottom: 0px;
296
+ margin-top: 10px;
297
+ margin-left: 5px;
298
+ padding: 0 14px;
299
+
300
+ border-radius: 6px 6px 6px 6px;
301
+ -moz-box-sizing: border-box;
302
+
303
+
304
+
305
+ }
306
+
307
+ #header{
308
+
309
+ background: none repeat scroll 0 0 #22A7F2;
310
+ height: 47px;
311
+ }
312
+
313
+ #tabs{
314
+
315
+ margin-top: 40px;
316
+ margin-left: 100px;
317
+ margin-right: 100px;
318
+ }
319
+
320
+ #tabs ul li{
321
+
322
+ opacity: 6.35;
323
+
324
+ }
325
+ #site-bar-branding{
326
+
327
+ color: white;
328
+ font-family: Arial;
329
+ font-size: 14px;
330
+ font-weight: bold;
331
+ line-height: 47px;
332
+ float: right;
333
+ margin-right: 100px;
334
+ }
335
+ #site-bar-branding a{
336
+
337
+ color: white
338
+ }
339
+ #flash-container{
340
+
341
+ margin-top: 10px;
342
+ }
343
+ #main-content {
344
+
345
+ margin-left: 100px;
346
+ margin-right: 100px;
347
+ border-bottom-left-radius: 5px;
348
+ border-bottom-right-radius: 5px;
349
+ border-top-right-radius: 5px;
350
+ border-top-left-radius: 5px;
351
+ background: white;
352
+ min-height: 98px;
353
+ padding-bottom: 20px;
354
+ }
355
+
356
+ #records{
357
+
358
+ padding-top:10px;
359
+ padding-bottom: 15px;
360
+ }
361
+
362
+ .record{
363
+
364
+ margin-left: 10px;
365
+ line-height: 35px;
366
+ list-style: none outside none;
367
+ margin-bottom: 2px;
368
+ width:550px;
369
+ padding: 0 5px;
370
+ position: relative;
371
+ vertical-align: top;
372
+
373
+ }
374
+
375
+ .roles {
376
+ width:90%;
377
+ }
378
+ .odd{
379
+
380
+ background-color: #EAEAEA;
381
+ }
382
+ .even{
383
+
384
+ background-color: #FFFFFF;
385
+ }
386
+ .actions{
387
+
388
+ float: right;
389
+ }
390
+ .add-user{
391
+
392
+ float: right;
393
+ background-color: #DBEDFF;
394
+ background-position: 12px 50%;
395
+ background-repeat: no-repeat;
396
+ border: 1px solid #65C3F7;
397
+ display: block;
398
+ padding: 9px 12px 9px 36px;
399
+ margin-right: 160px;
400
+ width: 300px;
401
+ }
402
+
403
+ .checkboxes{
404
+
405
+ background: none
406
+
407
+ }
408
+
409
+ ul.checkboxes li {
410
+
411
+ list-style: none outside none;
412
+
413
+ }
414
+
415
+ .stripped {
416
+
417
+ display: inline !important;
418
+ float: none;
419
+ font-size: 1em !important;
420
+ font-weight: normal !important;
421
+ margin: 0;
422
+ padding: 0;
423
+
424
+ }