]> git.wh0rd.org Git - tt-rss.git/commitdiff
adding in the backend connection bits so that the dialog works
authorMatt Katz <mattkatz@ubuntu.ubuntu-domain>
Sat, 10 Apr 2010 00:04:57 +0000 (20:04 -0400)
committerMatt Katz <mattkatz@ubuntu.ubuntu-domain>
Sat, 10 Apr 2010 00:04:57 +0000 (20:04 -0400)
modules/backend-rpc.php
prefs.js

index 6f70f07a5c59716f848598998ff05edf89c94935..b21e161e41d2cb99ad18cfd94494a3bfdff5d8a2 100644 (file)
                        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);
index ee53cf27aff5879a562621b97ccb694ee14d97ce..6d5e5a90cd66d25423f858b817a6b53953e6cfea 100644 (file)
--- 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 {