$owner_uid, "feed" => $feed, "limit" => $limit, "view_mode" => $view_mode, "cat_view" => $is_cat, "search" => $search, "override_order" => $date_sort_field, "include_children" => true, "ignore_vfeed_group" => true, "offset" => $offset, "start_ts" => $start_ts ); if (!$is_cat && is_numeric($feed) && $feed < PLUGIN_FEED_BASE_INDEX && $feed > LABEL_BASE_INDEX) { $user_plugins = get_pref("_ENABLED_PLUGINS", $owner_uid); $tmppluginhost = new PluginHost(); $tmppluginhost->load(PLUGINS, PluginHost::KIND_ALL); $tmppluginhost->load($user_plugins, PluginHost::KIND_USER, $owner_uid); $tmppluginhost->load_data(); $handler = $tmppluginhost->get_feed_handler( PluginHost::feed_to_pfeed_id($feed)); if ($handler) { $qfh_ret = $handler->get_headlines(PluginHost::feed_to_pfeed_id($feed), $params); } } else { $qfh_ret = Feeds::queryFeedHeadlines($params); } $result = $qfh_ret[0]; $feed_title = htmlspecialchars($qfh_ret[1]); $feed_site_url = $qfh_ret[2]; /* $last_error = $qfh_ret[3]; */ $feed_self_url = get_self_url_prefix() . "/public.php?op=rss&id=$feed&key=" . get_feed_access_key($feed, false, $owner_uid); if (!$feed_site_url) $feed_site_url = get_self_url_prefix(); if ($format == 'atom') { $tpl = new MiniTemplator; $tpl->readTemplateFromFile("templates/generated_feed.txt"); $tpl->setVariable('FEED_TITLE', $feed_title, true); $tpl->setVariable('VERSION', VERSION, true); $tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url), true); $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true); while ($line = $result->fetch()) { $line["content_preview"] = sanitize(truncate_string(strip_tags($line["content"]), 100, '...')); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line); } foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_EXPORT_FEED) as $p) { $line = $p->hook_article_export_feed($line, $feed, $is_cat); } $tpl->setVariable('ARTICLE_ID', htmlspecialchars($orig_guid ? $line['link'] : $this->make_article_tag_uri($line['id'], $line['date_entered'])), true); $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true); $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true); $tpl->setVariable('ARTICLE_EXCERPT', $line["content_preview"], true); $content = sanitize($line["content"], false, $owner_uid, $feed_site_url, false, $line["id"]); if ($line['note']) { $content = "
"."Completed."."
"; } else { print_error("Some of the information provided is missing or incorrect."); } } else { print_error("Some of the information provided is missing or incorrect."); } } else { print_error("Some of the information provided is missing or incorrect."); } print "".__("Return to Agriget").""; } else if (!$method) { print_notice(__("You will need to provide valid account name and email. Password reset link will be sent to your email address.")); print ""; } else if ($method == 'do') { $login = clean($_POST["login"]); $email = clean($_POST["email"]); $test = clean($_POST["test"]); if ($test != ($_SESSION["pwdreset:testvalue1"] + $_SESSION["pwdreset:testvalue2"]) || !$email || !$login) { print_error(__('Some of the required form parameters are missing or incorrect.')); print ""; } else { // prevent submitting this form multiple times $_SESSION["pwdreset:testvalue1"] = rand(1, 1000); $_SESSION["pwdreset:testvalue2"] = rand(1, 1000); $sth = $this->pdo->prepare("SELECT id FROM ttrss_users WHERE login = ? AND email = ?"); $sth->execute([$login, $email]); if ($row = $sth->fetch()) { print_notice("Password reset instructions are being sent to your email address."); $id = $row["id"]; if ($id) { $resetpass_token = sha1(get_random_bytes(128)); $resetpass_link = get_self_url_prefix() . "/public.php?op=forgotpass&hash=" . $resetpass_token . "&login=" . urlencode($login); require_once "lib/MiniTemplator.class.php"; $tpl = new MiniTemplator; $tpl->readTemplateFromFile("templates/resetpass_link_template.txt"); $tpl->setVariable('LOGIN', $login); $tpl->setVariable('RESETPASS_LINK', $resetpass_link); $tpl->addBlock('message'); $message = ""; $tpl->generateOutputToString($message); $mailer = new Mailer(); $rc = $mailer->mail(["to_name" => $login, "to_address" => $email, "subject" => __("[tt-rss] Password reset request"), "message" => $message]); if (!$rc) print_error($mailer->error()); $resetpass_token_full = time() . ":" . $resetpass_token; $sth = $this->pdo->prepare("UPDATE ttrss_users SET resetpass_token = ? WHERE login = ? AND email = ?"); $sth->execute([$resetpass_token_full, $login, $email]); } else { print_error("User ID not found."); } print "".__("Return to Agriget").""; } else { print_error(__("Sorry, login and email combination not found.")); print ""; } } } print "