mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-05-17 02:10 am

[dw-free] Subscribing through Ajax-y ESN does not respect maximum subscriptions cap

[commit: http://hg.dwscoalition.org/dw-free/rev/ac5091814431]

http://bugs.dwscoalition.org/show_bug.cgi?id=169

Respect max subscription limit when adding via AJAX wizard.

Patch by [personal profile] wyntarvox.

Files modified:
  • htdocs/tools/endpoints/esn_subs.bml
--------------------------------------------------------------------------------
diff -r 434d58c389cc -r ac5091814431 htdocs/tools/endpoints/esn_subs.bml
--- a/htdocs/tools/endpoints/esn_subs.bml	Sat May 16 19:31:47 2009 +0000
+++ b/htdocs/tools/endpoints/esn_subs.bml	Sun May 17 02:10:20 2009 +0000
@@ -60,6 +60,10 @@
             $ret{auth_token} = $auth_token;
         }
     } elsif ($action eq 'addsub') {
+
+        return $err->("Reached limit of " . $remote->get_cap('subscriptions') . " active subscriptions")
+            unless $remote->can_add_inbox_subscription;
+
         my %subparams = ();
 
         return $err->("Invalid subscription parameters") unless (defined $POST{journalid}) && $POST{etypeid}+0;
--------------------------------------------------------------------------------