From 97e73758b2d61c90dc2d1bdbcfd61f7a80db21a8 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 7 Jan 2013 23:29:52 +0100 Subject: Added PROVISIONING_SET_HTTP_USER and PROVISIONING_SET_HTTP_PASSWORD. --- app/controllers/config_snom_controller.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'app/controllers/config_snom_controller.rb') diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb index 123f2cd..7ee8276 100644 --- a/app/controllers/config_snom_controller.rb +++ b/app/controllers/config_snom_controller.rb @@ -199,19 +199,19 @@ class ConfigSnomController < ApplicationController end end - if defined?(PROVISIONING_SET_HTTP_USER) && @phone.http_user.blank? - if PROVISIONING_SET_HTTP_USER.class == Fixnum - @phone.update_attributes({ :http_user => SecureRandom.hex(PROVISIONING_SET_HTTP_USER) }) - elsif PROVISIONING_SET_HTTP_USER.class == String - @phone.update_attributes({ :http_user => PROVISIONING_SET_HTTP_USER }) + if !GsParameter.get('PROVISIONING_SET_HTTP_USER').nil? && @phone.http_user.blank? + if GsParameter.get('PROVISIONING_SET_HTTP_USER').class == Fixnum + @phone.update_attributes({ :http_user => SecureRandom.hex(GsParameter.get('PROVISIONING_SET_HTTP_USER')) }) + elsif GsParameter.get('PROVISIONING_SET_HTTP_USER').class == String + @phone.update_attributes({ :http_user => GsParameter.get('PROVISIONING_SET_HTTP_USER') }) end end - if defined?(PROVISIONING_SET_HTTP_PASSWORD) && @phone.http_password.blank? - if PROVISIONING_SET_HTTP_PASSWORD.class == Fixnum - @phone.update_attributes({ :http_password => SecureRandom.hex(PROVISIONING_SET_HTTP_PASSWORD) }) - elsif PROVISIONING_SET_HTTP_PASSWORD.class == String - @phone.update_attributes({ :http_password => PROVISIONING_SET_HTTP_PASSWORD }) + if !GsParameter.get('PROVISIONING_SET_HTTP_PASSWORD').nil? && @phone.http_password.blank? + if GsParameter.get('PROVISIONING_SET_HTTP_PASSWORD').class == Fixnum + @phone.update_attributes({ :http_password => SecureRandom.hex(GsParameter.get('PROVISIONING_SET_HTTP_PASSWORD')) }) + elsif GsParameter.get('PROVISIONING_SET_HTTP_PASSWORD').class == String + @phone.update_attributes({ :http_password => GsParameter.get('PROVISIONING_SET_HTTP_PASSWORD') }) end end -- cgit v1.2.3