Enabled disclaimer for logged in users
authorSascha Greuel <sascha@softcreatr.de>
Sat, 22 Jun 2013 12:39:18 +0000 (14:39 +0200)
committerSascha Greuel <sascha@softcreatr.de>
Sat, 22 Jun 2013 12:39:18 +0000 (14:39 +0200)
See
http://beta.woltlab.com/index.php/Thread/1191-Nutzungsbestimmungen-Disclaimer/

com.woltlab.wcf/templates/disclaimer.tpl
wcfsetup/install/files/lib/form/DisclaimerForm.class.php

index 76d55ca43e549fe3b344aa3c99dd7f3a5c744f58..5cdb0bc74ed5388a3abb0c79748b449d13d8b521 100644 (file)
                {event name='fieldsets'}
        </div>
        
+       {if !$__wcf->user->userID}
        <div class="formSubmit">
                <input type="submit" name="accept" value="{lang}wcf.user.register.disclaimer.accept{/lang}" accesskey="s" />
                <a class="button" href="{link}{/link}">{lang}wcf.user.register.disclaimer.decline{/lang}</a>
        </div>
+       {/if}
 </form>
 
 {include file='footer'}
index 22bbfb7da57605ab035e0eec8e03f46ea600ed43..d428310f43ee5c1cd1f21e24c7bc7d8537a4974d 100644 (file)
@@ -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;
        }
        
        /**