Adds XSRF protection to the Email module.
[platal.git] / htdocs / javascript / ajax.js
index 854c4ef..9eb6a60 100644 (file)
@@ -140,9 +140,9 @@ function previewWiki(idFrom, idTo, withTitle, idShow)
     }
 }
 
-function sendTestEmail(forlife)
+function sendTestEmail(token, forlife)
 {
-    Ajax.update_html(null, 'emails/test' + (forlife == null ? '' : '/' + forlife),
+    Ajax.update_html(null, 'emails/test' + (forlife == null ? '' : '/' + forlife) + '?token=' + token,
                      function() {
                         showTempMessage('mail_sent', "Un mail a été envoyé avec succès"
                                         + (forlife == null ? " sur ton adresse." : " sur l'adresse de " + forlife),