anoubis 1.0.0 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/app/controllers/anoubis/application_controller.rb +22 -6
  4. data/app/controllers/anoubis/core/application_controller.rb +6 -6
  5. data/app/controllers/anoubis/core/index/actions.rb +3 -3
  6. data/app/controllers/anoubis/core/index/callbacks.rb +1 -1
  7. data/app/controllers/anoubis/core/index_controller.rb +7 -7
  8. data/app/controllers/anoubis/data/actions.rb +956 -0
  9. data/app/controllers/anoubis/data/callbacks.rb +66 -0
  10. data/app/controllers/anoubis/data/convert.rb +405 -0
  11. data/app/controllers/anoubis/data/defaults.rb +215 -0
  12. data/app/controllers/anoubis/data/get.rb +529 -0
  13. data/app/controllers/anoubis/data/load.rb +87 -0
  14. data/app/controllers/anoubis/data/set.rb +47 -0
  15. data/app/controllers/anoubis/data/setup.rb +102 -0
  16. data/app/controllers/anoubis/data_controller.rb +21 -0
  17. data/app/controllers/anoubis/etc/base.rb +16 -11
  18. data/app/controllers/anoubis/etc/data.rb +1 -1
  19. data/app/controllers/anoubis/etc/field.rb +10 -10
  20. data/app/controllers/anoubis/etc/field_options.rb +1 -1
  21. data/app/controllers/anoubis/etc/field_order.rb +1 -1
  22. data/app/controllers/anoubis/etc/filter.rb +2 -2
  23. data/app/controllers/anoubis/etc/menu.rb +2 -2
  24. data/app/controllers/anoubis/etc/model.rb +1 -1
  25. data/app/controllers/anoubis/etc/tab_item.rb +1 -1
  26. data/app/controllers/anoubis/etc.rb +1 -1
  27. data/app/controllers/anoubis/export.rb +1 -1
  28. data/app/controllers/anoubis/output/autocomplete.rb +1 -1
  29. data/app/controllers/anoubis/output/basic.rb +2 -2
  30. data/app/controllers/anoubis/output/data.rb +1 -1
  31. data/app/controllers/anoubis/output/delete.rb +1 -1
  32. data/app/controllers/anoubis/output/edit.rb +1 -1
  33. data/app/controllers/anoubis/output/frame.rb +5 -5
  34. data/app/controllers/anoubis/output/login.rb +1 -1
  35. data/app/controllers/anoubis/output/menu.rb +3 -3
  36. data/app/controllers/anoubis/output/update.rb +1 -1
  37. data/app/controllers/anoubis/sso/client/application_controller.rb +2 -2
  38. data/app/controllers/anoubis/sso/client/index/actions.rb +6 -6
  39. data/app/controllers/anoubis/sso/client/index/callbacks.rb +1 -1
  40. data/app/controllers/anoubis/sso/client/index_controller.rb +5 -5
  41. data/app/controllers/anoubis/sso/server/application_controller.rb +2 -2
  42. data/app/controllers/anoubis/sso/server/login_controller.rb +6 -6
  43. data/app/controllers/anoubis/sso/server/user_controller.rb +3 -3
  44. data/app/controllers/anoubis/tenant/application_controller.rb +4 -4
  45. data/app/controllers/anoubis/tenant/index/actions.rb +15 -15
  46. data/app/controllers/anoubis/tenant/index/callbacks.rb +2 -2
  47. data/app/controllers/anoubis/tenant/index_controller.rb +7 -7
  48. data/app/models/anoubis/application_record.rb +90 -2
  49. data/app/models/anoubis/core/application_record.rb +3 -3
  50. data/app/models/anoubis/sso/client/group_menu.rb +6 -6
  51. data/app/models/anoubis/sso/client/menu.rb +8 -8
  52. data/app/models/anoubis/sso/client/user.rb +3 -3
  53. data/app/models/anoubis/sso/server/user.rb +1 -1
  54. data/app/models/anoubis/tenant/group_menu.rb +5 -5
  55. data/app/models/anoubis/tenant/menu.rb +13 -13
  56. data/app/models/anoubis/tenant/system.rb +5 -5
  57. data/app/models/anoubis/tenant/user.rb +4 -4
  58. data/app/services/anoubis/log_service.rb +97 -0
  59. data/app/services/anoubis/request_service.rb +134 -0
  60. data/app/services/anoubis/session_service.rb +1 -1
  61. data/config/locales/en.yml +31 -2
  62. data/config/locales/ru.yml +32 -5
  63. data/config/routes.rb +19 -19
  64. data/db/seeds.rb +30 -30
  65. data/lib/anoubis/version.rb +1 -1
  66. data/lib/anoubis.rb +1 -1
  67. data/spec/controllers/anoubis/index_controller_spec.rb +1 -1
  68. data/spec/dummy/log/development.log +0 -0
  69. data/spec/dummy/log/test.log +0 -0
  70. data/spec/dummy/tmp/development_secret.txt +1 -0
  71. data/spec/models/anoubis/group_locale_spec.rb +1 -1
  72. data/spec/models/anoubis/group_menu_spec.rb +6 -6
  73. data/spec/models/anoubis/group_spec.rb +3 -3
  74. data/spec/models/anoubis/menu_locale_spec.rb +1 -1
  75. data/spec/models/anoubis/menu_spec.rb +1 -1
  76. data/spec/models/anoubis/system_locale_spec.rb +1 -1
  77. data/spec/models/anoubis/system_menu_spec.rb +5 -5
  78. data/spec/models/anoubis/system_spec.rb +4 -4
  79. data/spec/models/anoubis/tenant_spec.rb +4 -4
  80. data/spec/models/anoubis/user_spec.rb +2 -2
  81. metadata +92 -87
  82. data/app/controllers/anoubis/core/data/actions.rb +0 -962
  83. data/app/controllers/anoubis/core/data/callbacks.rb +0 -68
  84. data/app/controllers/anoubis/core/data/convert.rb +0 -407
  85. data/app/controllers/anoubis/core/data/defaults.rb +0 -217
  86. data/app/controllers/anoubis/core/data/get.rb +0 -531
  87. data/app/controllers/anoubis/core/data/load.rb +0 -89
  88. data/app/controllers/anoubis/core/data/set.rb +0 -49
  89. data/app/controllers/anoubis/core/data/setup.rb +0 -104
  90. data/app/controllers/anoubis/core/data_controller.rb +0 -28
  91. data/app/controllers/anoubis/sso/client/data/actions.rb +0 -5
  92. data/app/controllers/anoubis/sso/client/data/callbacks.rb +0 -5
  93. data/app/controllers/anoubis/sso/client/data/convert.rb +0 -5
  94. data/app/controllers/anoubis/sso/client/data/defaults.rb +0 -5
  95. data/app/controllers/anoubis/sso/client/data/get.rb +0 -5
  96. data/app/controllers/anoubis/sso/client/data/load.rb +0 -26
  97. data/app/controllers/anoubis/sso/client/data/set.rb +0 -5
  98. data/app/controllers/anoubis/sso/client/data/setup.rb +0 -5
  99. data/app/controllers/anoubis/sso/client/data_controller.rb +0 -21
  100. data/app/controllers/anoubis/tenant/data/actions.rb +0 -11
  101. data/app/controllers/anoubis/tenant/data/callbacks.rb +0 -11
  102. data/app/controllers/anoubis/tenant/data/convert.rb +0 -11
  103. data/app/controllers/anoubis/tenant/data/defaults.rb +0 -11
  104. data/app/controllers/anoubis/tenant/data/get.rb +0 -11
  105. data/app/controllers/anoubis/tenant/data/load.rb +0 -52
  106. data/app/controllers/anoubis/tenant/data/set.rb +0 -11
  107. data/app/controllers/anoubis/tenant/data/setup.rb +0 -11
  108. data/app/controllers/anoubis/tenant/data_controller.rb +0 -28
  109. data/app/controllers/anoubis/tenants_controller.rb +0 -7
  110. data/app/controllers/anoubis/users_controller.rb +0 -7
  111. data/app/mailers/anoubis/application_mailer.rb +0 -8
