]> git.wh0rd.org Git - tt-rss.git/commitdiff
password change feedback
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Nov 2005 06:38:13 +0000 (07:38 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Nov 2005 06:38:13 +0000 (07:38 +0100)
backend.php

index 0322743baddc5ffbbb85c71e748355c575f0b606..fe2245fae592a6e8d78c524e663538d8753a08b3 100644 (file)
                                if (db_num_rows($result) == 1) {
                                        db_query($link, "UPDATE ttrss_users SET pwd_hash = '$new_pw_hash' 
                                                WHERE id = '$active_uid'");                             
+
+                                       $_SESSION["pwd_change_result"] = "ok";
+                               } else {
+                                       $_SESSION["pwd_change_result"] = "failed";                                      
                                }
                        }
 
                        header("Location: prefs.php");
-       
+
                } else if ($subop == "Reset to defaults") {
 
                        if (WEB_DEMO_MODE) return;
                                                pwd_hash = 'SHA1:".sha1("password")."')");
 
                                if (db_num_rows($result) != 0) {
-                                       print "<div class=\"warning\"><b>Warning</b>: 
+                                       print "<div class=\"warning\"> 
                                                Your password is at default value, please change it.
                                        </div>";
                                }
 
+                               if ($_SESSION["pwd_change_result"] == "failed") {
+                                       print "<div class=\"warning\"> 
+                                                       There was an error while changing your password.
+                                               </div>";
+                               }
+
+                               if ($_SESSION["pwd_change_result"] == "ok") {
+                                       print "<div class=\"notice\"> 
+                                                       Password changed successfully.
+                                               </div>";
+                               }
+
+                               $_SESSION["pwd_change_result"] = "";
+
                                print "<form action=\"backend.php\" method=\"POST\">";
        
                                print "<table width=\"100%\" class=\"prefPrefsList\">";