Skip to content

Commit

Permalink
adding in the backend connection bits so that the dialog works
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Katz committed Apr 10, 2010
1 parent c8640ed commit ef7b7bb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/backend-rpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,16 @@ function handle_rpc_request($link) {
return;
}

if ($subop == "regenOPMLKey") {

print "<rpc-reply>";
set_pref($link, " _PREFS_OPML_PUBLISH_KEY", generate_publish_key(), $_SESSION["uid"]);
$new_link = opml_publish_url($link);
print "<link><![CDATA[$new_link]]></link>";
print "</rpc-reply>";
return;
}

if ($subop == "logout") {
logout_user();
print_error_xml(6);
Expand Down
36 changes: 36 additions & 0 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit ef7b7bb

Please sign in to comment.