@@ -0,0 +1,102 @@
1
+ module Anoubis
2
+ ##
3
+ # Module consists all procedures and functons of {DataController}
4
+ module Data
5
+ ##
6
+ # Module setups system parameters for {DataController}
7
+ module Setup
8
+ ##
9
+ # Setups frame data information. It loads menu data, sets titles and tabs of the frame.
10
+ def setup_frame
11
+ self.load_menu_data
12
+ if self.etc.menu
13
+ self.get_parent_data
14
+ if self.etc.data.parent
15
+ self.output.title = self.etc.menu.page_title.sub '%{title}', self.etc.data.parent.sys_title.to_s
16
+ else
17
+ self.output.title = self.etc.menu.page_title
18
+ end
19
+ self.output.short = self.etc.menu.short_title
20
+ self.output.mode = self.etc.menu.mode
21
+ self.output.access = self.etc.menu.access
22
+ end
23
+ tabs = self.tabs
24
+ tabs.each do |key, item|
25
+ item = self.get_tab key, item
26
+ self.output.addTab(item)
27
+ end
28
+ end
29
+
30
+ ##
31
+ # Setups order for current tab. Parameters is set into {Anoubis::Etc::TabItem#sort self.etc.tab.sort} and
32
+ # {Anoubis::Etc::TabItem#order self.etc.tab.order} attributes.
33
+ def setup_order
34
+ sort = nil
35
+ first = nil
36
+ self.etc.data.fields.each do |key, field|
37
+ if field.order
38
+ first = key if !first
39
+ first = key if field.order.default
40
+ if params.key? :sort
41
+ sort = key if params[:sort] == key.to_s
42
+ end
43
+ end
44
+ end
45
+ sort = first if !sort
46
+ if sort
47
+ self.etc.tab.sort = sort.to_s
48
+ self.etc.tab.order = self.etc.data.fields[sort].order.order
49
+ if params.key? :order
50
+ self.etc.tab.order = :desc if params[:order] == 'desc'
51
+ self.etc.tab.order = :asc if params[:order] == 'asc'
52
+ end
53
+ end
54
+ end
55
+
56
+ ##
57
+ # @!group Block of fields setup functions
58
+
59
+ ##
60
+ # Setups defined fields and places it into attribute {Anoubis::Etc::Data#fields self.etc.data.fields}
61
+ def setup_fields
62
+ if !self.etc.data.fields
63
+ self.etc.data.fields = {}
64
+
65
+ fields = self.fields
66
+
67
+ fields.each_key do |key|
68
+ if fields[key].key? :edit
69
+ if self.menu_access fields[key][:edit], false
70
+ fields[key][:editable] = fields[key][:edit]
71
+ end
72
+ end
73
+ self.etc.data.fields[key] = Anoubis::Etc::Field.new(key, self.get_model, fields[key].merge(action: self.etc.action))
74
+ end
75
+ self.setup_order if %w[index export].include? self.etc.action
76
+ end
77
+ end
78
+
79
+ ##
80
+ # Setups additional parameters for table field with type 'datetime'
81
+ # Resulting data placed in {Etc::Data#fields self.etc.data.fields} (Hash)
82
+ # @param key [Symbol] key of table field.
83
+ def setup_fields_datetime (key)
84
+ self.etc.data.fields[key][:format] = 'full' if !self.etc.data.fields[key].has_key? :format
85
+ self.etc.data.fields[key][:format] = 'full' if !['full', 'month', 'date', 'datetime'].include? self.etc.data.fields[key][:format]
86
+ end
87
+
88
+
89
+
90
+ ##
91
+ # Setups additional parameters for table field with type 'float'
92
+ # Resulting data placed in {Etc::Data#fields self.etc.data.fields} (Hash)
93
+ # @param key [Symbol] key of table field.
94
+ def setup_fields_float (key)
95
+ self.etc.data.fields[key][:precision] = 2 if !self.etc.data.fields[key][:precision]
96
+ self.etc.data.fields[key][:point] = ',' if !self.etc.data.fields[key][:point]
97
+ self.etc.data.fields[key][:separator] = '' if !self.etc.data.fields[key][:separator]
98
+ end
99
+ # @!endgroup
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,21 @@
1
+ require_dependency "anoubis/data/actions"
2
+ require_dependency "anoubis/data/load"
3
+ require_dependency "anoubis/data/get"
4
+ require_dependency "anoubis/data/set"
5
+ require_dependency "anoubis/data/setup"
6
+ require_dependency "anoubis/data/defaults"
7
+ require_dependency "anoubis/data/convert"
8
+ require_dependency "anoubis/data/callbacks"
9
+
10
+ ##
11
+ # Main data controller class
12
+ class Anoubis::DataController < Anoubis::ApplicationController
13
+ include Anoubis::Data::Actions
14
+ include Anoubis::Data::Load
15
+ include Anoubis::Data::Get
16
+ include Anoubis::Data::Set
17
+ include Anoubis::Data::Setup
18
+ include Anoubis::Data::Defaults
19
+ include Anoubis::Data::Convert
20
+ include Anoubis::Data::Callbacks
21
+ end
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Basic system variables class
@@ -6,27 +6,32 @@ module Anubis
6
6
  # @!attribute [rw]
