fixed bug in network IP checking javascript
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 18 Jan 2010 03:29:43 +0000 (03:29 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 18 Jan 2010 03:29:43 +0000 (03:29 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@132 01035d8c-6547-0410-b346-abe4f91aad63

mini-asterisk-gui/Makefile
mini-asterisk-gui/cgi-bin/network.js

index 400f535e0b9bcb6c042fcc3957ff89a7f5ea46b9..e3edc860d17f2872a1270afec6afcd6665c01369 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile
 # David Rowe 1 Jan 2010
 # 
-# Makefile for Easy Asterisk GUI
+# Makefile for Mini Asterisk GUI
 #
 # 1/ Download files to development box for testing:
 #
@@ -30,5 +30,6 @@ static:
        sed -i "s,http://$(HOST)/set_network.sh,network.sh.html," static/$(HOST)/network.sh.html
        sed -i "s,http://$(HOST)/set_ring.sh,phones.sh.html," static/$(HOST)/phones.sh.html
        sed -i "s,http://$(HOST)/set_voiplines.sh,voiplines.sh.html," static/$(HOST)/voiplines.sh.html
+       sed -i "s,url=login.sh,url=phones.sh.html," static/$(HOST)/logout.sh.html
 
 
index 108bf01b81bd5c19173d9af85444e791f1d6a714..a1b7f4362f64c0c4274c9e51181d8d8c090cf001 100644 (file)
@@ -20,12 +20,13 @@ function isIP(obj) {
     var ary = obj.value.split(".");
     var ip = true;
 
-    for (var i=0; i<4; i++) { 
-       ip = (!ary[i].match(/^\d{1,3}$/) || (Number(ary[i]) > 255)) ? false : ip; 
-    } 
-  
-    if (ip)
-       ip = (ary.length == 4); 
+    ip = (ary.length == 4); 
+
+    if (ip) {
+       for (var i=0; i<4; i++) { 
+               ip = (!ary[i].match(/^\d{1,3}$/) || (Number(ary[i]) > 255)) ? false : ip; 
+       } 
+    }
 
     if (!ip) {    
        // the value is NOT a valid IP address