pref_sections = array( 1 => __('General'), 2 => __('Interface'), 3 => __('Advanced'), 4 => __('Digest') ); $this->pref_help = array( "ALLOW_DUPLICATE_POSTS" => array(__("Allow duplicate posts")), "AUTO_ASSIGN_LABELS" => array(__("Assign articles to labels automatically"), __("")), "BLACKLISTED_TAGS" => array(__("Blacklisted tags"), __("When auto-detecting tags in articles these tags will not be applied (comma-separated list)")), "CDM_AUTO_CATCHUP" => array(__("Automatically mark articles as read"), __("Mark articles as read automatically while you scroll article list.")), "CDM_EXPANDED" => array(__("Automatically expand articles in combined mode"), __("")), "COMBINED_DISPLAY_MODE" => array(__("Combined feed display"), __("Display expanded list of feed articles, instead of separate displays for headlines and article content")), "CONFIRM_FEED_CATCHUP" => array(__("Confirm marking feed as read"), __("")), "DEFAULT_ARTICLE_LIMIT" => array(__("Amount of articles to display at once"), __("")), "DEFAULT_UPDATE_INTERVAL" => array(__("Default feed update interval"), __("")), "DIGEST_CATCHUP" => array(__("Mark articles in e-mail digest as read"), __("")), "DIGEST_ENABLE" => array(__("Enable email digest"), __("This option enables sending daily digest of new (and unread) headlines on your configured e-mail address")), "DIGEST_PREFERRED_TIME" => array(__("Try to send digests around specified time"), __("Uses UTC timezone")), "ENABLE_API_ACCESS" => array(__("Enable external API"), __("")), "ENABLE_FEED_CATS" => array(__("Enable feed categories"), __("")), "FEEDS_SORT_BY_UNREAD" => array(__("Sort feeds by unread articles count"), __("")), "FRESH_ARTICLE_MAX_AGE" => array(__("Maximum age of fresh articles (in hours)"), __("")), "HIDE_READ_FEEDS" => array(__("Hide feeds with no unread articles"), __("")), "HIDE_READ_SHOWS_SPECIAL" => array(__("Show special feeds and labels when hiding read feeds"), __("")), "LONG_DATE_FORMAT" => array(__("Long date format"), __("")), "ON_CATCHUP_SHOW_NEXT_FEED" => array(__("On catchup show next feed"), __("Automatically open next feed with unread articles after marking one as read")), "PURGE_OLD_DAYS" => array(__("Purge articles after this number of days (0 - disables)"), __("")), "PURGE_UNREAD_ARTICLES" => array(__("Purge unread articles"), __("")), "REVERSE_HEADLINES" => array(__("Reverse headline order (oldest first)"), __("")), "SHORT_DATE_FORMAT" => array(__("Short date format"), __("")), "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_UNSAFE_TAGS" => array(__("Strip unsafe tags from articles"), __("Strip all but most common HTML tags when reading articles.")), "USER_CSS_THEME" => array(__("Select theme"), __("Select one of the available CSS themes")), "USER_STYLESHEET" => array(__("Customize stylesheet"), __("Customize CSS stylesheet to your liking")), "USER_TIMEZONE" => array(__("User timezone"), __("")), "VFEED_GROUP_BY_FEED" => array(__("Group headlines in virtual feeds"), __("When this option is enabled, headlines in Special feeds and Labels are grouped by feeds")) ); } function changepassword() { $old_pw = $_POST["old_password"]; $new_pw = $_POST["new_password"]; $con_pw = $_POST["confirm_password"]; if ($old_pw == "") { print "ERROR: ".__("Old password cannot be blank."); return; } if ($new_pw == "") { print "ERROR: ".__("New password cannot be blank."); return; } if ($new_pw != $con_pw) { print "ERROR: ".__("Entered passwords do not match."); return; } global $pluginhost; $authenticator = $pluginhost->get_plugin($_SESSION["auth_module"]); if (method_exists($authenticator, "change_password")) { print $authenticator->change_password($_SESSION["uid"], $old_pw, $new_pw); } else { print "ERROR: ".__("Function not supported by authentication module."); } } function saveconfig() { $_SESSION["prefs_cache"] = false; $boolean_prefs = explode(",", $_POST["boolean_prefs"]); foreach ($boolean_prefs as $pref) { if (!isset($_POST[$pref])) $_POST[$pref] = 'false'; } foreach (array_keys($_POST) as $pref_name) { $pref_name = db_escape_string($this->link, $pref_name); $value = db_escape_string($this->link, $_POST[$pref_name]); if ($pref_name == 'DIGEST_PREFERRED_TIME') { if (get_pref($this->link, 'DIGEST_PREFERRED_TIME') != $value) { db_query($this->link, "UPDATE ttrss_users SET last_digest_sent = NULL WHERE id = " . $_SESSION['uid']); } } set_pref($this->link, $pref_name, $value); } print __("The configuration was saved."); } function getHelp() { $pref_name = db_escape_string($this->link, $_REQUEST["pn"]); $result = db_query($this->link, "SELECT help_text FROM ttrss_prefs WHERE pref_name = '$pref_name'"); if (db_num_rows($result) > 0) { $help_text = db_fetch_result($result, 0, "help_text"); print $help_text; } else { printf(__("Unknown option: %s"), $pref_name); } } function changeemail() { $email = db_escape_string($this->link, $_POST["email"]); $full_name = db_escape_string($this->link, $_POST["full_name"]); $active_uid = $_SESSION["uid"]; db_query($this->link, "UPDATE ttrss_users SET email = '$email', full_name = '$full_name' WHERE id = '$active_uid'"); print __("Your personal data has been saved."); return; } function resetconfig() { $_SESSION["prefs_op_result"] = "reset-to-defaults"; if ($_SESSION["profile"]) { $profile_qpart = "profile = '" . $_SESSION["profile"] . "'"; } else { $profile_qpart = "profile IS NULL"; } db_query($this->link, "DELETE FROM ttrss_user_prefs WHERE $profile_qpart AND owner_uid = ".$_SESSION["uid"]); initialize_user_prefs($this->link, $_SESSION["uid"], $_SESSION["profile"]); } function index() { global $access_level_names; $prefs_blacklist = array("STRIP_UNSAFE_TAGS", "REVERSE_HEADLINES", "SORT_HEADLINES_BY_FEED_DATE", "DEFAULT_ARTICLE_LIMIT"); /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */ $profile_blacklist = array("ALLOW_DUPLICATE_POSTS", "PURGE_OLD_DAYS", "PURGE_UNREAD_ARTICLES", "DIGEST_ENABLE", "DIGEST_CATCHUP", "BLACKLISTED_TAGS", "ENABLE_API_ACCESS", "UPDATE_POST_ON_CHECKSUM_CHANGE", "DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE", "SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME"); $_SESSION["prefs_op_result"] = ""; print "
".__("You will need a compatible Authenticator to use this. Changing your password would automatically disable OTP.") . "
"; print "".__("Scan the following code by the Authenticator application:")."
"; $csrf_token = $_SESSION["csrf_token"]; print ""; print ""; } } } global $pluginhost; $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefPrefsAuth"); print ""; print ""; print " |