]>
git.wh0rd.org - tt-rss.git/blob - classes/pref/prefs.php
2 class Pref_Prefs
extends Handler_Protected
{
4 function csrf_ignore($method) {
5 $csrf_ignored = array("index", "updateself");
7 return array_search($method, $csrf_ignored) !== false;
10 function changepassword() {
12 $old_pw = $_POST["old_password"];
13 $new_pw = $_POST["new_password"];
14 $con_pw = $_POST["confirm_password"];
17 print "ERROR: ".__("Old password cannot be blank.");
22 print "ERROR: ".__("New password cannot be blank.");
26 if ($new_pw != $con_pw) {
27 print "ERROR: ".__("Entered passwords do not match.");
31 $module_class = "auth_" . $_SESSION["auth_module"];
32 $authenticator = new $module_class($this->link
);
34 if (method_exists($authenticator, "change_password")) {
35 print $authenticator->change_password($_SESSION["uid"], $old_pw, $new_pw);
37 print "ERROR: ".__("Function not supported by authentication module.");
41 function saveconfig() {
43 $_SESSION["prefs_cache"] = false;
45 $orig_theme = get_pref($this->link
, "_THEME_ID");
47 foreach (array_keys($_POST) as $pref_name) {
49 $pref_name = db_escape_string($pref_name);
50 $value = db_escape_string($_POST[$pref_name]);
52 if ($pref_name == 'DIGEST_PREFERRED_TIME') {
53 if (get_pref($this->link
, 'DIGEST_PREFERRED_TIME') != $value) {
55 db_query($this->link
, "UPDATE ttrss_users SET
56 last_digest_sent = NULL WHERE id = " . $_SESSION['uid']);
61 set_pref($this->link
, $pref_name, $value);
65 if ($orig_theme != get_pref($this->link
, "_THEME_ID")) {
66 print "PREFS_THEME_CHANGED";
68 print __("The configuration was saved.");
74 $pref_name = db_escape_string($_REQUEST["pn"]);
76 $result = db_query($this->link
, "SELECT help_text FROM ttrss_prefs
77 WHERE pref_name = '$pref_name'");
79 if (db_num_rows($result) > 0) {
80 $help_text = db_fetch_result($result, 0, "help_text");
83 printf(__("Unknown option: %s"), $pref_name);
87 function changeemail() {
89 $email = db_escape_string($_POST["email"]);
90 $full_name = db_escape_string($_POST["full_name"]);
92 $active_uid = $_SESSION["uid"];
94 db_query($this->link
, "UPDATE ttrss_users SET email = '$email',
95 full_name = '$full_name' WHERE id = '$active_uid'");
97 print __("Your personal data has been saved.");
102 function resetconfig() {
104 $_SESSION["prefs_op_result"] = "reset-to-defaults";
106 if ($_SESSION["profile"]) {
107 $profile_qpart = "profile = '" . $_SESSION["profile"] . "'";
109 $profile_qpart = "profile IS NULL";
112 db_query($this->link
, "DELETE FROM ttrss_user_prefs
113 WHERE $profile_qpart AND owner_uid = ".$_SESSION["uid"]);
115 initialize_user_prefs($this->link
, $_SESSION["uid"], $_SESSION["profile"]);
117 print "PREFS_THEME_CHANGED";
122 global $access_level_names;
124 $prefs_blacklist = array("HIDE_READ_FEEDS", "FEEDS_SORT_BY_UNREAD",
125 "STRIP_UNSAFE_TAGS");
127 $profile_blacklist = array("ALLOW_DUPLICATE_POSTS", "PURGE_OLD_DAYS",
128 "PURGE_UNREAD_ARTICLES", "DIGEST_ENABLE", "DIGEST_CATCHUP",
129 "BLACKLISTED_TAGS", "ENABLE_API_ACCESS", "UPDATE_POST_ON_CHECKSUM_CHANGE",
130 "DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE",
131 "SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME");
134 $_SESSION["prefs_op_result"] = "";
136 print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
137 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data / Authentication')."\">";
139 print "<form dojoType=\"dijit.form.Form\" id=\"changeUserdataForm\">";
141 print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
142 evt.preventDefault();
143 if (this.validate()) {
144 notify_progress('Saving data...', true);
146 new Ajax.Request('backend.php', {
147 parameters: dojo.objectToQuery(this.getValues()),
148 onComplete: function(transport) {
149 notify_callback2(transport);
155 print "<table width=\"100%\" class=\"prefPrefsList\">";
157 print "<h2>" . __("Personal data") . "</h2>";
159 $result = db_query($this->link
, "SELECT email,full_name,otp_enabled,
160 access_level FROM ttrss_users
161 WHERE id = ".$_SESSION["uid"]);
163 $email = htmlspecialchars(db_fetch_result($result, 0, "email"));
164 $full_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
165 $otp_enabled = sql_bool_to_bool(db_fetch_result($result, 0, "otp_enabled"));
167 print "<tr><td width=\"40%\">".__('Full name')."</td>";
168 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"full_name\" required=\"1\"
169 value=\"$full_name\"></td></tr>";
171 print "<tr><td width=\"40%\">".__('E-mail')."</td>";
172 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" name=\"email\" required=\"1\" value=\"$email\"></td></tr>";
174 if (!SINGLE_USER_MODE
&& !$_SESSION["hide_hello"]) {
176 $access_level = db_fetch_result($result, 0, "access_level");
177 print "<tr><td width=\"40%\">".__('Access level')."</td>";
178 print "<td>" . $access_level_names[$access_level] . "</td></tr>";
183 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
184 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"changeemail\">";
186 print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
187 __("Save data")."</button>";
191 if ($_SESSION["auth_module"]) {
192 $module_class = "auth_" . $_SESSION["auth_module"];
193 $authenticator = new $module_class($this->link
);
195 $authenticator = false;
198 if ($authenticator && method_exists($authenticator, "change_password")) {
200 print "<h2>" . __("Password") . "</h2>";
202 $result = db_query($this->link
, "SELECT id FROM ttrss_users
203 WHERE id = ".$_SESSION["uid"]." AND pwd_hash
204 = 'SHA1:5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8'");
206 if (db_num_rows($result) != 0) {
207 print format_warning(__("Your password is at default value, please change it."), "default_pass_warning");
210 print "<form dojoType=\"dijit.form.Form\">";
212 print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
213 evt.preventDefault();
214 if (this.validate()) {
215 notify_progress('Changing password...', true);
217 new Ajax.Request('backend.php', {
218 parameters: dojo.objectToQuery(this.getValues()),
219 onComplete: function(transport) {
221 if (transport.responseText.indexOf('ERROR: ') == 0) {
222 notify_error(transport.responseText.replace('ERROR: ', ''));
224 notify_info(transport.responseText);
225 var warn = $('default_pass_warning');
226 if (warn) Element.hide(warn);
234 print_notice("Changing your current password will disable OTP.");
237 print "<table width=\"100%\" class=\"prefPrefsList\">";
239 print "<tr><td width=\"40%\">".__("Old password")."</td>";
240 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\" name=\"old_password\"></td></tr>";
242 print "<tr><td width=\"40%\">".__("New password")."</td>";
244 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\"
245 name=\"new_password\"></td></tr>";
247 print "<tr><td width=\"40%\">".__("Confirm password")."</td>";
249 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\" name=\"confirm_password\"></td></tr>";
253 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
254 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"changepassword\">";
256 print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
257 __("Change password")."</button>";
261 if (version_compare(PHP_VERSION
, '5.3.0') >= 0 && $_SESSION["auth_module"] == "internal") {
263 print "<h2>" . __("One time passwords / Authenticator") . "</h2>";
267 print_notice("One time passwords are currently enabled. Enter your current password below to disable.");
269 print "<form dojoType=\"dijit.form.Form\">";
271 print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
272 evt.preventDefault();
273 if (this.validate()) {
274 notify_progress('Disabling OTP', true);
276 new Ajax.Request('backend.php', {
277 parameters: dojo.objectToQuery(this.getValues()),
278 onComplete: function(transport) {
280 if (transport.responseText.indexOf('ERROR: ') == 0) {
281 notify_error(transport.responseText.replace('ERROR: ', ''));
283 window.location.reload();
290 print "<table width=\"100%\" class=\"prefPrefsList\">";
292 print "<tr><td width=\"40%\">".__("Enter your password")."</td>";
294 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\"
295 name=\"password\"></td></tr>";
299 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
300 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"otpdisable\">";
302 print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
303 __("Disable OTP")."</button>";
309 print "<p>".__("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP.") . "</p>";
311 print "<p>".__("Scan the following code by the Authenticator application:")."</p>";
313 $csrf_token = $_SESSION["csrf_token"];
315 print "<img src=\"backend.php?op=pref-prefs&method=otpqrcode&csrf_token=$csrf_token\">";
317 print "<form dojoType=\"dijit.form.Form\" id=\"changeOtpForm\">";
319 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
320 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"otpenable\">";
322 print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
323 evt.preventDefault();
324 if (this.validate()) {
325 notify_progress('Saving data...', true);
327 new Ajax.Request('backend.php', {
328 parameters: dojo.objectToQuery(this.getValues()),
329 onComplete: function(transport) {
331 if (transport.responseText.indexOf('ERROR: ') == 0) {
332 notify_error(transport.responseText.replace('ERROR: ', ''));
334 window.location.reload();
341 print "<table width=\"100%\" class=\"prefPrefsList\">";
343 print "<tr><td width=\"40%\">".__("Enter your password")."</td>";
345 print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" type=\"password\" required=\"1\"
346 name=\"password\"></td></tr>";
348 print "<tr><td colspan=\"2\">";
350 print "<input dojoType=\"dijit.form.CheckBox\" required=\"1\"
351 type=\"checkbox\" id=\"enable_otp\" name=\"enable_otp\"/> ";
352 print "<label for=\"enable_otp\">".__("I have scanned the code and would like to enable OTP")."</label>";
354 print "</td></tr><tr><td colspan=\"2\">";
359 print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".
360 __("Enable OTP")."</button>";
369 print "</div>"; #pane
371 print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\" title=\"".__('Preferences')."\">";
373 print "<form dojoType=\"dijit.form.Form\" id=\"changeSettingsForm\">";
375 print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
376 evt.preventDefault();
377 if (this.validate()) {
378 console.log(dojo.objectToQuery(this.getValues()));
380 new Ajax.Request('backend.php', {
381 parameters: dojo.objectToQuery(this.getValues()),
382 onComplete: function(transport) {
383 var msg = transport.responseText;
384 if (msg.match('PREFS_THEME_CHANGED')) {
385 window.location.reload();
393 print '<div dojoType="dijit.layout.BorderContainer" gutters="false">';
395 print '<div dojoType="dijit.layout.ContentPane" region="center" style="overflow-y : auto">';
397 if ($_SESSION["profile"]) {
398 print_notice("Some preferences are only available in default profile.");
401 if ($_SESSION["profile"]) {
402 initialize_user_prefs($this->link
, $_SESSION["uid"], $_SESSION["profile"]);
403 $profile_qpart = "profile = '" . $_SESSION["profile"] . "'";
405 initialize_user_prefs($this->link
, $_SESSION["uid"]);
406 $profile_qpart = "profile IS NULL";
409 if ($_SESSION["prefs_show_advanced"])
410 $access_query = "true";
412 $access_query = "(access_level = 0 AND section_id != 3)";
414 $result = db_query($this->link
, "SELECT DISTINCT
415 ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name,
416 ttrss_prefs_sections.order_id,
417 section_name,def_value,section_id
418 FROM ttrss_prefs,ttrss_prefs_types,ttrss_prefs_sections,ttrss_user_prefs
419 WHERE type_id = ttrss_prefs_types.id AND
421 section_id = ttrss_prefs_sections.id AND
422 ttrss_user_prefs.pref_name = ttrss_prefs.pref_name AND
425 owner_uid = ".$_SESSION["uid"]."
426 ORDER BY ttrss_prefs_sections.order_id,short_desc");
430 $active_section = "";
432 while ($line = db_fetch_assoc($result)) {
434 if (in_array($line["pref_name"], $prefs_blacklist)) {
438 if ($_SESSION["profile"] && in_array($line["pref_name"],
439 $profile_blacklist)) {
443 if ($active_section != $line["section_name"]) {
445 if ($active_section != "") {
449 print "<table width=\"100%\" class=\"prefPrefsList\">";
451 $active_section = $line["section_name"];
453 print "<tr><td colspan=\"3\"><h3>".__($active_section)."</h3></td></tr>";
455 if ($line["section_id"] == 2) {
456 print "<tr><td width=\"40%\">".__("Select theme")."</td>";
458 $user_theme = get_pref($this->link
, "_THEME_ID");
459 $themes = get_all_themes();
461 print "<td><select name=\"_THEME_ID\" dojoType=\"dijit.form.Select\">";
462 print "<option value='Default'>".__('Default')."</option>";
463 print "<option value='----------------' disabled=\"1\">--------</option>";
465 foreach ($themes as $t) {
469 if ($base == $user_theme) {
470 $selected = "selected=\"1\"";
475 print "<option $selected value='$base'>$name</option>";
479 print "</select></td></tr>";
486 $type_name = $line["type_name"];
487 $pref_name = $line["pref_name"];
488 $value = $line["value"];
489 $def_value = $line["def_value"];
490 $help_text = $line["help_text"];
492 print "<td width=\"40%\" class=\"prefName\" id=\"$pref_name\">" . __($line["short_desc"]);
494 if ($help_text) print "<div class=\"prefHelp\">".__($help_text)."</div>";
498 print "<td class=\"prefValue\">";
500 if ($pref_name == "USER_TIMEZONE") {
502 $timezones = explode("\n", file_get_contents("lib/timezones.txt"));
504 print_select($pref_name, $value, $timezones, 'dojoType="dijit.form.FilteringSelect"');
505 } else if ($pref_name == "USER_STYLESHEET") {
507 print "<button dojoType=\"dijit.form.Button\"
508 onclick=\"customizeCSS()\">" . __('Customize') . "</button>";
510 } else if ($pref_name == "DEFAULT_ARTICLE_LIMIT") {
512 $limits = array(15, 30, 45, 60);
514 print_select($pref_name, $value, $limits,
515 'dojoType="dijit.form.Select"');
517 } else if ($pref_name == "DEFAULT_UPDATE_INTERVAL") {
519 global $update_intervals_nodefault;
521 print_select_hash($pref_name, $value, $update_intervals_nodefault,
522 'dojoType="dijit.form.Select"');
524 } else if ($type_name == "bool") {
526 if ($value == "true") {
532 if ($pref_name == "PURGE_UNREAD_ARTICLES" && FORCE_ARTICLE_PURGE
!= 0) {
533 $disabled = "disabled=\"1\"";
539 print_radio($pref_name, $value, __("Yes"), array(__("Yes"), __("No")),
542 } else if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', 'DEFAULT_ARTICLE_LIMIT',
543 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT')) !== false) {
545 $regexp = ($type_name == 'integer') ?
'regexp="^\d*$"' : '';
547 if ($pref_name == "PURGE_OLD_DAYS" && FORCE_ARTICLE_PURGE
!= 0) {
548 $disabled = "disabled=\"1\"";
549 $value = FORCE_ARTICLE_PURGE
;
554 print "<input dojoType=\"dijit.form.ValidationTextBox\"
555 required=\"1\" $regexp $disabled
556 name=\"$pref_name\" value=\"$value\">";
558 } else if ($pref_name == "SSL_CERT_SERIAL") {
560 print "<input dojoType=\"dijit.form.ValidationTextBox\"
561 id=\"SSL_CERT_SERIAL\" readonly=\"1\"
562 name=\"$pref_name\" value=\"$value\">";
564 $cert_serial = htmlspecialchars(get_ssl_certificate_id());
565 $has_serial = ($cert_serial) ?
"false" : "true";
567 print " <button dojoType=\"dijit.form.Button\" disabled=\"$has_serial\"
568 onclick=\"insertSSLserial('$cert_serial')\">" .
569 __('Register') . "</button>";
571 print " <button dojoType=\"dijit.form.Button\"
572 onclick=\"insertSSLserial('')\">" .
573 __('Clear') . "</button>";
575 } else if ($pref_name == 'DIGEST_PREFERRED_TIME') {
576 print "<input dojoType=\"dijit.form.ValidationTextBox\"
577 id=\"$pref_name\" regexp=\"[012]?\d:\d\d\" placeHolder=\"12:00\"
578 name=\"$pref_name\" value=\"$value\"><div class=\"insensitive\">".
579 T_sprintf("Current server time: %s (UTC)", date("H:i")) . "</div>";
581 $regexp = ($type_name == 'integer') ?
'regexp="^\d*$"' : '';
583 print "<input dojoType=\"dijit.form.ValidationTextBox\"
585 name=\"$pref_name\" value=\"$value\">";
597 print '</div>'; # inside pane
598 print '<div dojoType="dijit.layout.ContentPane" region="bottom">';
600 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
601 print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"saveconfig\">";
603 print "<button dojoType=\"dijit.form.Button\" type=\"submit\">".
604 __('Save configuration')."</button> ";
606 print "<button dojoType=\"dijit.form.Button\" onclick=\"return editProfiles()\">".
607 __('Manage profiles')."</button> ";
609 print "<button dojoType=\"dijit.form.Button\" onclick=\"return validatePrefsReset()\">".
610 __('Reset to defaults')."</button>";
614 $checked = $_SESSION["prefs_show_advanced"] ?
"checked='1'" : "";
616 print "<input onclick='toggleAdvancedPrefs()'
617 id='prefs_show_advanced'
618 dojoType=\"dijit.form.CheckBox\"
620 type=\"checkbox\"></input>
621 <label for='prefs_show_advanced'>" .
622 __("Show additional preferences") . "</label>";
624 print '</div>'; # inner pane
625 print '</div>'; # border container
628 print "</div>"; #pane
631 if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE
) && CHECK_FOR_NEW_VERSION
) {
632 print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Update Tiny Tiny RSS')."\">";
634 if ($_SESSION["pref_last_version_check"] +
86400 +
rand(-1000, 1000) < time()) {
635 $_SESSION["version_data"] = @check_for_update
($this->link
);
636 $_SESSION["pref_last_version_check"] = time();
639 if (is_array($_SESSION["version_data"])) {
640 $version = $_SESSION["version_data"]["version"];
641 print_notice(T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>$version</b>"));
643 print "<p><button dojoType=\"dijit.form.Button\" onclick=\"return updateSelf()\">".
644 __('Update Tiny Tiny RSS')."</button></p>";
647 print_notice(__("Your Tiny Tiny RSS installation is up to date."));
650 print "</div>"; #pane
653 print "</div>"; #container
656 function updateSelf() {
657 print "<form style='display : block' name='self_update_form' id='self_update_form'>";
659 print "<div class='error'>".__("Do not close this dialog until updating is finished. Backup your tt-rss directory before continuing.")."</div>";
661 print "<ul class='selfUpdateList' id='self_update_log'>";
662 print "<li>" . __("Ready to update.") . "</li>";
665 print "<div class='dlgButtons'>";
666 print "<button id=\"self_update_start_btn\" dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('updateSelfDlg').start()\" >".
667 __("Start update")."</button>";
668 print "<button id=\"self_update_stop_btn\" onclick=\"return dijit.byId('updateSelfDlg').close()\" dojoType=\"dijit.form.Button\">".
669 __("Close this window")."</button>";
674 function performUpdate() {
675 $step = (int) $_REQUEST["step"];
676 $params = json_decode($_REQUEST["params"], true);
677 $force = (bool) $_REQUEST["force"];
679 if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE
) && CHECK_FOR_NEW_VERSION
) {
680 include "update_self.php";
682 print json_encode(update_self_step($this->link
, $step, $params, $force));
686 function toggleAdvanced() {
687 $_SESSION["prefs_show_advanced"] = !$_SESSION["prefs_show_advanced"];
690 function otpqrcode() {
691 require_once "lib/otphp/vendor/base32.php";
692 require_once "lib/otphp/lib/otp.php";
693 require_once "lib/otphp/lib/totp.php";
694 require_once "lib/phpqrcode/phpqrcode.php";
696 $result = db_query($this->link
, "SELECT login,salt,otp_enabled
698 WHERE id = ".$_SESSION["uid"]);
700 $base32 = new Base32();
702 $login = db_fetch_result($result, 0, "login");
703 $otp_enabled = sql_bool_to_bool(db_fetch_result($result, 0, "otp_enabled"));
706 $secret = $base32->encode(sha1(db_fetch_result($result, 0, "salt")));
707 $topt = new \OTPHP\
TOTP($secret);
708 print QRcode
::png($topt->provisioning_uri($login));
712 function otpenable() {
713 $password = db_escape_string($_REQUEST["password"]);
715 $module_class = "auth_" . $_SESSION["auth_module"];
716 $authenticator = new $module_class($this->link
);
717 $enable_otp = $_REQUEST["enable_otp"] == "on";
719 if ($authenticator->check_password($_SESSION["uid"], $password)) {
722 db_query($this->link
, "UPDATE ttrss_users SET otp_enabled = true WHERE
723 id = " . $_SESSION["uid"]);
728 print "ERROR: ".__("Incorrect password");
733 function otpdisable() {
734 $password = db_escape_string($_REQUEST["password"]);
736 $module_class = "auth_" . $_SESSION["auth_module"];
737 $authenticator = new $module_class($this->link
);
739 if ($authenticator->check_password($_SESSION["uid"], $password)) {
741 db_query($this->link
, "UPDATE ttrss_users SET otp_enabled = false WHERE
742 id = " . $_SESSION["uid"]);
746 print "ERROR: ".__("Incorrect password");