diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-12 11:53:21 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-12 11:53:21 +0100 |
commit | ec342d3d91d2cfa8c210722354353cfe8a90a8bc (patch) | |
tree | fa554d5db15f60abafe0e3da806da756114e5e4b /app/controllers/config_snom_controller.rb | |
parent | 2e3bddd415f03aa15cd2759d7c18f64d5545ea80 (diff) |
Add PROVISIONING_KEY_LENGTH as a GsParameter value. #73
Diffstat (limited to 'app/controllers/config_snom_controller.rb')
-rw-r--r-- | app/controllers/config_snom_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb index cb664db..24f6e59 100644 --- a/app/controllers/config_snom_controller.rb +++ b/app/controllers/config_snom_controller.rb @@ -182,9 +182,9 @@ class ConfigSnomController < ApplicationController send_sensitve = @provisioning_authenticated || !@phone.provisioning_key_active @phone_settings = Hash.new() - if defined?(PROVISIONING_KEY_LENGTH) && PROVISIONING_KEY_LENGTH > 0 + if !GsParameter.get('PROVISIONING_KEY_LENGTH').nil? && GsParameter.get('PROVISIONING_KEY_LENGTH') > 0 if @phone.provisioning_key.blank? - @phone.update_attributes({ :provisioning_key => SecureRandom.hex(PROVISIONING_KEY_LENGTH), :provisioning_key_active => false }) + @phone.update_attributes({ :provisioning_key => SecureRandom.hex(GsParameter.get('PROVISIONING_KEY_LENGTH')), :provisioning_key_active => false }) elsif @provisioning_authenticated @phone.update_attributes({ :provisioning_key_active => true }) end |