summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.php3
-rw-r--r--prefs.js12
2 files changed, 14 insertions, 1 deletions
diff --git a/backend.php b/backend.php
index 051a5f670..a1ddf5b81 100644
--- a/backend.php
+++ b/backend.php
@@ -3183,7 +3183,7 @@
print "</form>";
- print "<form action=\"backend.php\" method=\"POST\">";
+ print "<form action=\"backend.php\" method=\"POST\" name=\"changePassForm\">";
print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td colspan='3'><h3>Authentication</h3></tr></td>";
@@ -3202,6 +3202,7 @@
print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">";
print "<p><input class=\"button\" type=\"submit\"
+ onclick=\"return validateNewPassword(this.form)\"
value=\"Change password\" name=\"subop\">";
print "</form>";
diff --git a/prefs.js b/prefs.js
index bc6e8667f..2fc1a117f 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1448,3 +1448,15 @@ function browserToggleExpand(id) {
exception_error("browserExpand", e);
}
}
+
+function validateNewPassword(form) {
+ if (form.OLD_PASSWORD.value == "") {
+ alert("Current password cannot be blank");
+ return false;
+ }
+ if (form.NEW_PASSWORD.value == "") {
+ alert("New password cannot be blank");
+ return false;
+ }
+ return true;
+}