summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-12-03 20:46:27 +0300
committerAndrew Dolgov <[email protected]>2017-12-03 20:46:27 +0300
commit7c0eb1b6210a019926ec69179c81d545ac865b64 (patch)
tree8c57ea7b438156fbbebb880926e73e18e2137453 /classes
parent31e2811a637b1062eafc15a2f3b3b84de9534a0e (diff)
add defaultPasswordWarning nag dialog
Diffstat (limited to 'classes')
-rw-r--r--classes/dlg.php12
-rw-r--r--classes/pref/prefs.php16
2 files changed, 25 insertions, 3 deletions
diff --git a/classes/dlg.php b/classes/dlg.php
index 6f22c81e6..9ac5cd12f 100644
--- a/classes/dlg.php
+++ b/classes/dlg.php
@@ -185,4 +185,16 @@ class Dlg extends Handler_Protected {
//return;
}
+ function defaultPasswordWarning() {
+
+ print_warning(__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication)."));
+
+ print "<div align='center'>";
+ print "<button dojoType=\"dijit.form.Button\" onclick=\"gotoPreferences()\">".
+ __('Open Preferences')."</button> ";
+ print "<button dojoType=\"dijit.form.Button\"
+ onclick=\"return closeInfoBox()\">".
+ __('Close this window')."</button>";
+ print "</div>";
+ }
} \ No newline at end of file
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index ff778cbce..03563d8b0 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -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"];