7
7
  # @return [Data, nil] current loaded data or nil if data not loaded.
8
8
  # @note In this attribute placed data when loaded from the model by actions 'table', 'edit', 'update', 'create' etc.
9
- class_attribute :data
9
+ attr_accessor :data
10
10
 
11
11
  # @!attribute [rw]
12
12
  # @return [Menu, nil] menu information for current controller
13
13
  # Returns menu information for current controller. By default sets to <i>nil</i>.
14
- class_attribute :menu, default: nil
14
+ attr_accessor :menu
15
15
 
16
16
  # @!attribute [rw]
17
17
  # @return [TabItem, nil] tab information for current controller
18
18
  # Returns tab information for current controller. By default sets to <i>nil</i>.
19
- class_attribute :tab, default: nil
19
+ attr_accessor :tab
20
20
 
21
21
  # @!attribute [rw]
22
22
  # @return [String] current controller action.
23
23
  # Returns current controller action. By default sets to controller action or ''.
24
- class_attribute :action, default: ''
24
+ attr_accessor :action
25
25
 
26
26
  # @!attribute [rw]
27
27
  # @return [Number] time of request.
28
28
  # Returns time that was requested from client. By default sets to <i>0</i>.
29
- class_attribute :time, default: 0
29
+ attr_accessor :time
30
+
31
+ # @!attribute [rw] version
32
+ # @return [Number] Specifies the api version.
33
+ # Returns API version received from URL. By default sets to <i>0</i>.
34
+ attr_accessor :version
30
35
 
