Force auth on newsletter unsubscription link
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sat, 17 May 2014 15:09:46 +0000 (17:09 +0200)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sat, 17 May 2014 15:09:46 +0000 (17:09 +0200)
modules/axletter.php
modules/comletter.php
modules/epletter.php
modules/fxletter.php

index 081f487..3b19bc3 100644 (file)
@@ -27,7 +27,7 @@ class AXLetterModule extends NewsletterModule
     {
         return array(
             'ax'                   => $this->make_hook('nl',              AUTH_COOKIE, 'user'),
-            'ax/out'               => $this->make_hook('out',             AUTH_PUBLIC),
+            'ax/out'               => $this->make_hook('out',             AUTH_COOKIE, 'user'),
             'ax/show'              => $this->make_hook('nl_show',         AUTH_COOKIE, 'user'),
             'ax/search'            => $this->make_hook('nl_search',       AUTH_COOKIE, 'user'),
             'ax/admin'             => $this->make_hook('admin_nl',        AUTH_PASSWD, 'user'),
@@ -48,6 +48,7 @@ class AXLetterModule extends NewsletterModule
 
     function handler_out($page, $hash = null, $issue_id = null)
     {
+        $hash = ($hash == 'nohash') ? null : $hash;
         if (!$hash) {
             if (!S::logged()) {
                 return PL_DO_AUTH;
index 9c759c5..b5afacb 100644 (file)
@@ -33,7 +33,7 @@ class ComLetterModule extends NewsletterModule
             'comletter'                   => $this->make_hook('nl',              AUTH_COOKIE, 'user'),
             'comletter/submit'            => $this->make_hook('coml_submit',     AUTH_PASSWD, 'user'),
             'comletter/remaining'         => $this->make_hook('coml_remaining',  AUTH_PASSWD, 'user'),
-            'comletter/out'               => $this->make_hook('out',             AUTH_PUBLIC),
+            'comletter/out'               => $this->make_hook('out',             AUTH_COOKIE, 'user'),
             'comletter/show'              => $this->make_hook('nl_show',         AUTH_COOKIE, 'user'),
             'comletter/search'            => $this->make_hook('nl_search',       AUTH_COOKIE, 'user'),
             'comletter/admin'             => $this->make_hook('admin_nl',        AUTH_PASSWD, 'user'),
@@ -94,6 +94,7 @@ class ComLetterModule extends NewsletterModule
 
     function handler_out($page, $hash = null, $issue_id = null)
     {
+        $hash = ($hash == 'nohash') ? null : $hash;
         if (!$hash) {
             if (!S::logged()) {
                 return PL_DO_AUTH;
index 88f4103..f1cd592 100644 (file)
@@ -27,7 +27,7 @@ class EPLetterModule extends NewsletterModule
     {
         return array(
             'epletter'                   => $this->make_hook('nl',              AUTH_COOKIE, 'user'),
-            'epletter/out'               => $this->make_hook('out',             AUTH_PUBLIC),
+            'epletter/out'               => $this->make_hook('out',             AUTH_COOKIE, 'user'),
             'epletter/show'              => $this->make_hook('nl_show',         AUTH_COOKIE, 'user'),
             'epletter/search'            => $this->make_hook('nl_search',       AUTH_COOKIE, 'user'),
             'epletter/admin'             => $this->make_hook('admin_nl',        AUTH_PASSWD, 'user'),
@@ -48,6 +48,7 @@ class EPLetterModule extends NewsletterModule
 
     function handler_out($page, $hash = null, $issue_id = null)
     {
+        $hash = ($hash == 'nohash') ? null : $hash;
         if (!$hash) {
             if (!S::logged()) {
                 return PL_DO_AUTH;
index b47a5ad..cb31058 100644 (file)
@@ -27,7 +27,7 @@ class FXLetterModule extends NewsletterModule
     {
         return array(
             'fxletter'                   => $this->make_hook('nl',              AUTH_COOKIE, 'user'),
-            'fxletter/out'               => $this->make_hook('out',             AUTH_PUBLIC),
+            'fxletter/out'               => $this->make_hook('out',             AUTH_COOKIE, 'user'),
             'fxletter/show'              => $this->make_hook('nl_show',         AUTH_COOKIE, 'user'),
             'fxletter/search'            => $this->make_hook('nl_search',       AUTH_COOKIE, 'user'),
             'fxletter/admin'             => $this->make_hook('admin_nl',        AUTH_PASSWD, 'user'),
@@ -48,6 +48,7 @@ class FXLetterModule extends NewsletterModule
 
     function handler_out($page, $hash = null, $issue_id = null)
     {
+        $hash = ($hash == 'nohash') ? null : $hash;
         if (!$hash) {
             if (!S::logged()) {
                 return PL_DO_AUTH;