From 6d1125dfec33e5e827cb1643fc38459488619af2 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sat, 17 May 2014 17:09:46 +0200 Subject: [PATCH] Force auth on newsletter unsubscription link --- modules/axletter.php | 3 ++- modules/comletter.php | 3 ++- modules/epletter.php | 3 ++- modules/fxletter.php | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/axletter.php b/modules/axletter.php index 081f487..3b19bc3 100644 --- a/modules/axletter.php +++ b/modules/axletter.php @@ -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; diff --git a/modules/comletter.php b/modules/comletter.php index 9c759c5..b5afacb 100644 --- a/modules/comletter.php +++ b/modules/comletter.php @@ -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; diff --git a/modules/epletter.php b/modules/epletter.php index 88f4103..f1cd592 100644 --- a/modules/epletter.php +++ b/modules/epletter.php @@ -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; diff --git a/modules/fxletter.php b/modules/fxletter.php index b47a5ad..cb31058 100644 --- a/modules/fxletter.php +++ b/modules/fxletter.php @@ -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; -- 2.1.4