Fix a race condition in active redirection validation.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 31 Mar 2008 16:46:36 +0000 (18:46 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 31 Mar 2008 16:46:36 +0000 (18:46 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
templates/emails/redirect.tpl

index 102564c..9742816 100644 (file)
         }
     }
 
+    function updateRedirect(checked, email)
+    {
+        activeEnable();
+        Ajax.update_html(null, 'emails/redirect/' + (checked ? '' : 'in') + 'active/' + email, redirectUpdate);
+    }
+
     {/literal}
   //]]></script>
   {javascript name="jquery"}
           <input type="checkbox" value="{$e->email}" {if $e->sufficient}class="active_email"{/if}
                  {if $e->active}checked="checked"{/if}
                  {if $smarty.foreach.redirect.total eq 1}disabled="disabled"{/if}
-                 onchange="Ajax.update_html(null,'{$globals->baseurl}/emails/redirect/'+(this.checked?'':'in')+'active/{$e->email}', redirectUpdate)" /></td>
+                 onchange="updateRedirect(this.checked, '{$e->email}')" /></td>
         <td>
           {if $e->has_rewrite()}
           <select onchange="Ajax.update_html(null,'emails/redirect/rewrite/{$e->email}/'+this.value, redirectUpdate)">