]>
git.wh0rd.org - tt-rss.git/blob - classes/handler/public.php
2 class Handler_Public
extends Handler
{
4 private function generate_syndicated_feed($owner_uid, $feed, $is_cat,
5 $limit, $offset, $search, $search_mode,
6 $view_mode = false, $format = 'atom') {
8 require_once "lib/MiniTemplator.class.php";
10 $note_style = "background-color : #fff7d5;
11 border-width : 1px; ".
12 "padding : 5px; border-style : dashed; border-color : #e7d796;".
13 "margin-bottom : 1em; color : #9a8c59;";
15 if (!$limit) $limit = 100;
17 $date_sort_field = "date_entered DESC, updated DESC";
20 $date_sort_field = "last_published";
22 $date_sort_field = "last_marked";
24 $qfh_ret = queryFeedHeadlines($this->link
, $feed,
25 $limit, $view_mode, $is_cat, $search, $search_mode,
26 $date_sort_field, $offset, $owner_uid,
27 false, 0, false, true);
29 $result = $qfh_ret[0];
30 $feed_title = htmlspecialchars($qfh_ret[1]);
31 $feed_site_url = $qfh_ret[2];
32 $last_error = $qfh_ret[3];
34 $feed_self_url = get_self_url_prefix() .
35 "/public.php?op=rss&id=-2&key=" .
36 get_feed_access_key($this->link
, -2, false, $owner_uid);
38 if (!$feed_site_url) $feed_site_url = get_self_url_prefix();
40 if ($format == 'atom') {
41 $tpl = new MiniTemplator
;
43 $tpl->readTemplateFromFile("templates/generated_feed.txt");
45 $tpl->setVariable('FEED_TITLE', $feed_title, true);
46 $tpl->setVariable('VERSION', VERSION
, true);
47 $tpl->setVariable('FEED_URL', htmlspecialchars($feed_self_url), true);
49 if (PUBSUBHUBBUB_HUB
&& $feed == -2) {
50 $tpl->setVariable('HUB_URL', htmlspecialchars(PUBSUBHUBBUB_HUB
), true);
51 $tpl->addBlock('feed_hub');
54 $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
56 while ($line = db_fetch_assoc($result)) {
57 $tpl->setVariable('ARTICLE_ID', htmlspecialchars($line['link']), true);
58 $tpl->setVariable('ARTICLE_LINK', htmlspecialchars($line['link']), true);
59 $tpl->setVariable('ARTICLE_TITLE', htmlspecialchars($line['title']), true);
60 $tpl->setVariable('ARTICLE_EXCERPT',
61 truncate_string(strip_tags($line["content_preview"]), 100, '...'), true);
63 $content = sanitize($this->link
, $line["content_preview"], false, $owner_uid);
66 $content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" .
70 $tpl->setVariable('ARTICLE_CONTENT', $content, true);
72 $tpl->setVariable('ARTICLE_UPDATED_ATOM',
73 date('c', strtotime($line["updated"])), true);
74 $tpl->setVariable('ARTICLE_UPDATED_RFC822',
75 date(DATE_RFC822
, strtotime($line["updated"])), true);
77 $tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true);
79 $tags = get_article_tags($this->link
, $line["id"], $owner_uid);
81 foreach ($tags as $tag) {
82 $tpl->setVariable('ARTICLE_CATEGORY', htmlspecialchars($tag), true);
83 $tpl->addBlock('category');
86 $enclosures = get_article_enclosures($this->link
, $line["id"]);
88 foreach ($enclosures as $e) {
89 $type = htmlspecialchars($e['content_type']);
90 $url = htmlspecialchars($e['content_url']);
91 $length = $e['duration'];
93 $tpl->setVariable('ARTICLE_ENCLOSURE_URL', $url, true);
94 $tpl->setVariable('ARTICLE_ENCLOSURE_TYPE', $type, true);
95 $tpl->setVariable('ARTICLE_ENCLOSURE_LENGTH', $length, true);
97 $tpl->addBlock('enclosure');
100 $tpl->addBlock('entry');
105 $tpl->addBlock('feed');
106 $tpl->generateOutputToString($tmp);
108 if (@!$_REQUEST["noxml"]) {
109 header("Content-Type: text/xml; charset=utf-8");
111 header("Content-Type: text/plain; charset=utf-8");
115 } else if ($format == 'json') {
119 $feed['title'] = $feed_title;
120 $feed['version'] = VERSION
;
121 $feed['feed_url'] = $feed_self_url;
123 if (PUBSUBHUBBUB_HUB
&& $feed == -2) {
124 $feed['hub_url'] = PUBSUBHUBBUB_HUB
;
127 $feed['self_url'] = get_self_url_prefix();
129 $feed['articles'] = array();
131 while ($line = db_fetch_assoc($result)) {
134 $article['id'] = $line['link'];
135 $article['link'] = $line['link'];
136 $article['title'] = $line['title'];
137 $article['excerpt'] = truncate_string(strip_tags($line["content_preview"]), 100, '...');
138 $article['content'] = sanitize($this->link
, $line["content_preview"], false, $owner_uid);
139 $article['updated'] = date('c', strtotime($line["updated"]));
141 if ($line['note']) $article['note'] = $line['note'];
142 if ($article['author']) $article['author'] = $line['author'];
144 $tags = get_article_tags($this->link
, $line["id"], $owner_uid);
146 if (count($tags) > 0) {
147 $article['tags'] = array();
149 foreach ($tags as $tag) {
150 array_push($article['tags'], $tag);
154 $enclosures = get_article_enclosures($this->link
, $line["id"]);
156 if (count($enclosures) > 0) {
157 $article['enclosures'] = array();
159 foreach ($enclosures as $e) {
160 $type = $e['content_type'];
161 $url = $e['content_url'];
162 $length = $e['duration'];
164 array_push($article['enclosures'], array("url" => $url, "type" => $type, "length" => $length));
168 array_push($feed['articles'], $article);
171 header("Content-Type: text/json; charset=utf-8");
172 print json_encode($feed);
175 header("Content-Type: text/plain; charset=utf-8");
176 print json_encode(array("error" => array("message" => "Unknown format")));
180 function getUnread() {
181 $login = db_escape_string($this->link
, $_REQUEST["login"]);
182 $fresh = $_REQUEST["fresh"] == "1";
184 $result = db_query($this->link
, "SELECT id FROM ttrss_users WHERE login = '$login'");
186 if (db_num_rows($result) == 1) {
187 $uid = db_fetch_result($result, 0, "id");
189 print getGlobalUnread($this->link
, $uid);
193 print getFeedArticles($this->link
, -3, false, true, $uid);
197 print "-1;User not found";
202 function getProfiles() {
203 $login = db_escape_string($this->link
, $_REQUEST["login"]);
205 $result = db_query($this->link
, "SELECT * FROM ttrss_settings_profiles,ttrss_users
206 WHERE ttrss_users.id = ttrss_settings_profiles.owner_uid AND login = '$login' ORDER BY title");
208 print "<select dojoType='dijit.form.Select' style='width : 220px; margin : 0px' name='profile'>";
210 print "<option value='0'>" . __("Default profile") . "</option>";
212 while ($line = db_fetch_assoc($result)) {
214 $title = $line["title"];
216 print "<option value='$id'>$title</option>";
223 $mode = db_escape_string($this->link
, $_REQUEST['hub_mode']);
224 $feed_id = (int) db_escape_string($this->link
, $_REQUEST['id']);
225 $feed_url = db_escape_string($this->link
, $_REQUEST['hub_topic']);
227 if (!PUBSUBHUBBUB_ENABLED
) {
228 header('HTTP/1.0 404 Not Found');
229 echo "404 Not found";
233 // TODO: implement hub_verifytoken checking
235 $result = db_query($this->link
, "SELECT feed_url FROM ttrss_feeds
236 WHERE id = '$feed_id'");
238 if (db_num_rows($result) != 0) {
240 $check_feed_url = db_fetch_result($result, 0, "feed_url");
242 if ($check_feed_url && ($check_feed_url == $feed_url ||
!$feed_url)) {
243 if ($mode == "subscribe") {
245 db_query($this->link
, "UPDATE ttrss_feeds SET pubsub_state = 2
246 WHERE id = '$feed_id'");
248 print $_REQUEST['hub_challenge'];
251 } else if ($mode == "unsubscribe") {
253 db_query($this->link
, "UPDATE ttrss_feeds SET pubsub_state = 0
254 WHERE id = '$feed_id'");
256 print $_REQUEST['hub_challenge'];
261 // Received update ping, schedule feed update.
262 //update_rss_feed($this->link, $feed_id, true, true);
264 db_query($this->link
, "UPDATE ttrss_feeds SET
265 last_update_started = '1970-01-01',
266 last_updated = '1970-01-01' WHERE id = '$feed_id'");
270 header('HTTP/1.0 404 Not Found');
271 echo "404 Not found";
274 header('HTTP/1.0 404 Not Found');
275 echo "404 Not found";
282 header("Location: index.php");
286 $uuid = db_escape_string($this->link
, $_REQUEST["key"]);
288 $result = db_query($this->link
, "SELECT ref_id, owner_uid FROM ttrss_user_entries WHERE
291 if (db_num_rows($result) != 0) {
292 header("Content-Type: text/html");
294 $id = db_fetch_result($result, 0, "ref_id");
295 $owner_uid = db_fetch_result($result, 0, "owner_uid");
297 $article = format_article($this->link
, $id, false, true, $owner_uid);
299 print_r($article['content']);
302 print "Article not found.";
308 $feed = db_escape_string($this->link
, $_REQUEST["id"]);
309 $key = db_escape_string($this->link
, $_REQUEST["key"]);
310 $is_cat = $_REQUEST["is_cat"] != false;
311 $limit = (int)db_escape_string($this->link
, $_REQUEST["limit"]);
312 $offset = (int)db_escape_string($this->link
, $_REQUEST["offset"]);
314 $search = db_escape_string($this->link
, $_REQUEST["q"]);
315 $search_mode = db_escape_string($this->link
, $_REQUEST["smode"]);
316 $view_mode = db_escape_string($this->link
, $_REQUEST["view-mode"]);
318 $format = db_escape_string($this->link
, $_REQUEST['format']);
320 if (!$format) $format = 'atom';
322 if (SINGLE_USER_MODE
) {
323 authenticate_user($this->link
, "admin", null);
329 $result = db_query($this->link
, "SELECT owner_uid FROM
330 ttrss_access_keys WHERE access_key = '$key' AND feed_id = '$feed'");
332 if (db_num_rows($result) == 1)
333 $owner_id = db_fetch_result($result, 0, "owner_uid");
337 $this->generate_syndicated_feed($owner_id, $feed, $is_cat, $limit,
338 $offset, $search, $search_mode, $view_mode, $format);
340 header('HTTP/1.1 403 Forbidden');
344 function globalUpdateFeeds() {
345 include "rssfuncs.php";
346 // Update all feeds needing a update.
347 update_daemon_common($this->link
, 0, true, false);
349 // Update feedbrowser
350 update_feedbrowser_cache($this->link
);
352 // Purge orphans and cleanup tags
353 purge_orphans($this->link
);
355 cleanup_tags($this->link
, 14, 50000);
358 $pluginhost->run_hooks($pluginhost::HOOK_UPDATE_TASK
, "hook_update_task", $op);
362 function sharepopup() {
363 if (SINGLE_USER_MODE
) {
364 login_sequence($this->link
);
367 header('Content-Type: text/html; charset=utf-8');
370 <title>Tiny Tiny RSS</title>
371 <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
372 <script type=\"text/javascript\" src=\"lib/prototype.js\"></script>
373 <script type=\"text/javascript\" src=\"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls\"></script>
374 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
376 <body id='sharepopup'>";
378 $action = $_REQUEST["action"];
380 if ($_SESSION["uid"]) {
382 if ($action == 'share') {
384 $title = db_escape_string($this->link
, strip_tags($_REQUEST["title"]));
385 $url = db_escape_string($this->link
, strip_tags($_REQUEST["url"]));
386 $content = db_escape_string($this->link
, strip_tags($_REQUEST["content"]));
387 $labels = db_escape_string($this->link
, strip_tags($_REQUEST["labels"]));
389 Article
::create_published_article($this->link
, $title, $url, $content, $labels,
392 print "<script type='text/javascript'>";
393 print "window.close();";
397 $title = htmlspecialchars($_REQUEST["title"]);
398 $url = htmlspecialchars($_REQUEST["url"]);
402 <table height
='100%' width
='100%'><tr
><td colspan
='2'>
403 <h1
><?php
echo __("Share with Tiny Tiny RSS") ?
></h1
>
406 <form id
='share_form' name
='share_form'>
408 <input type
="hidden" name
="op" value
="sharepopup">
409 <input type
="hidden" name
="action" value
="share">
411 <tr
><td align
='right'><?php
echo __("Title:") ?
></td
>
412 <td width
='80%'><input name
='title' value
="<?php echo $title ?>"></td
></tr
>
413 <tr
><td align
='right'><?php
echo __("URL:") ?
></td
>
414 <td
><input name
='url' value
="<?php echo $url ?>"></td
></tr
>
415 <tr
><td align
='right'><?php
echo __("Content:") ?
></td
>
416 <td
><input name
='content' value
=""></td
></tr
>
417 <tr
><td align
='right'><?php
echo __("Labels:") ?
></td
>
418 <td
><input name
='labels' id
="labels_value"
419 placeholder
='Alpha, Beta, Gamma' value
="">
423 <div
class="autocomplete" id
="labels_choices"
424 style
="display : block"></div
></td
></tr
>
426 <script type
='text/javascript'>document
.forms
[0].title
.focus();</script
>
428 <script type
='text/javascript'>
429 new Ajax
.Autocompleter('labels_value', 'labels_choices',
430 "backend.php?op=rpc&method=completeLabels",
431 { tokens
: ',', paramName
: "search" });
435 <div style
='float : right' class='insensitive-small'>
436 <?php
echo __("Shared article will appear in the Published feed.") ?
>
438 <button type
="submit"><?php
echo __('Share') ?
></button
>
439 <button onclick
="return window.close()"><?php
echo __('Cancel') ?
></button
>
451 $return = urlencode($_SERVER["REQUEST_URI"])
454 <form action
="public.php?return=<?php echo $return ?>"
455 method
="POST" id
="loginForm" name
="loginForm">
457 <input type
="hidden" name
="op" value
="login">
459 <table height
='100%' width
='100%'><tr
><td colspan
='2'>
460 <h1
><?php
echo __("Not logged in") ?
></h1
></td
></tr
>
462 <tr
><td align
="right"><?php
echo __("Login:") ?
></td
>
463 <td align
="right"><input name
="login"
464 value
="<?php echo $_SESSION["fake_login
"] ?>"></td
></tr
>
465 <tr
><td align
="right"><?php
echo __("Password:") ?
></td
>
466 <td align
="right"><input type
="password" name
="password"
467 value
="<?php echo $_SESSION["fake_password
"] ?>"></td
></tr
>
468 <tr
><td align
="right"><?php
echo __("Language:") ?
></td
>
471 print_select_hash("language", $_COOKIE["ttrss_lang"], get_translations(),
472 "style='width : 100%''");
477 <button type
="submit">
478 <?php
echo __('Log in') ?
></button
>
480 <button onclick
="return window.close()">
481 <?php
echo __('Cancel') ?
></button
>
491 $_SESSION["prefs_cache"] = array();
493 if (!SINGLE_USER_MODE
) {
495 $login = db_escape_string($this->link
, $_POST["login"]);
496 $password = $_POST["password"];
497 $remember_me = $_POST["remember_me"];
500 session_set_cookie_params(SESSION_COOKIE_LIFETIME
);
502 session_set_cookie_params(0);
507 if (authenticate_user($this->link
, $login, $password)) {
508 $_POST["password"] = "";
510 $_SESSION["language"] = $_POST["language"];
511 $_SESSION["ref_schema_version"] = get_schema_version($this->link
, true);
512 $_SESSION["bw_limit"] = !!$_POST["bw_limit"];
514 if ($_POST["profile"]) {
516 $profile = db_escape_string($this->link
, $_POST["profile"]);
518 $result = db_query($this->link
, "SELECT id FROM ttrss_settings_profiles
519 WHERE id = '$profile' AND owner_uid = " . $_SESSION["uid"]);
521 if (db_num_rows($result) != 0) {
522 $_SESSION["profile"] = $profile;
523 $_SESSION["prefs_cache"] = array();
527 $_SESSION["login_error_msg"] = __("Incorrect username or password");
530 if ($_REQUEST['return']) {
531 header("Location: " . $_REQUEST['return']);
533 header("Location: " . SELF_URL_PATH
);
538 function subscribe() {
539 if (SINGLE_USER_MODE
) {
540 login_sequence($this->link
);
543 if ($_SESSION["uid"]) {
545 $feed_url = db_escape_string($this->link
, trim($_REQUEST["feed_url"]));
547 header('Content-Type: text/html; charset=utf-8');
550 <title>Tiny Tiny RSS</title>
551 <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
552 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
555 <img class=\"floatingLogo\" src=\"images/logo_small.png\"
556 alt=\"Tiny Tiny RSS\"/>
557 <h1>".__("Subscribe to feed...")."</h1><div class='content'>";
559 $rc = subscribe_to_feed($this->link
, $feed_url);
561 switch ($rc['code']) {
563 print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
566 print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url));
569 print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
572 print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url));
575 print_notice(__("Multiple feed URLs found."));
576 $feed_urls = $rc["feeds"];
579 print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
585 print "<form action=\"public.php\">";
586 print "<input type=\"hidden\" name=\"op\" value=\"subscribe\">";
588 print "<select name=\"feed_url\">";
590 foreach ($feed_urls as $url => $name) {
591 $url = htmlspecialchars($url);
592 $name = htmlspecialchars($name);
594 print "<option value=\"$url\">$name</option>";
597 print "<input type=\"submit\" value=\"".__("Subscribe to selected feed").
603 $tp_uri = get_self_url_prefix() . "/prefs.php";
604 $tt_uri = get_self_url_prefix();
606 if ($rc['code'] <= 2){
607 $result = db_query($this->link
, "SELECT id FROM ttrss_feeds WHERE
608 feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
610 $feed_id = db_fetch_result($result, 0, "id");
617 print "<form method=\"GET\" style='display: inline'
619 <input type=\"hidden\" name=\"tab\" value=\"feedConfig\">
620 <input type=\"hidden\" name=\"method\" value=\"editFeed\">
621 <input type=\"hidden\" name=\"methodparam\" value=\"$feed_id\">
622 <input type=\"submit\" value=\"".__("Edit subscription options")."\">
626 print "<form style='display: inline' method=\"GET\" action=\"$tt_uri\">
627 <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
630 print "</div></body></html>";
633 render_login_form($this->link
);
637 function subscribe2() {
638 $feed_url = db_escape_string($this->link
, trim($_REQUEST["feed_url"]));
639 $cat_id = db_escape_string($this->link
, $_REQUEST["cat_id"]);
640 $from = db_escape_string($this->link
, $_REQUEST["from"]);
642 /* only read authentication information from POST */
644 $auth_login = db_escape_string($this->link
, trim($_POST["auth_login"]));
645 $auth_pass = db_escape_string($this->link
, trim($_POST["auth_pass"]));
647 $rc = subscribe_to_feed($this->link
, $feed_url, $cat_id, $auth_login, $auth_pass);
651 print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url));
654 print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
657 print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url));
660 print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
663 print_notice(__("Multiple feed URLs found."));
665 $feed_urls = get_feeds_from_html($feed_url);
668 print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
673 print "<form action=\"backend.php\">";
674 print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
675 print "<input type=\"hidden\" name=\"quiet\" value=\"1\">";
676 print "<input type=\"hidden\" name=\"method\" value=\"add\">";
678 print "<select name=\"feed_url\">";
680 foreach ($feed_urls as $url => $name) {
681 $url = htmlspecialchars($url);
682 $name = htmlspecialchars($name);
683 print "<option value=\"$url\">$name</option>";
686 print "<input type=\"submit\" value=\"".__("Subscribe to selected feed")."\">";
690 $tp_uri = get_self_url_prefix() . "/prefs.php";
691 $tt_uri = get_self_url_prefix();
694 $result = db_query($this->link
, "SELECT id FROM ttrss_feeds WHERE
695 feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
697 $feed_id = db_fetch_result($result, 0, "id");
705 print "<form method=\"GET\" style='display: inline'
707 <input type=\"hidden\" name=\"tab\" value=\"feedConfig\">
708 <input type=\"hidden\" name=\"method\" value=\"editFeed\">
709 <input type=\"hidden\" name=\"methodparam\" value=\"$feed_id\">
710 <input type=\"submit\" value=\"".__("Edit subscription options")."\">
714 print "<form style='display: inline' method=\"GET\" action=\"$tt_uri\">
715 <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
718 print "</body></html>";
722 header("Content-Type: text/plain");
723 print json_encode(array("error" => array("code" => 7)));
726 function forgotpass() {
727 header('Content-Type: text/html; charset=utf-8');
730 <title>Tiny Tiny RSS</title>
731 <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
732 <script type=\"text/javascript\" src=\"lib/prototype.js\"></script>
733 <script type=\"text/javascript\" src=\"lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls\"></script>
734 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>
736 <body id='forgotpass'>";
738 print '<div class="floatingLogo"><img src="images/logo_small.png"></div>';
739 print "<h1>".__("Password recovery")."</h1>";
740 print "<div class='content'>";
742 @$method = $_POST['method'];
745 $secretkey = uniqid();
746 $_SESSION["secretkey"] = $secretkey;
748 print_notice(__("You will need to provide valid account name and email. New password will be sent on your email address."));
750 print "<form method='POST' action='public.php'>";
751 print "<input type='hidden' name='secretkey' value='$secretkey'>";
752 print "<input type='hidden' name='method' value='do'>";
753 print "<input type='hidden' name='op' value='forgotpass'>";
756 print "<label>".__("Login:")."</label>";
757 print "<input type='text' name='login' value='' required>";
761 print "<label>".__("Email:")."</label>";
762 print "<input type='email' name='email' value='' required>";
766 print "<label>".__("How much is two plus two:")."</label>";
767 print "<input type='text' name='test' value='' required>";
771 print "<button type='submit'>".__("Reset password")."</button>";
774 } else if ($method == 'do') {
776 $secretkey = $_POST["secretkey"];
777 $login = db_escape_string($this->link
, $_POST["login"]);
778 $email = db_escape_string($this->link
, $_POST["email"]);
779 $test = db_escape_string($this->link
, $_POST["test"]);
781 if (($test != 4 && $test != 'four') ||
!$email ||
!$login) {
782 print_error(__('Some of the required form parameters are missing or incorrect.'));
784 print "<form method=\"GET\" action=\"public.php\">
785 <input type=\"hidden\" name=\"op\" value=\"forgotpass\">
786 <input type=\"submit\" value=\"".__("Go back")."\">
789 } else if ($_SESSION["secretkey"] == $secretkey) {
791 $result = db_query($this->link
, "SELECT id FROM ttrss_users
792 WHERE login = '$login' AND email = '$email'");
794 if (db_num_rows($result) != 0) {
795 $id = db_fetch_result($result, 0, "id");
797 Pref_Users
::resetUserPassword($this->link
, $id, false);
801 print_notice("Completed.");
803 print "<form method=\"GET\" action=\"index.php\">
804 <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
808 print_error(__("Sorry, login and email combination not found."));
810 print "<form method=\"GET\" action=\"public.php\">
811 <input type=\"hidden\" name=\"op\" value=\"forgotpass\">
812 <input type=\"submit\" value=\"".__("Go back")."\">
818 print_error(__("Form secret key incorrect. Please enable cookies and try again."));
819 print "<form method=\"GET\" action=\"public.php\">
820 <input type=\"hidden\" name=\"op\" value=\"forgotpass\">
821 <input type=\"submit\" value=\"".__("Go back")."\">