From 602c578c43926ea2fd81f826b6d43b1248a95d16 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 15 Mar 2011 11:59:04 +0000 Subject: [PATCH] Default workstation name to something sensible. Like the computer's hostname. But not localhost. Author: Thomas Berezansky Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge git-svn-id: svn://svn.open-ils.org/ILS/trunk@19747 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/main/ws_info.xul | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/main/ws_info.xul b/Open-ILS/xul/staff_client/server/main/ws_info.xul index 1bd51bf18b..40ab695542 100644 --- a/Open-ILS/xul/staff_client/server/main/ws_info.xul +++ b/Open-ILS/xul/staff_client/server/main/ws_info.xul @@ -106,11 +106,17 @@ g.tb = document.getElementById('wsname'); + var dnsService = Components.classes["@mozilla.org/network/dns-service;1"] + .createInstance(Components.interfaces.nsIDNSService); + render_menulist(); document.getElementById('register_btn').disabled = false; document.getElementById('wsname').disabled = false; - document.getElementById('wsname').value = ''; + if(dnsService.myHostName && dnsService.myHostName.toLowerCase() != 'localhost') + g.tb.value = dnsService.myHostName; + else + g.tb.value = ''; document.getElementById('wsname').focus(); } -- 2.11.0