summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/gs_parameter.rb18
-rw-r--r--config/initializers/gemeinschaft_parameters.rb84
2 files changed, 13 insertions, 89 deletions
diff --git a/app/models/gs_parameter.rb b/app/models/gs_parameter.rb
index d0cc37a..aac10b0 100644
--- a/app/models/gs_parameter.rb
+++ b/app/models/gs_parameter.rb
@@ -10,19 +10,19 @@ class GsParameter < ActiveRecord::Base
:presence => true,
:inclusion => { :in => ['String', 'Integer', 'Boolean', 'YAML'] }
- def generate_contant
- Kernel.const_set(self.name, self.value.to_i) if self.class_type == 'Integer'
- Kernel.const_set(self.name, self.value.to_s) if self.class_type == 'String'
+ def generate_constant
+ Kernel.const_set(self.name, self.value.to_i) if self.class_type == 'Integer'
+ Kernel.const_set(self.name, self.value.to_s) if self.class_type == 'String'
- if self.class_type == 'Boolean'
- Kernel.const_set(self.name, true) if self.value == 'true'
- Kernel.const_set(self.name, false) if self.value == 'false'
- end
+ if self.class_type == 'Boolean'
+ Kernel.const_set(self.name, true) if self.value == 'true'
+ Kernel.const_set(self.name, false) if self.value == 'false'
+ end
- Kernel.const_set(self.name, YAML.load(self.value)) if self.class_type == 'YAML'
+ Kernel.const_set(self.name, YAML.load(self.value)) if self.class_type == 'YAML'
end
def to_s
- name
+ name
end
end
diff --git a/config/initializers/gemeinschaft_parameters.rb b/config/initializers/gemeinschaft_parameters.rb
index 1624165..dd6b2eb 100644
--- a/config/initializers/gemeinschaft_parameters.rb
+++ b/config/initializers/gemeinschaft_parameters.rb
@@ -1,81 +1,5 @@
-# Use this file to set generic parameters for Gemeinschaft
+# Set some constants.
-GEMEINSCHAFT_VERSION = '5.0.2-nightly-build'
-SUPER_TENANT_NAME = 'Super-Tenant'
-
-# System defaults
-MINIMUM_PIN_LENGTH = 4
-MAXIMUM_PIN_LENGTH = 10
-
-# GUI
-GUI_REDIRECT_HTTPS = false
-
-# Phone numbers
-# Only touch this if you know what you are doing!
-STRICT_INTERNAL_EXTENSION_HANDLING = false
-STRICT_DID_HANDLING = false
-
-# SIP defaults
-DEFAULT_LENGTH_SIP_AUTH_NAME = 10
-DEFAULT_LENGTH_SIP_PASSWORD = 15
-CALL_WAITING = false
-DEFAULT_CLIR_SETTING = false
-DEFAULT_CLIP_SETTING = true
-
-TO_S_MAX_CALLER_NAME_LENGTH = 25
-TO_S_MAX_LENGTH_OF_AUTH_NAME = 6
-
-# Pagination defaults
-DEFAULT_PAGINATION_ENTRIES_PER_PAGE = 50
-
-# Conference defaults
-MAXIMUM_NUMBER_OF_PEOPLE_IN_A_CONFERENCE = 100
-DEFAULT_MAX_CONFERENCE_MEMBERS = 10
-
-# Misc defaults
-MAX_EXTENSION_LENGTH = 6
-
-# Fax defaults
-DEFAULT_NUMBER_OF_RETRIES = 3
-DAYS_TILL_AUTO_DELETE = 90
-
-# Names of PhoneNumberRanges
-INTERNAL_EXTENSIONS = 'internal_extensions'
-SERVICE_NUMBERS = 'service_numbers'
-DIRECT_INWARD_DIALING_NUMBERS = 'direct_inward_dialing_numbers'
-
-# Callthrough defaults
-CALLTHROUGH_HAS_WHITELISTS = true
-
-# Hunt groups
-HUNT_GROUP_STRATEGIES = ['ring_all', 'ring_recursively']
-VALID_SECONDS_BETWEEN_JUMPS_VALUES = (1 .. 60).to_a.map{|x| x * 2}
-
-# Callforward
-DEFAULT_CALL_FORWARD_DEPTH = 1
-MAX_CALL_FORWARD_DEPTH = 40
-CALLFORWARD_DESTINATION_DEFAULT = '+49'
-CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT = true
-
-# Phone
-PROVISIONING_AUTO_ADD_PHONE = true
-PROVISIONING_AUTO_ADD_SIP_ACCOUNT = true
-PROVISIONING_AUTO_TENANT_ID = 2
-PROVISIONING_AUTO_SIP_ACCOUNT_CALLER_PREFIX = 'Gemeinschaft '
-PROVISIONING_IEEE8021X_EAP_USERNAME = ''
-PROVISIONING_IEEE8021X_EAP_PASSWORD = ''
-NIGHTLY_REBOOT_OF_PHONES = true
-SIEMENS_HISTORY_RELOAD_TIMES = {0..6 => 600, 7..20 => 40, 21..24 => 300}
-
-# API configuration
-DEFAULT_API_TENANT_ID = 2
-REMOTE_IP_ADDRESS_WHITELIST = [] # e.g. ['10.0.0.1']
-IMPORT_CSV_FILE = '/var/tmp/ExampleVoipCsvExport.csv'
-DOUBLE_CHECK_POSITIVE_USERS_CSV = '/var/tmp/ExampleDoubleCheckVoipCsvExport.csv'
-IMPORT_CSV_ENCODING = 'UTF-8'
-USER_NAME_PREFIX = 'dtc'
-CALLTHROUGH_NAME_TO_BE_USED_FOR_DEFAULT_ACTIVATION = 'Callthrough for employees'
-
-# GS Cluster configuration
-WRITE_GS_CLUSTER_SYNC_LOG = true
-HOMEBASE_IP_ADDRESS = '0.0.0.0'
+GsParameter.all.each do |gs_parameter|
+ gs_parameter.generate_constant
+end \ No newline at end of file