]> git.wh0rd.org Git - tt-rss.git/commitdiff
validate password in prefs form
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 May 2006 05:19:40 +0000 (06:19 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 May 2006 05:19:40 +0000 (06:19 +0100)
backend.php
prefs.js

index 051a5f67049ade47a487316f94cee26d5d6d8e62..a1ddf5b810f1ea061d1d93304503ab5c7dcbb909 100644 (file)
 
                                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>";
                                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>";
index bc6e8667ff0a7b6bcc9bf765e06184c0b7c3a27a..2fc1a117f243db4958483995b550d7ba158cdf23 100644 (file)
--- 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;
+}