authentasaurus 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/CHANGELIST +2 -6
  2. data/TODO +0 -5
  3. data/app/controllers/areas_controller.rb +1 -1
  4. data/app/controllers/groups_controller.rb +1 -1
  5. data/app/controllers/permissions_controller.rb +1 -1
  6. data/app/controllers/recoveries_controller.rb +1 -1
  7. data/app/controllers/registrations_controller.rb +1 -1
  8. data/app/controllers/sessions_controller.rb +2 -2
  9. data/app/controllers/user_invitations_controller.rb +1 -1
  10. data/app/controllers/users_controller.rb +1 -1
  11. data/app/controllers/validations_controller.rb +1 -1
  12. data/app/models/area.rb +1 -1
  13. data/app/models/authentasaurus_emailer.rb +6 -6
  14. data/app/models/group.rb +1 -1
  15. data/app/models/permission.rb +1 -1
  16. data/app/models/recovery.rb +1 -1
  17. data/app/models/user_invitation.rb +1 -1
  18. data/app/models/validation.rb +1 -1
  19. data/app/views/authentasaurus_emailer/invitation_mail.html.erb +2 -2
  20. data/app/views/authentasaurus_emailer/recovery_mail.html.erb +2 -2
  21. data/app/views/authentasaurus_emailer/validation_mail.html.erb +2 -2
  22. data/lib/authentasaurus.rb +18 -52
  23. metadata +2 -136
  24. data/app/models/authentasaurus_session.rb +0 -3
  25. data/lib/authentasaurus/ac/acts_as_overrider.rb +0 -48
  26. data/lib/authentasaurus/ac/controllers/areas_controller.rb +0 -75
  27. data/lib/authentasaurus/ac/controllers/groups_controller.rb +0 -77
  28. data/lib/authentasaurus/ac/controllers/permissions_controller.rb +0 -76
  29. data/lib/authentasaurus/ac/controllers/recoveries_controller.rb +0 -67
  30. data/lib/authentasaurus/ac/controllers/registrations_controller.rb +0 -40
  31. data/lib/authentasaurus/ac/controllers/sessions_controller.rb +0 -57
  32. data/lib/authentasaurus/ac/controllers/user_invitations_controller.rb +0 -45
  33. data/lib/authentasaurus/ac/controllers/users_controller.rb +0 -75
  34. data/lib/authentasaurus/ac/controllers/validations_controller.rb +0 -48
  35. data/lib/authentasaurus/ac/routing.rb +0 -86
  36. data/lib/authentasaurus/ar/acts_as_authenticatable.rb +0 -107
  37. data/lib/authentasaurus/ar/acts_as_authenticatable_validatable.rb +0 -35
  38. data/lib/authentasaurus/ar/acts_as_overrider.rb +0 -49
  39. data/lib/authentasaurus/ar/authenticatable.rb +0 -64
  40. data/lib/authentasaurus/ar/migrations.rb +0 -165
  41. data/lib/authentasaurus/ar/models/recovery.rb +0 -34
  42. data/lib/authentasaurus/ar/models/session.rb +0 -78
  43. data/lib/authentasaurus/ar/models/user_invitation.rb +0 -30
  44. data/lib/authentasaurus/ar/models/validation.rb +0 -27
  45. data/lib/authentasaurus/arel/acts_as_authenticatable.rb +0 -67
  46. data/lib/authentasaurus/arel/authenticatable.rb +0 -21
  47. data/lib/authentasaurus/authorization.rb +0 -344
  48. data/lib/authentasaurus/configuration.rb +0 -30
  49. data/lib/authentasaurus/railtie.rb +0 -10
  50. data/lib/generators/authentasaurus/install/USAGE +0 -5
  51. data/lib/generators/authentasaurus/install/install_generator.rb +0 -10
  52. data/lib/generators/authentasaurus/install/templates/authentasaurus_tasks.rake +0 -48
  53. data/lib/generators/authentasaurus/install/templates/defaults.yml +0 -57
  54. data/lib/generators/authentasaurus/views/USAGE +0 -13
  55. data/lib/generators/authentasaurus/views/templates/areas/edit.html.erb +0 -7
  56. data/lib/generators/authentasaurus/views/templates/areas/index.html.erb +0 -11
  57. data/lib/generators/authentasaurus/views/templates/areas/new.html.erb +0 -7
  58. data/lib/generators/authentasaurus/views/templates/areas/show.html.erb +0 -7
  59. data/lib/generators/authentasaurus/views/templates/authentasaurus_emailer/invitation_mail.html.erb +0 -4
  60. data/lib/generators/authentasaurus/views/templates/authentasaurus_emailer/recovery_mail.html.erb +0 -7
  61. data/lib/generators/authentasaurus/views/templates/authentasaurus_emailer/validation_mail.html.erb +0 -6
  62. data/lib/generators/authentasaurus/views/templates/groups/edit.html.erb +0 -7
  63. data/lib/generators/authentasaurus/views/templates/groups/index.html.erb +0 -11
  64. data/lib/generators/authentasaurus/views/templates/groups/new.html.erb +0 -7
  65. data/lib/generators/authentasaurus/views/templates/groups/show.html.erb +0 -7
  66. data/lib/generators/authentasaurus/views/templates/permissions/edit.html.erb +0 -19
  67. data/lib/generators/authentasaurus/views/templates/permissions/index.html.erb +0 -17
  68. data/lib/generators/authentasaurus/views/templates/permissions/new.html.erb +0 -19
  69. data/lib/generators/authentasaurus/views/templates/permissions/show.html.erb +0 -7
  70. data/lib/generators/authentasaurus/views/templates/recoveries/edit.html.erb +0 -24
  71. data/lib/generators/authentasaurus/views/templates/recoveries/new.html.erb +0 -15
  72. data/lib/generators/authentasaurus/views/templates/registrations/new.html.erb +0 -21
  73. data/lib/generators/authentasaurus/views/templates/sessions/new.html.erb +0 -41
  74. data/lib/generators/authentasaurus/views/templates/sessions/no_access.html.erb +0 -1
  75. data/lib/generators/authentasaurus/views/templates/user_invitations/index.html.erb +0 -14
  76. data/lib/generators/authentasaurus/views/templates/user_invitations/new.html.erb +0 -9
  77. data/lib/generators/authentasaurus/views/templates/users/edit.html.erb +0 -27
  78. data/lib/generators/authentasaurus/views/templates/users/index.html.erb +0 -19
  79. data/lib/generators/authentasaurus/views/templates/users/new.html.erb +0 -27
  80. data/lib/generators/authentasaurus/views/templates/users/show.html.erb +0 -11
  81. data/lib/generators/authentasaurus/views/templates/validations/resend_validation_email.html.erb +0 -6
  82. data/lib/generators/authentasaurus/views/templates/validations/validate.html.erb +0 -6
  83. data/lib/generators/authentasaurus/views/views_generator.rb +0 -76
  84. data/rdoc/apple-touch-icon.png +0 -0
  85. data/rdoc/classes/Authentasaurus.html +0 -65
  86. data/rdoc/classes/Authentasaurus/Ac.html +0 -72
  87. data/rdoc/classes/Authentasaurus/Ac/ActsAsOverrider.html +0 -104
  88. data/rdoc/classes/Authentasaurus/Ac/ActsAsOverrider/ClassMethods.html +0 -397
  89. data/rdoc/classes/Authentasaurus/Ac/Routing.html +0 -61
  90. data/rdoc/classes/Authentasaurus/Ac/Routing/InstanceMethods.html +0 -390
  91. data/rdoc/classes/Authentasaurus/Ar.html +0 -77
  92. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatable.html +0 -107
  93. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatable/ClassMethods.html +0 -168
  94. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatable/InstanceMethods.html +0 -357
  95. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatableValidatable.html +0 -109
  96. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatableValidatable/ClassMethods.html +0 -113
  97. data/rdoc/classes/Authentasaurus/Ar/ActsAsAuthenticatableValidatable/InstanceMethods.html +0 -54
  98. data/rdoc/classes/Authentasaurus/Ar/ActsAsOverrider.html +0 -104
  99. data/rdoc/classes/Authentasaurus/Ar/ActsAsOverrider/ClassMethods.html +0 -320
  100. data/rdoc/classes/Authentasaurus/Ar/Authenticatable.html +0 -104
  101. data/rdoc/classes/Authentasaurus/Ar/Authenticatable/ClassMethods.html +0 -182
  102. data/rdoc/classes/Authentasaurus/Ar/Migrations.html +0 -63
  103. data/rdoc/classes/Authentasaurus/Ar/Migrations/Columns.html +0 -68
  104. data/rdoc/classes/Authentasaurus/Ar/Migrations/Columns/InstanceMethods.html +0 -106
  105. data/rdoc/classes/Authentasaurus/Ar/Migrations/Tables.html +0 -68
  106. data/rdoc/classes/Authentasaurus/Ar/Migrations/Tables/InstanceMethods.html +0 -703
  107. data/rdoc/classes/Authentasaurus/Arel.html +0 -65
  108. data/rdoc/classes/Authentasaurus/Arel/ActsAsAuthenticatable.html +0 -107
  109. data/rdoc/classes/Authentasaurus/Arel/ActsAsAuthenticatable/ClassMethods.html +0 -139
  110. data/rdoc/classes/Authentasaurus/Arel/ActsAsAuthenticatable/InstanceMethods.html +0 -113
  111. data/rdoc/classes/Authentasaurus/Arel/Authenticatable.html +0 -105
  112. data/rdoc/classes/Authentasaurus/Arel/Authenticatable/ClassMethods.html +0 -119
  113. data/rdoc/classes/Authentasaurus/Authorization.html +0 -230
  114. data/rdoc/classes/Authentasaurus/Authorization/ActionController.html +0 -63
  115. data/rdoc/classes/Authentasaurus/Authorization/ActionController/ClassMethods.html +0 -263
  116. data/rdoc/classes/Authentasaurus/Authorization/ActionController/InstanceMethods.html +0 -54
  117. data/rdoc/classes/Authentasaurus/Authorization/ActionView.html +0 -54
  118. data/rdoc/classes/Authentasaurus/Authorization/CommonInstanceMethods.html +0 -240
  119. data/rdoc/created.rid +0 -1
  120. data/rdoc/css/main.css +0 -278
  121. data/rdoc/css/panel.css +0 -383
  122. data/rdoc/css/reset.css +0 -53
  123. data/rdoc/favicon.ico +0 -0
  124. data/rdoc/files/README_rdoc.html +0 -366
  125. data/rdoc/files/TODO.html +0 -64
  126. data/rdoc/files/lib/authentasaurus/ac/acts_as_overrider_rb.html +0 -52
  127. data/rdoc/files/lib/authentasaurus/ac/routing_rb.html +0 -60
  128. data/rdoc/files/lib/authentasaurus/ar/acts_as_authenticatable_rb.html +0 -52
  129. data/rdoc/files/lib/authentasaurus/ar/acts_as_authenticatable_validatable_rb.html +0 -52
  130. data/rdoc/files/lib/authentasaurus/ar/acts_as_overrider_rb.html +0 -52
  131. data/rdoc/files/lib/authentasaurus/ar/authenticatable_rb.html +0 -52
  132. data/rdoc/files/lib/authentasaurus/ar/migrations_rb.html +0 -52
  133. data/rdoc/files/lib/authentasaurus/arel/acts_as_authenticatable_rb.html +0 -52
  134. data/rdoc/files/lib/authentasaurus/arel/authenticatable_rb.html +0 -72
  135. data/rdoc/files/lib/authentasaurus/authorization_rb.html +0 -208
  136. data/rdoc/i/arrows.png +0 -0
  137. data/rdoc/i/results_bg.png +0 -0
  138. data/rdoc/i/tree_bg.png +0 -0
  139. data/rdoc/index.html +0 -15
  140. data/rdoc/js/jquery-1.3.2.min.js +0 -19
  141. data/rdoc/js/jquery-effect.js +0 -593
  142. data/rdoc/js/main.js +0 -22
  143. data/rdoc/js/searchdoc.js +0 -628
  144. data/rdoc/panel/index.html +0 -71
  145. data/rdoc/panel/search_index.js +0 -1
  146. data/rdoc/panel/tree.js +0 -1