31
36
  ##
32
37
  # Sets default system parameters
@@ -37,14 +42,14 @@ module Anubis
37
42
  self.menu = nil
38
43
  self.tab = nil
39
44
  self.action = ''
45
+ self.time = 0
46
+ self.version = 0
47
+
40
48
 
41
49
  if options.key? :params
42
50
  self.action = options[:params][:action] if options[:params].key? :action
43
- if options[:params].key? :time
44
- self.time = options[:params][:time].to_s.to_i
45
- else
46
- self.time = 0
47
- end
51
+ self.time = options[:params][:time].to_s.to_i if options[:params].key? :time
52
+ self.version = options[:params][:version].to_s.to_i if options[:params].key? :version
48
53
  end
49
54
  end
50
55
  end
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Class stores data information for current controller
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Definitions of field options for table column or new (edit) form field.
@@ -62,7 +62,7 @@ module Anubis
62
62
  class_attribute :options, default: nil
63
63
 
64
64
  # @!attribute [rw]
65
- # Describes if this field could return data for {Anubis::Data::Actions#autocomplete autocomplete} action.
65
+ # Describes if this field could return data for {Anoubis::Data::Actions#autocomplete autocomplete} action.
66
66
  # @return [Boolean] possibility for return data on autocomplete action.
67
67
  #
