mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 00:45:55 +00:00
more published feeds work
This commit is contained in:
33
backend.php
33
backend.php
@@ -56,7 +56,7 @@
|
|||||||
$print_exec_time = false;
|
$print_exec_time = false;
|
||||||
|
|
||||||
if ((!$op || $op == "rpc" || $op == "rss" || $op == "view" ||
|
if ((!$op || $op == "rpc" || $op == "rss" || $op == "view" ||
|
||||||
$op == "digestSend" || $op == "viewfeed" ||
|
$op == "digestSend" || $op == "viewfeed" || $op == "publish" ||
|
||||||
$op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) {
|
$op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) {
|
||||||
header("Content-Type: application/xml; charset=utf-8");
|
header("Content-Type: application/xml; charset=utf-8");
|
||||||
} else {
|
} else {
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds"
|
if (!($_SESSION["uid"] && validate_session($link)) && $op != "globalUpdateFeeds"
|
||||||
&& $op != "rss" && $op != "getUnread") {
|
&& $op != "rss" && $op != "getUnread" && $op != "publish") {
|
||||||
|
|
||||||
if ($op == "rpc" || $op == "viewfeed" || $op == "view") {
|
if ($op == "rpc" || $op == "viewfeed" || $op == "view") {
|
||||||
print_error_xml(6); die;
|
print_error_xml(6); die;
|
||||||
@@ -404,6 +404,33 @@
|
|||||||
module_pref_feed_browser($link);
|
module_pref_feed_browser($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($op == "publish") {
|
||||||
|
$key = db_escape_string($_GET["key"]);
|
||||||
|
|
||||||
|
$result = db_query($link, "SELECT login, owner_uid
|
||||||
|
FROM ttrss_user_prefs, ttrss_users WHERE
|
||||||
|
pref_name = '_PREFS_PUBLISH_KEY' AND
|
||||||
|
value = '$key' AND
|
||||||
|
ttrss_users.id = owner_uid");
|
||||||
|
|
||||||
|
if (db_num_rows($result) == 1) {
|
||||||
|
$owner = db_fetch_result($result, 0, "owner_uid");
|
||||||
|
$login = db_fetch_result($result, 0, "login");
|
||||||
|
|
||||||
|
$_SESSION["uid"] = $owner;
|
||||||
|
|
||||||
|
generate_syndicated_feed($link, -2, false);
|
||||||
|
|
||||||
|
session_destroy();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$_SESSION["uid"] = 0;
|
||||||
|
generate_syndicated_feed($link, -2, false);
|
||||||
|
session_destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($op == "rss") {
|
if ($op == "rss") {
|
||||||
$feed = db_escape_string($_GET["id"]);
|
$feed = db_escape_string($_GET["id"]);
|
||||||
$user = db_escape_string($_GET["user"]);
|
$user = db_escape_string($_GET["user"]);
|
||||||
@@ -424,6 +451,8 @@
|
|||||||
generate_syndicated_feed($link, $feed, $is_cat,
|
generate_syndicated_feed($link, $feed, $is_cat,
|
||||||
$search, $search_mode, $match_on);
|
$search, $search_mode, $match_on);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
session_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($op == "labelFromSearch") {
|
if ($op == "labelFromSearch") {
|
||||||
|
|||||||
@@ -2279,6 +2279,8 @@
|
|||||||
function getFeedTitle($link, $id) {
|
function getFeedTitle($link, $id) {
|
||||||
if ($id == -1) {
|
if ($id == -1) {
|
||||||
return __("Starred articles");
|
return __("Starred articles");
|
||||||
|
} else if ($id == -2) {
|
||||||
|
return __("Published articles");
|
||||||
} else if ($id < -10) {
|
} else if ($id < -10) {
|
||||||
$label_id = -10 - $id;
|
$label_id = -10 - $id;
|
||||||
$result = db_query($link, "SELECT description FROM ttrss_labels WHERE id = '$label_id'");
|
$result = db_query($link, "SELECT description FROM ttrss_labels WHERE id = '$label_id'");
|
||||||
|
|||||||
@@ -295,6 +295,23 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($subop == "regenPubKey") {
|
||||||
|
|
||||||
|
print "<rpc-reply>";
|
||||||
|
|
||||||
|
set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key());
|
||||||
|
|
||||||
|
$url_path = 'http://' . $_SERVER["HTTP_HOST"] . \
|
||||||
|
parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
|
||||||
|
|
||||||
|
$new_link = $url_path . "?op=publish&key=" . get_pref($link, "_PREFS_PUBLISH_KEY");
|
||||||
|
|
||||||
|
print "<link><![CDATA[$new_link]]></link>";
|
||||||
|
|
||||||
|
print "</rpc-reply>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($subop == "logout") {
|
if ($subop == "logout") {
|
||||||
logout_user();
|
logout_user();
|
||||||
print_error_xml(6);
|
print_error_xml(6);
|
||||||
|
|||||||
@@ -1057,7 +1057,7 @@
|
|||||||
|
|
||||||
$url_path .= "?op=publish&key=" . get_pref($link, "_PREFS_PUBLISH_KEY");
|
$url_path .= "?op=publish&key=" . get_pref($link, "_PREFS_PUBLISH_KEY");
|
||||||
|
|
||||||
print "<p><a id=\"pubGenAddress\" target=\"_new\" href=\"$url_path\">$url_path</a></p>";
|
print "<p class=\"small\"><a id=\"pubGenAddress\" target=\"_new\" href=\"$url_path\">$url_path</a></p>";
|
||||||
|
|
||||||
print "<p><input type=\"submit\" onclick=\"return pubRegenKey()\"
|
print "<p><input type=\"submit\" onclick=\"return pubRegenKey()\"
|
||||||
value=\"".__('Generate another address')."\"></p>";
|
value=\"".__('Generate another address')."\"></p>";
|
||||||
|
|||||||
20
prefs.js
20
prefs.js
@@ -16,7 +16,6 @@ var caller_subop = false;
|
|||||||
|
|
||||||
var sanity_check_done = false;
|
var sanity_check_done = false;
|
||||||
|
|
||||||
/*
|
|
||||||
function replace_pubkey_callback() {
|
function replace_pubkey_callback() {
|
||||||
if (xmlhttp.readyState == 4) {
|
if (xmlhttp.readyState == 4) {
|
||||||
try {
|
try {
|
||||||
@@ -24,15 +23,25 @@ function replace_pubkey_callback() {
|
|||||||
|
|
||||||
if (xmlhttp.responseXML) {
|
if (xmlhttp.responseXML) {
|
||||||
|
|
||||||
|
var new_link = xmlhttp.responseXML.getElementsByTagName("link")[0];
|
||||||
|
|
||||||
|
if (new_link) {
|
||||||
|
link.href = new_link.firstChild.nodeValue;
|
||||||
|
link.innerHTML = new_link.firstChild.nodeValue;
|
||||||
|
|
||||||
|
notify_info("Address changed");
|
||||||
|
} else {
|
||||||
|
notify_error("Could not change address");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
notify_error("Error while changing adress");
|
notify_error("Could not change address");
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("replace_pubkey_callback", e);
|
exception_error("replace_pubkey_callback", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} */
|
}
|
||||||
|
|
||||||
function expand_feed_callback() {
|
function expand_feed_callback() {
|
||||||
if (xmlhttp.readyState == 4) {
|
if (xmlhttp.readyState == 4) {
|
||||||
@@ -1748,7 +1757,6 @@ function feedlistToggleSLAT() {
|
|||||||
updateFeedList()
|
updateFeedList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
function pubRegenKey() {
|
function pubRegenKey() {
|
||||||
|
|
||||||
if (!xmlhttp_ready(xmlhttp)) {
|
if (!xmlhttp_ready(xmlhttp)) {
|
||||||
@@ -1762,10 +1770,10 @@ function pubRegenKey() {
|
|||||||
|
|
||||||
notify_progress("Trying to change address...");
|
notify_progress("Trying to change address...");
|
||||||
|
|
||||||
xmlhttp.open("GET", "backend.php?op=backend-rpc&subop=regen-pub-key");
|
xmlhttp.open("GET", "backend.php?op=rpc&subop=regenPubKey");
|
||||||
xmlhttp.onreadystatechange=replace_pubkey_callback;
|
xmlhttp.onreadystatechange=replace_pubkey_callback;
|
||||||
xmlhttp.send(null);
|
xmlhttp.send(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} */
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user