"SHOW_CONTENT_PREVIEW" => array(__("Show content preview in headlines list"), ""),
"SORT_HEADLINES_BY_FEED_DATE" => array(__("Sort headlines by feed date"), __("Use feed-specified date to sort headlines instead of local import date.")),
"SSL_CERT_SERIAL" => array(__("Login with an SSL certificate"), __("Click to register your SSL client certificate with tt-rss")),
- "STRIP_IMAGES" => array(__("Do not embed images in articles"), ""),
+ "STRIP_IMAGES" => array(__("Do not embed media in articles"), ""),
"STRIP_UNSAFE_TAGS" => array(__("Strip unsafe tags from articles"), __("Strip all but most common HTML tags when reading articles.")),
"USER_STYLESHEET" => array(__("Customize stylesheet"), __("Customize CSS stylesheet to your liking")),
"USER_TIMEZONE" => array(__("Time zone"), ""),
$_SESSION["prefs_op_result"] = "reset-to-defaults";
- $sth = $this->pdo->query("DELETE FROM ttrss_user_prefs
- WHERE (profile = :profile OR (:profile IS NULL AND profile IS NULL))
+ $sth = $this->pdo->prepare("DELETE FROM ttrss_user_prefs
+ WHERE (profile = :profile OR (:profile IS NULL AND profile IS NULL))
AND owner_uid = :uid");
$sth->execute([":profile" => $_SESSION['profile'], ":uid" => $_SESSION['uid']]);
$prefs_blacklist = array("ALLOW_DUPLICATE_POSTS", "STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES",
"SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT",
- "FEEDS_SORT_BY_UNREAD");
+ "FEEDS_SORT_BY_UNREAD", "CDM_EXPANDED");
/* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */
"DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE",
"SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME");
+ $digest_options = array("DIGEST_ENABLE", "DIGEST_CATCHUP", "DIGEST_PREFERRED_TIME");
+
+ $purge_options = array("PURGE_UNREAD_ARTICLES", "PURGE_OLD_DAYS");
$_SESSION["prefs_op_result"] = "";
continue;
}
+ /* Hide options from the user that are disabled in config.php. */
+ if (FORCE_ARTICLE_PURGE && in_array($pref_name, $purge_options))
+ continue;
+ if (DIGEST_SUBJECT === false && in_array($pref_name, $digest_options))
+ continue;
+
if ($active_section != $line["section_id"]) {
if ($active_section != "") {
$checked = ($value == "true") ? "checked=\"checked\"" : "";
- if ($pref_name == "PURGE_UNREAD_ARTICLES" && FORCE_ARTICLE_PURGE != 0) {
- $disabled = "disabled=\"1\"";
- $checked = "checked=\"checked\"";
- } else {
- $disabled = "";
- }
-
- print "<input type='checkbox' name='$pref_name' $checked $disabled
+ print "<input type='checkbox' name='$pref_name' $checked
dojoType='dijit.form.CheckBox' id='CB_$pref_name' value='1'>";
} else if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE',
$regexp = ($type_name == 'integer') ? 'regexp="^\d*$"' : '';
- if ($pref_name == "PURGE_OLD_DAYS" && FORCE_ARTICLE_PURGE != 0) {
- $disabled = "disabled=\"1\"";
- $value = FORCE_ARTICLE_PURGE;
- } else {
- $disabled = "";
- }
-
print "<input dojoType=\"dijit.form.ValidationTextBox\"
- required=\"1\" $regexp $disabled
+ required=\"1\" $regexp
name=\"$pref_name\" value=\"$value\">";
} else if ($pref_name == "SSL_CERT_SERIAL") {
}
function otpqrcode() {
- require_once "lib/otphp/vendor/base32.php";
- require_once "lib/otphp/lib/otp.php";
- require_once "lib/otphp/lib/totp.php";
require_once "lib/phpqrcode/phpqrcode.php";
$sth = $this->pdo->prepare("SELECT login,salt,otp_enabled
if ($row = $sth->fetch()) {
- $base32 = new Base32();
+ $base32 = new \OTPHP\Base32();
$login = $row["login"];
$otp_enabled = sql_bool_to_bool($row["otp_enabled"]);
}
function otpenable() {
- require_once "lib/otphp/vendor/base32.php";
- require_once "lib/otphp/lib/otp.php";
- require_once "lib/otphp/lib/totp.php";
$password = clean($_REQUEST["password"]);
$otp = clean($_REQUEST["otp"]);
if ($row = $sth->fetch()) {
- $base32 = new Base32();
+ $base32 = new \OTPHP\Base32();
$secret = $base32->encode(sha1($row["salt"]));
$topt = new \OTPHP\TOTP($secret);
$otp_check = $topt->now();
if ($otp == $otp_check) {
- $sth = $this->pdo->prepare("UPDATE ttrss_users
+ $sth = $this->pdo->prepare("UPDATE ttrss_users
SET otp_enabled = true WHERE id = ?");
$sth->execute([$_SESSION['uid']]);
print "<div class='dlgButtons'>
<div style='float : left'>
- <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').removeSelected()\">".
+ <button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').removeSelected()\">".
__('Remove selected profiles')."</button>
<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').activateProfile()\">".
__('Activate profile')."</button>