summaryrefslogtreecommitdiff
path: root/app/controllers/config_snom_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-07 23:29:52 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-07 23:29:52 +0100
commit97e73758b2d61c90dc2d1bdbcfd61f7a80db21a8 (patch)
tree87fc775e6867980451621730e4b760959ee2b96f /app/controllers/config_snom_controller.rb
parentb1fb25f0d6ee481cca54f69ed50e6196595ce777 (diff)
Added PROVISIONING_SET_HTTP_USER and PROVISIONING_SET_HTTP_PASSWORD.
Diffstat (limited to 'app/controllers/config_snom_controller.rb')
-rw-r--r--app/controllers/config_snom_controller.rb20
1 files changed, 10 insertions, 10 deletions
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