From ef7b7bbd55cae0927faad2cc865902e1d3ecf092 Mon Sep 17 00:00:00 2001 From: Matt Katz Date: Fri, 9 Apr 2010 20:04:57 -0400 Subject: [PATCH] adding in the backend connection bits so that the dialog works --- modules/backend-rpc.php | 10 ++++++++++ prefs.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 6f70f07a..b21e161e 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -516,6 +516,16 @@ return; } + if ($subop == "regenOPMLKey") { + + print ""; + set_pref($link, " _PREFS_OPML_PUBLISH_KEY", generate_publish_key(), $_SESSION["uid"]); + $new_link = opml_publish_url($link); + print ""; + print ""; + return; + } + if ($subop == "logout") { logout_user(); print_error_xml(6); diff --git a/prefs.js b/prefs.js index ee53cf27..6d5e5a90 100644 --- a/prefs.js +++ b/prefs.js @@ -1672,6 +1672,42 @@ function pubRegenKey() { return false; } +function opmlRegenKey() { + + try { + var ok = confirm(__("Replace current OPML publishing address with a new one?")); + + if (ok) { + + notify_progress("Trying to change address...", true); + + var query = "?op=rpc&subop=regenOPMLKey"; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + var new_link = transport.responseXML.getElementsByTagName("link")[0]; + + var e = $('pub_opml_url'); + + if (new_link) { + e.href = new_link.firstChild.nodeValue; + e.innerHTML = new_link.firstChild.nodeValue; + + new Effect.Highlight(e); + + notify(''); + + } else { + notify_error("Could not change feed URL."); + } + } }); + } + } catch (e) { + exception_error("opmlRegenKey", e); + } + return false; +} function validatePrefsSave() { try { -- 2.39.2