Support server/id for server name
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 25 Aug 2011 11:44:03 +0000 (07:44 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 8 Sep 2011 06:42:16 +0000 (02:42 -0400)
Strip off the /id part to get the real server name.
Each /id gets a different workstation registration.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/auth/controller.js
Open-ILS/xul/staff_client/chrome/content/main/main.js

index 2b3a14a..35d885c 100644 (file)
@@ -132,7 +132,7 @@ auth.controller.prototype = {
                                 '', 
                                 'chrome,centerscreen,modal', 
                                 { 
-                                    'location' : 'https://' + obj.controller.view.server_prompt.value, 
+                                    'location' : 'https://' + obj.controller.view.server_prompt.value.match(/^[^\/]*/)
                                     'prefetchCert' : true 
                                 } 
                             );
@@ -291,6 +291,7 @@ auth.controller.prototype = {
                 obj.controller.view.server_prompt.value = url;
             }
         }
+        url = url.match(/^[^\/]*/).toString(); // Only test the pre-slash URL
         obj.controller.view.submit_button.disabled = true;
         obj.controller.view.server_prompt.disabled = true;
         var s = document.getElementById('status');
@@ -427,7 +428,7 @@ auth.controller.prototype = {
         this.controller.view.password_prompt.disabled = true;
         this.controller.view.submit_button.disabled = true;
         this.controller.view.apply_locale_btn.disabled = true;
-        XML_HTTP_SERVER = this.controller.view.server_prompt.value;
+        XML_HTTP_SERVER = this.controller.view.server_prompt.value.match(/^[^\/]*/).toString();
 
         try {
 
index 77e72af..123e3de 100644 (file)
@@ -342,7 +342,7 @@ function main_init() {
 
         G.auth.on_login = function() {
 
-            var url = G.auth.controller.view.server_prompt.value || urls.remote;
+            var url = G.auth.controller.view.server_prompt.value.match(/^[^\/]*/).toString() || urls.remote;
 
             G.data.server_unadorned = url; G.data.stash('server_unadorned'); G.data.stash_retrieve();