From 8807772990ce472f246697c9d2b0998af60a4baa Mon Sep 17 00:00:00 2001 From: Sascha Greuel Date: Sat, 22 Jun 2013 14:39:18 +0200 Subject: [PATCH] Enabled disclaimer for logged in users See http://beta.woltlab.com/index.php/Thread/1191-Nutzungsbestimmungen-Disclaimer/ --- com.woltlab.wcf/templates/disclaimer.tpl | 2 ++ wcfsetup/install/files/lib/form/DisclaimerForm.class.php | 9 ++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/com.woltlab.wcf/templates/disclaimer.tpl b/com.woltlab.wcf/templates/disclaimer.tpl index 76d55ca43e..5cdb0bc74e 100644 --- a/com.woltlab.wcf/templates/disclaimer.tpl +++ b/com.woltlab.wcf/templates/disclaimer.tpl @@ -39,10 +39,12 @@ {event name='fieldsets'} + {if !$__wcf->user->userID}
{lang}wcf.user.register.disclaimer.decline{/lang}
+ {/if} {include file='footer'} diff --git a/wcfsetup/install/files/lib/form/DisclaimerForm.class.php b/wcfsetup/install/files/lib/form/DisclaimerForm.class.php index 22bbfb7da5..d428310f43 100644 --- a/wcfsetup/install/files/lib/form/DisclaimerForm.class.php +++ b/wcfsetup/install/files/lib/form/DisclaimerForm.class.php @@ -30,13 +30,8 @@ class DisclaimerForm extends AbstractForm { public function readParameters() { parent::readParameters(); - // user is already registered - if (WCF::getUser()->userID) { - throw new PermissionDeniedException(); - } - // registration disabled - if (REGISTER_DISABLED) { + if (!WCF::getUser()->userID && REGISTER_DISABLED) { throw new NamedUserException(WCF::getLanguage()->get('wcf.user.register.error.disabled')); } } @@ -47,7 +42,7 @@ class DisclaimerForm extends AbstractForm { public function readFormParameters() { parent::readFormParameters(); - if (isset($_POST['accept'])) $this->accept = true; + if (!WCF::getUser()->userID && isset($_POST['accept'])) $this->accept = true; } /** -- 2.20.1