68
68
  # <b>Options:</b>
@@ -139,21 +139,21 @@ module Anubis
139
139
  end
140
140
 
141
141
  ##
142
- # Initialize additional parameters for {Anubis::Etc::Field#type 'string' field type} for controller actions.
142
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'string' field type} for controller actions.
143
143
  # @param options [Hash] field's initial options
144
144
  def initialize_string (options)
145
145
 
146
146
  end
147
147
 
148
148
  ##
149
- # Initialize additional parameters for {Anubis::Etc::Field#type 'boolean' field type} for controller actions.
149
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'boolean' field type} for controller actions.
150
150
  # @param options [Hash] field's initial options
151
151
  def initialize_boolean (options)
152
152
 
153
153
  end
154
154
 
155
155
  ##
156
- # Initialize additional parameters for {Anubis::Etc::Field#type 'number' field type} for controller actions.
156
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'number' field type} for controller actions.
157
157
  # @param options [Hash] field's initial options
158
158
  def initialize_number (options)
159
159
  if options.key? :error_text
@@ -167,21 +167,21 @@ module Anubis
167
167
  end
168
168
 
169
169
  ##
170
- # Initialize additional parameters for {Anubis::Etc::Field#type 'text' field type} for controller actions.
170
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'text' field type} for controller actions.
171
171
  # @param options [Hash] field's initial options
172
172
  def initialize_text (options)
173
173
 
174
174
  end
175
175
 
176
176
  ##
177
- # Initialize additional parameters for {Anubis::Etc::Field#type 'html' field type} for controller actions.
177
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'html' field type} for controller actions.
178
178
  # @param options [Hash] field's initial options
179
179
  def initialize_html (options)
180
180
 
181
181
  end
182
182
 
183
183
  ##
184
- # Initialize additional parameters for {Anubis::Etc::Field#type 'datetime' field type} for controller actions.
184
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'datetime' field type} for controller actions.
185
185
  # @param options [Hash] field's initial options
186
186
  def initialize_datetime (options)
187
187
  options[:format] = 'datetime' if !options.key? :format
@@ -190,7 +190,7 @@ module Anubis
190
190
  end
191
191
 
192
192
  ##
193
- # Setups additional parameters for {Anubis::Etc::Field#type 'listbox' field type} for controller actions.
193
+ # Setups additional parameters for {Anoubis::Etc::Field#type 'listbox' field type} for controller actions.
194
194
  # @param options [Hash] field's initial options
195
195
  def initialize_listbox (options)
196
196
  self.options = FieldOptions.new if !self.options
@@ -220,7 +220,7 @@ module Anubis
220
220
  end
221
221
 
222
222
  ##
223
- # Initialize additional parameters for {Anubis::Etc::Field#type 'key' field type} for controller actions.
223
+ # Initialize additional parameters for {Anoubis::Etc::Field#type 'key' field type} for controller actions.
224
224
  # @param options [Hash] field's initial options
225
225
  def initialize_key (options)
226
226
  if self.model
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Definitions of fields options list for 'checkbox' and 'listbox' type.
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Definitions of fields order.
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Definitions of filter options for data.
@@ -20,7 +20,7 @@ module Anubis
20
20
 
21
21
  # @!attribute [rw]
22
22
  # Defines reference for fields
23
- # @return [Hash<Anubis::Etc::Field>] hash of fields
23
+ # @return [Hash<Anoubis::Etc::Field>] hash of fields
24
24
  class_attribute :fields, default: nil
