pref_sections = array( 1 => __('General'), 2 => __('Interface'), 3 => __('Advanced'), 4 => __('Digest') ); $this->pref_help = array( "ALLOW_DUPLICATE_POSTS" => array(__("Allow duplicate articles"), ""), "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"), __("This option enables marking 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"), __("Shortest interval at which a feed will be checked for updates regardless of update method")), "DIGEST_CATCHUP" => array(__("Mark articles in e-mail digest as read"), ""), "DIGEST_ENABLE" => array(__("Enable e-mail 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 API access"), __("Allows external clients to access this account through the 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 when hiding read feeds"), ""), "LONG_DATE_FORMAT" => array(__("Long date format"), __("The syntax used is identical to the PHP date() function.")), "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_STYLESHEET" => array(__("Customize stylesheet"), __("Customize CSS stylesheet to your liking")), "USER_TIMEZONE" => array(__("Time zone"), ""), "VFEED_GROUP_BY_FEED" => array(__("Group headlines in virtual feeds"), __("Special feeds, labels, and categories are grouped by originating feeds")), "USER_LANGUAGE" => array(__("Language")), "USER_CSS_THEME" => array(__("Theme"), __("Select one of the available CSS themes")) ); } 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; } $authenticator = PluginHost::getInstance()->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() { $boolean_prefs = explode(",", $_POST["boolean_prefs"]); foreach ($boolean_prefs as $pref) { if (!isset($_POST[$pref])) $_POST[$pref] = 'false'; } $need_reload = false; foreach (array_keys($_POST) as $pref_name) { $pref_name = $this->dbh->escape_string($pref_name); $value = $this->dbh->escape_string($_POST[$pref_name]); if ($pref_name == 'DIGEST_PREFERRED_TIME') { if (get_pref('DIGEST_PREFERRED_TIME') != $value) { $this->dbh->query("UPDATE ttrss_users SET last_digest_sent = NULL WHERE id = " . $_SESSION['uid']); } } if ($pref_name == "USER_LANGUAGE") { if ($_SESSION["language"] != $value) { $need_reload = true; } } set_pref($pref_name, $value); } if ($need_reload) { print "PREFS_NEED_RELOAD"; } else { print __("The configuration was saved."); } } function getHelp() { $pref_name = $this->dbh->escape_string($_REQUEST["pn"]); $result = $this->dbh->query("SELECT help_text FROM ttrss_prefs WHERE pref_name = '$pref_name'"); if ($this->dbh->num_rows($result) > 0) { $help_text = $this->dbh->fetch_result($result, 0, "help_text"); print $help_text; } else { printf(__("Unknown option: %s"), $pref_name); } } function changeemail() { $email = $this->dbh->escape_string($_POST["email"]); $full_name = $this->dbh->escape_string($_POST["full_name"]); $active_uid = $_SESSION["uid"]; $this->dbh->query("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"; } $this->dbh->query("DELETE FROM ttrss_user_prefs WHERE $profile_qpart AND owner_uid = ".$_SESSION["uid"]); initialize_user_prefs($_SESSION["uid"], $_SESSION["profile"]); echo __("Your preferences are now set to default values."); } 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"); /* "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 "
".__("Scan the following code by the Authenticator application:")."
"; $csrf_token = $_SESSION["csrf_token"]; print ""; print ""; } else { print_notice(__("PHP GD functions are required for OTP support.")); } } } PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "hook_prefs_tab_section", "prefPrefsAuth"); print ""; print ""; print " |