summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-27 12:50:57 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-09-27 12:50:57 -0400
commit1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe (patch)
treec9d058cf973fe5eff0b8b815b5c4bc03eafe2c8e
parent13012ff6cbbfa9e61911407210d33a32b4bed44d (diff)
downloadthird_party-cobbler-1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe.tar.gz
third_party-cobbler-1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe.tar.xz
third_party-cobbler-1c06bdb2a556b7b0c28d00517a52afb8af3b2cbe.zip
A small bit of javascript to ensure that the get_random_mac AJAX call, should it fail, will not
set the field to any value that is not a MAC address.
-rw-r--r--cobbler/webui/CobblerWeb.py1
-rw-r--r--webui_templates/system_edit.tmpl5
2 files changed, 5 insertions, 1 deletions
diff --git a/cobbler/webui/CobblerWeb.py b/cobbler/webui/CobblerWeb.py
index bfa257b..3b0c718 100644
--- a/cobbler/webui/CobblerWeb.py
+++ b/cobbler/webui/CobblerWeb.py
@@ -94,6 +94,7 @@ class CobblerWeb(object):
self.token = None
# this should put us back to the login screen
self.__cookie_logout()
+ return False
else:
raise e
diff --git a/webui_templates/system_edit.tmpl b/webui_templates/system_edit.tmpl
index c579970..d3a763c 100644
--- a/webui_templates/system_edit.tmpl
+++ b/webui_templates/system_edit.tmpl
@@ -20,7 +20,10 @@ function get_random_mac()
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
var mac_field = document.getElementById("mac")
- mac_field.value = xmlHttp.responseText;
+ var result = xmlHttp.responseText;
+ if (result.charAt(2) == ':' && result.charAt(5) == ':') {
+ mac_field.value = result;
+ }
}
};
xmlHttp.send(null);