25
25
 
26
26
  ##
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Class stores main menu parameters and variables
@@ -83,7 +83,7 @@ module Anubis
83
83
  self.state = options[:state] if options.has_key? :state
84
84
  self.access = options[:access] if options.has_key? :access
85
85
  end
86
- if options.class == Anubis::Sso::Client::Menu
86
+ if options.class == Anoubis::Sso::Client::Menu
87
87
  self.title = options.title
88
88
  self.page_title = options.page_title
89
89
  self.short_title = options.short_title
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Definitions of model options. Class is used for define attached model.
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Etc
3
3
  ##
4
4
  # Definitions of tab options.
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  ##
3
3
  # Module stores systems variables and functions. Module consists of {Base}, {Data}, {Field}, {FieldOptions},
4
4
  # {Menu}, {Model} and {TabItem} classes.
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  class Export
3
3
  class_attribute :data
4
4
  class_attribute :title
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for edit(new) action
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  ##
3
3
  # Module contains all procedures and function for output data. Module consists from {Basic}, {Frame}, {Login} and
4
4
  # {Menu} classes.
@@ -30,7 +30,7 @@ module Anubis
30
30
  self.result = 0
31
31
  self.tab = ''
32
32
  self.messages = {
33
- '0': I18n.t('success'),
33
+ '0': I18n.t('anoubis.success'),
34
34
  '-1': I18n.t('errors.access_not_allowed'),
35
35
  '-2': I18n.t('errors.incorrect_parameters')
36
36
  }
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for default index action
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for destroy action
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for edit(new) action
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for frame action
@@ -16,11 +16,11 @@ module Anubis
16
16
  class_attribute :access
17
17
 
18
18
  # @!attribute [rw] tab_items
19
- # @return [Array] the array of tab elements {Anubis::Output::TabItem}.
19
+ # @return [Array] the array of tab elements {Anoubis::Output::TabItem}.
20
20
  class_attribute :tab_items
21
21
 
22
22
  # @!attribute [rw] tabs
23
- # @return [Hash] the hash of menu elements {Anubis::Output::TabItem} with 'mode' as a key.
23
+ # @return [Hash] the hash of menu elements {Anoubis::Output::TabItem} with 'mode' as a key.
24
24
  class_attribute :tabs
25
25
 
26
26
  ##
@@ -80,11 +80,11 @@ module Anubis
80
80
  class_attribute :hint
81
81
 
82
82
  # @!attribute [rw] button_items
83
- # @return [Array] the array of tab elements {Anubis::Output::FrameButtonItem}.
83
+ # @return [Array] the array of tab elements {Anoubis::Output::FrameButtonItem}.
84
84
  class_attribute :button_items
85
85
 
86
86
  # @!attribute [rw] buttons
87
- # @return [Hash] the hash of menu elements {Anubis::Output::FrameButtonItem} with 'key' as a key.
87
+ # @return [Hash] the hash of menu elements {Anoubis::Output::FrameButtonItem} with 'key' as a key.
88
88
  class_attribute :buttons
89
89
 
90
90
  # @!attribute [rw] filter
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for login action
@@ -1,14 +1,14 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for menu action
5
5
  class Menu < Basic
6
6
  # @!attribute [rw] items
7
- # @return [Array] the array of menu elements {Anubis::Output::MenuItem}.
7
+ # @return [Array] the array of menu elements {Anoubis::Output::MenuItem}.
8
8
  class_attribute :items
9
9
 
10
10
  # @!attribute [rw] keys
11
- # @return [Hash] the hash of menu elements {Anubis::Output::MenuItem} with 'mode' as a key.
11
+ # @return [Hash] the hash of menu elements {Anoubis::Output::MenuItem} with 'mode' as a key.
12
12
  class_attribute :keys
13
13
 
14
14
  # @!attribute [rw] user
@@ -1,4 +1,4 @@
1
- module Anubis
1
+ module Anoubis
2
2
  module Output
