From: Nicolas Iooss Date: Sat, 17 May 2014 15:09:46 +0000 (+0200) Subject: Force auth on newsletter unsubscription link X-Git-Tag: xorg/1.1.13~15^2 X-Git-Url: http://git.polytechnique.org/?p=platal.git;a=commitdiff_plain;h=6d1125dfec33e5e827cb1643fc38459488619af2 Force auth on newsletter unsubscription link --- 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;