]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/prefs.php
add defaultPasswordWarning nag dialog
[tt-rss.git] / classes / pref / prefs.php
index ff778cbceac6fcdf7e595614e3d25a31c7c61912..03563d8b093d220058d70a5884eb25d34d44d4a4 100644 (file)
@@ -207,7 +207,7 @@ class Pref_Prefs extends Handler_Protected {
 
                $email = htmlspecialchars($row["email"]);
                $full_name = htmlspecialchars($row["full_name"]);
-               $otp_enabled = $row["otp_enabled"];
+               $otp_enabled = sql_bool_to_bool($row["otp_enabled"]);
 
                print "<tr><td width=\"40%\">".__('Full name')."</td>";
                print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"full_name\" required=\"1\"
@@ -864,7 +864,7 @@ class Pref_Prefs extends Handler_Protected {
                        $base32 = new Base32();
 
                        $login = $row["login"];
-                       $otp_enabled = $row["otp_enabled"];
+                       $otp_enabled = sql_bool_to_bool($row["otp_enabled"]);
 
                        if (!$otp_enabled) {
                                $secret = $base32->encode(sha1($row["salt"]));
@@ -888,7 +888,7 @@ class Pref_Prefs extends Handler_Protected {
 
                if ($authenticator->check_password($_SESSION["uid"], $password)) {
 
-                       $sth = $this->pdo->prepare("SELECT salt
+                       $sth = $this->pdo->query("SELECT salt
                                FROM ttrss_users
                                WHERE id = ?");
                        $sth->execute([$_SESSION['uid']]);
@@ -920,6 +920,16 @@ class Pref_Prefs extends Handler_Protected {
 
        }
 
+       static function isdefaultpassword() {
+               $authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]);
+
+               if ($authenticator->check_password($_SESSION["uid"], "password")) {
+                       return true;
+               }
+
+               return false;
+       }
+
        function otpdisable() {
                $password = $_REQUEST["password"];