3
3
  ##
4
4
  # Output subclass that represents data for update or create action
@@ -1,4 +1,4 @@
1
- class Anubis::Sso::Client::ApplicationController < Anubis::Core::ApplicationController
1
+ class Anoubis::Sso::Client::ApplicationController < Anoubis::Core::ApplicationController
2
2
 
3
3
  def sso_server
4
4
  Rails.configuration.sso_server
@@ -16,7 +16,7 @@ class Anubis::Sso::Client::ApplicationController < Anubis::Core::ApplicationCont
16
16
  begin
17
17
  model = Rails.configuration.user_model.classify.constantize
18
18
  rescue
19
- model = Anubis::Sso::Server::User
19
+ model = Anoubis::Sso::Server::User
20
20
  end
21
21
 
22
22
  model
@@ -1,6 +1,6 @@
1
- module Anubis::Sso::Client::Index::Actions
1
+ module Anoubis::Sso::Client::Index::Actions
2
2
  def menu
3
- self.output = Anubis::Output::Menu.new
3
+ self.output = Anoubis::Output::Menu.new
4
4
 
5
5
  if self.current_user
6
6
  self.output.user = {
@@ -10,7 +10,7 @@ module Anubis::Sso::Client::Index::Actions
10
10
  }
11
11
  end
12
12
 
13
- access = Anubis::Sso::Client::GroupMenu.accesses[:read].to_s+','+Anubis::Sso::Client::GroupMenu.accesses[:write].to_s
13
+ access = Anoubis::Sso::Client::GroupMenu.accesses[:read].to_s+','+Anoubis::Sso::Client::GroupMenu.accesses[:write].to_s
14
14
  query = <<-SQL
15
15
  SELECT `t`.* FROM
16
16
  (
@@ -32,7 +32,7 @@ module Anubis::Sso::Client::Index::Actions
32
32
  )
33
33
  ORDER BY `t`.`menu_id`, `t`.`position`
34
34
  SQL
35
- Anubis::Sso::Client::GroupMenu.find_by_sql(query).each do |data|
35
+ Anoubis::Sso::Client::GroupMenu.find_by_sql(query).each do |data|
36
36
  self.output.addElement({
37
37
  mode: data.mode,
38
38
  title: data.title,
@@ -42,7 +42,7 @@ module Anubis::Sso::Client::Index::Actions
42
42
  tab: data.tab,
43
43
  action: data.action,
44
44
  access: data.access,
45
- state: Anubis::Sso::Client::Menu.states.invert[data.state],
45
+ state: Anoubis::Sso::Client::Menu.states.invert[data.state],
46
46
  parent: data.parent_mode
47
47
  })
48
48
  #self.output[:data].push menu_id[data.id.to_s.to_sym]
@@ -56,7 +56,7 @@ module Anubis::Sso::Client::Index::Actions
56
56
  end
57
57
 
58
58
  def logout
59
- self.output = Anubis::Output::Basic.new
59
+ self.output = Anoubis::Output::Basic.new
60
60
  self.output.result = 0
61
61
 
62
62
  begin
@@ -1,4 +1,4 @@
1
- module Anubis::Sso::Client::Index::Callbacks
1
+ module Anoubis::Sso::Client::Index::Callbacks
2
2
  ##
3
3
  # Calls before menu output data.
4
4
  def before_menu_output
@@ -1,9 +1,9 @@
1
- require_dependency "anubis/sso/client/index/actions"
2
- require_dependency "anubis/sso/client/index/callbacks"
1
+ require_dependency "anoubis/sso/client/index/actions"
2
+ require_dependency "anoubis/sso/client/index/callbacks"
3
3
 
4
- class Anubis::Sso::Client::IndexController < Anubis::Sso::Client::ApplicationController
5
- include Anubis::Sso::Client::Index::Actions
6
- include Anubis::Sso::Client::Index::Callbacks
4
+ class Anoubis::Sso::Client::IndexController < Anoubis::Sso::Client::ApplicationController
5
+ include Anoubis::Sso::Client::Index::Actions
6
+ include Anoubis::Sso::Client::Index::Callbacks
7
7
 