@@ -1,75 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module AreasController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
- def index
9
- @areas= Area.find :all
10
-
11
- respond_to do |format|
12
- format.html
13
- end
14
- end
15
-
16
- def show
17
- @area = Area.find params[:id]
18
-
19
- respond_to do |format|
20
- format.html
21
- end
22
- end
23
-
24
- def new
25
- @area = Area.new
26
-
27
- respond_to do |format|
28
- format.html
29
- end
30
- end
31
-
32
- def create
33
- @area = Area.new params[:area]
34
-
35
- respond_to do |format|
36
- if @area.save
37
- format.html { redirect_to :action=>:index, :notice => "Area Created" }
38
- else
39
- flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :areas])
40
- format.html { render :new }
41
- end
42
- end
43
- end
44
-
45
- def edit
46
- @area = Area.find params[:id]
47
-
48
- respond_to do |format|
49
- format.html
50
- end
51
- end
52
-
53
- def update
54
- @area = Area.find params[:id]
55
-
56
- respond_to do |format|
57
- if @area.update_attributes(params[:area])
58
- format.html { redirect_to :action => :index, :notice => "Area updated" }
59
- else
60
- flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :areas])
61
- format.html { render :edit }
62
- end
63
- end
64
- end
65
-
66
- def destroy
67
- @area = Area.find params[:id]
68
- @area.destroy
69
-
70
- respond_to do |format|
71
- format.html { redirect_to :action=>:index }
72
- end
73
- end
74
- end
75
- end
@@ -1,77 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module GroupsController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
-
9
- def index
10
- @groups = Group.find :all
11
-
12
- respond_to do |format|
13
- format.html
14
- end
15
- end
16
-
17
- def show
18
- @group = Group.find params[:id]
19
-
20
- respond_to do |format|
21
- format.html
22
- end
23
- end
24
-
25
- def new
26
- @group = Group.new
27
-
28
- respond_to do |format|
29
- format.html
30
- end
31
- end
32
-
33
- def create
34
- @group = Group.new params[:group]
35
-
36
- respond_to do |format|
37
- if @group.save
38
- format.html { redirect_to :action=>:index, :notice => "Group created" }
39
- else
40
- flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :groups])
41
- format.html { render :new }
42
- end
43
- end
44
- end
45
-
46
- def edit
47
- @group = Group.find params[:id]
48
-
49
- respond_to do |format|
50
- format.html
51
- end
52
- end
53
-
54
- def update
55
- @group = Group.find params[:id]
56
-
57
- respond_to do |format|
58
- if @group.update_attributes(params[:group])
59
- format.html { redirect_to :action => :index, :notice => "Group updated" }
60
- else
61
- flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :groups])
62
- format.html { render :edit }
63
- end
64
- end
65
-
66
- end
67
-
68
- def destroy
69
- @group = Group.find params[:id]
70
- @group.destroy
71
-
72
- respond_to do |format|
73
- format.html { redirect_to :action=>:index }
74
- end
75
- end
76
- end
77
- end
@@ -1,76 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module PermissionsController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
- def index
9
- @permissions = Permission.find :all
10
-
11
- respond_to do |format|
12
- format.html
13
- end
14
- end
15
-
16
- def show
17
- @permission = Permission.find params[:id]
18
-
19
- respond_to do |format|
20
- format.html
21
- end
22
- end
23
-
24
- def new
25
- @permission = Permission.new
26
-
27
- respond_to do |format|
28
- format.html
29
- end
30
- end
31
-
32
- def create
33
- @permission = Permission.new params[:permission]
34
-
35
- respond_to do |format|
36
- if @permission.save
37
- format.html { redirect_to :action=>:index, :notice => "Permission created" }
38
- else
39
- flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :permissions])
40
- format.html { render :new }
41
- end
42
- end
43
- end
44
-
45
- def edit
46
- @permission = Permission.find params[:id]
47
-
48
- respond_to do |format|
49
- format.html
50
- end
51
- end
52
-
53
- def update
54
- @permission = Permission.find params[:id]
55
-
56
- respond_to do |format|
57
- if @permission.update_attributes(params[:permission])
58
- flash.now[:notice] = "Permission updated"
59
- format.html { redirect_to :action => :index }
60
- else
61
- flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :permissions])
62
- format.html { render :edit }
63
- end
64
- end
65
- end
66
-
67
- def destroy
68
- @permission = Permission.find params[:id]
69
- @permission.destroy
70
-
71
- respond_to do |format|
72
- format.html { redirect_to :action=>:index }
73
- end
74
- end
75
- end
76
- end
@@ -1,67 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module RecoveriesController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
- def new
9
- @recovery = Recovery.new
10
-
11
- respond_to do |format|
12
- format.html
13
- end
14
- end
15
-
16
- def create
17
- @recovery = Recovery.find_or_initialize_by_email :email => params[:email]
18
-
19
- if @recovery.new_record?
20
- @recovery.user = User.find_by_email @recovery.email
21
- end
22
-
23
- respond_to do |format|
24
- if @recovery.save
25
- @recovery.touch
26
- format.html { redirect_to new_authentasaurus_session_path, :notice => t(:recovery_email_sent, :scope => [:authentasaurus, :messages, :recoveries], :email => @recovery.email) }
27
- else
28
- format.html {render :new}
29
- end
30
- end
31
- end
32
-
33
- def edit
34
- @recovery = Recovery.valid.find_by_token(params[:token])
35
-
36
- respond_to do |format|
37
- unless @recovery.nil?
38
- @user = @recovery.user
39
- format.html
40
- else
41
- format.html { redirect_to new_authentasaurus_session_path, :alert => t(:recovery_failed, :scope => [:authentasaurus, :messages, :recoveries], :email => params[:email]) }
42
- end
43
- end
44
- end
45
-
46
- def destroy
47
- @recovery = Recovery.find_by_token params[:token]
48
- @user = @recovery.user
49
-
50
- respond_to do |format|
51
- empty_fields = params[:user].select { |key, value| value.blank? }
52
- if !empty_fields.empty?
53
- empty_fields.each do |f|
54
- @user.errors.add_to_base t(:recovery_field_blank, :scope => [:authentasaurus, :messages, :recoveries], :field => f.first.humanize)
55
- end
56
- format.html { render :edit }
57
- elsif @user.update_attributes params[:user]
58
- @recovery.destroy
59
- format.html { redirect_to new_authentasaurus_session_path, :notice => t(:recovery_successful, :scope => [:authentasaurus, :messages, :recoveries], :email => params[:email]) }
60
- else
61
- flash.now[:alert] = t(:recovery_failed, :scope => [:authentasaurus, :messages, :recoveries], :email => params[:email])
62
- format.html { render :edit }
63
- end
64
- end
65
- end
66
- end
67
- end
@@ -1,40 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module RegistrationsController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
- def new
9
- @user = User.new
10
- @user_invitation = UserInvitation.find_by_token params[:token]
11
-
12
- respond_to do |format|
13
- if @user_invitation.nil?
14
- format.html {redirect_to new_authentasaurus_session_path, :alert => t(:invalid_invitation_token, :scope => [:authentasaurus, :messages, :user_invitations])}
15
- else
16
- @user.email = @user_invitation.email
17
- format.html
18
- end
19
- end
20
- end
21
-
22
- def create
23
- @user = User.new params[:user]
24
- user_invitation = UserInvitation.find_by_token params[:token]
25
-
26
- respond_to do |format|
27
- unless user_invitation.nil?
28
- if @user.save
29
- format.html {redirect_to new_authentasaurus_session_path}
30
- else
31
- format.html {render :new}
32
- end
33
- else
34
- flash.now[:alert] = t(:invalid_invitation_token, :scope => [:authentasaurus, :messages, :user_invitations])
35
- format.html {render :new}
36
- end
37
- end
38
- end
39
- end
40
- end
@@ -1,57 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module SessionsController
3
- extend ActiveSupport::Concern
4
-
5
- included do
6
- before_filter :check_is_logged_in, :except => [:destroy, :no_access]
7
- end
8
-
9
- module ClassMethods
10
- end
11
-
12
- def new
13
- @session = AuthentasaurusSession.new
14
-
15
- respond_to do |format|
16
- format.html
17
- end
18
- end
19
-
20
- def create
21
- @session = AuthentasaurusSession.new params[:authentasaurus_session]
22
-
23
- respond_to do |format|
24
- if @session.save(self.class.user_model)
25
- if @session.remember == "1"
26
- cookies.signed.permanent[:remember_me_token] = @session.user.remember_me_token
27
- end
28
- session[:user_id] = @session.user.id
29
- if @session.user.respond_to?(:permissions)
30
- session[:user_permissions] = {:read => @session.user.permissions.collect{|per| per.area.name if per.read}, :write => @session.user.permissions.collect{|per| per.area.name if per.write}}
31
- end
32
- format.html { redirect_to session[:original_url] || (defined?(authentasaurus_signin_redirect_path).nil? ? root_path : authentasaurus_signin_redirect_path) }
33
- else
34
- format.html { render :action => :new }
35
- end
36
- end
37
-
38
- end
39
-
40
- def destroy
41
- session[:user_id] = nil
42
- session[:user_permissions] = nil
43
- cookies.delete :remember_me_token
44
-
45
- respond_to do |format|
46
- format.html { redirect_to :action => :new }
47
- end
48
- end
49
-
50
- private
51
- def check_is_logged_in
52
- if is_logged_in?
53
- redirect_to defined?(authentasaurus_signin_redirect_path).nil? ? root_path : authentasaurus_signin_redirect_path
54
- end
55
- end
56
- end
57
- end
@@ -1,45 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module UserInvitationsController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
- def index
9
- @invitations = UserInvitation.find :all
10
-
11
- respond_to do |format|
12
- format.html
13
- end
14
- end
15
-
16
- def new
17
- @invitation = UserInvitation.new
18
-
19
- respond_to do |format|
20
- format.html
21
- end
22
- end
23
-
24
- def create
25
- @invitation = UserInvitation.new params[:user_invitation]
26
-
27
- respond_to do |format|
28
- if @invitation.save
29
- format.html { redirect_to :action => :index }
30
- else
31
- format.html {render :new}
32
- end
33
- end
34
- end
35
-
36
- def destroy
37
- invitation = UserInvitation.find params[:id]
38
- invitation.destroy
39
-
40
- respond_to do |format|
41
- format.html { redirect_to :action => :index }
42
- end
43
- end
44
- end
45
- end
@@ -1,75 +0,0 @@
1
- module Authentasaurus::Ac::Controllers
2
- module UsersController
3
- extend ActiveSupport::Concern
4
-
5
- module ClassMethods
6
- end
7
-
8
- def index
9
- @users = User.all
10
-
11
- respond_to do |format|
12
- format.html
13
- end
14
- end
15
-
16
- def show
17
- @user = User.find(params[:id])
18
-
19
- respond_to do |format|
20
- format.html
21
- end
22
- end
23
-
24
- def new
25
- @user = User.new
26
-
27
- respond_to do |format|
28
- format.html
29
- end
30
- end
31
-
32
- def create
33
- @user = User.new params[:user]
34
-
35
- respond_to do |format|
36
- if @user.save
37
- format.html { redirect_to :action=>:index, :notice => "User saved successfully" }
38
- else
39
- flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :users])
40
- format.html { render :new }
41
- end
42
- end
43
- end
44
-
45
- def edit
46
- @user = User.find params[:id]
47
-
48
- respond_to do |format|
49
- format.html
50
- end
51
- end
52
-
53
- def update
54
- @user = User.find params[:id]
55
-
56
- respond_to do |format|
57
- if @user.update_attributes(params[:user])
58
- format.html { redirect_to :action => :index, :notice => "User updated" }
59
- else
60
- flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :users])
61
- format.html { render :edit }
62
- end
63
- end
64
- end
65
-
66
- def destroy
67
- @user = User.find params[:id]
68
- @user.destroy
69
-
70
- respond_to do |format|
71
- format.html { redirect_to :action=>:index }
72
- end
73
- end
74
- end
75
- end