8
8
  ##
9
9
  # Check if authentication required
@@ -1,9 +1,9 @@
1
- class Anubis::Sso::Server::ApplicationController < Anubis::Core::ApplicationController
1
+ class Anoubis::Sso::Server::ApplicationController < Anoubis::Core::ApplicationController
2
2
  def user_model
3
3
  begin
4
4
  model = Rails.configuration.user_model.classify.constantize
5
5
  rescue
6
- model = Anubis::Sso::Server::User
6
+ model = Anoubis::Sso::Server::User
7
7
  end
8
8
 
9
9
  model
@@ -1,4 +1,4 @@
1
- class Anubis::Sso::Server::LoginController < Anubis::Sso::Server::ApplicationController
1
+ class Anoubis::Sso::Server::LoginController < Anoubis::Sso::Server::ApplicationController
2
2
  include ActionController::Cookies
3
3
 
4
4
  def authenticate?
@@ -23,7 +23,7 @@ class Anubis::Sso::Server::LoginController < Anubis::Sso::Server::ApplicationCon
23
23
 
24
24
  result = {
25
25
  result: 0,
26
- message: I18n.t('core.success')
26
+ message: I18n.t('anoubis.success')
27
27
  }
28
28
  code = 200
29
29
 
@@ -107,7 +107,7 @@ class Anubis::Sso::Server::LoginController < Anubis::Sso::Server::ApplicationCon
107
107
  def create
108
108
  result = {
109
109
  result: 0,
110
- message: I18n.t('core.success')
110
+ message: I18n.t('anoubis.success')
111
111
  }
112
112
  code = 200
113
113
 
@@ -155,7 +155,7 @@ class Anubis::Sso::Server::LoginController < Anubis::Sso::Server::ApplicationCon
155
155
  def update
156
156
  result = {
157
157
  result: 0,
158
- message: I18n.t('core.success')
158
+ message: I18n.t('anoubis.success')
159
159
  }
160
160
 
161
161
  if self.system
@@ -213,7 +213,7 @@ class Anubis::Sso::Server::LoginController < Anubis::Sso::Server::ApplicationCon
213
213
  def destroy
214
214
  result = {
215
215
  result: 0,
216
- message: I18n.t('core.success')
216
+ message: I18n.t('anoubis.success')
217
217
  }
218
218
 
219
219
  begin
@@ -263,7 +263,7 @@ class Anubis::Sso::Server::LoginController < Anubis::Sso::Server::ApplicationCon
263
263
  def show
264
264
  result = {
265
265
  result: 0,
266
- message: I18n.t('core.success')
266
+ message: I18n.t('anoubis.success')
267
267
  }
268
268
 
269
269
  if self.system
@@ -1,4 +1,4 @@
1
- class Anubis::Sso::Server::UserController < Anubis::Sso::Server::ApplicationController
1
+ class Anoubis::Sso::Server::UserController < Anoubis::Sso::Server::ApplicationController
2
2
  def authenticate?
3
3
  false
4
4
  end
@@ -6,7 +6,7 @@ class Anubis::Sso::Server::UserController < Anubis::Sso::Server::ApplicationCont
6
6
  def show
7
7
  result = {
8
8
  result: 0,
9
- message: I18n.t('anubis.core.success')
9
+ message: I18n.t('anoubis.success')
10
10
  }
11
11
  code = 200
12
12
 
@@ -25,7 +25,7 @@ class Anubis::Sso::Server::UserController < Anubis::Sso::Server::ApplicationCont
25
25
  def update
26
26
  result = {
27
27
  result: 0,
28
- message: I18n.t('anubis.core.success')
28
+ message: I18n.t('anoubis.success')
29
29
  }
30
30
  code = 200
31
31