Fix fetching of 3rd party avatar in RegisterForm
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Jul 2015 13:28:04 +0000 (15:28 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Jul 2015 13:29:09 +0000 (15:29 +0200)
It was broken due to the usersOnly permissions as the maximum
avatar size in bytes is zero for guests.

wcfsetup/install/files/lib/form/RegisterForm.class.php

index fe7bbac992680091bcb6f28bf7b4412affd04655..9686e8dd15d604d0197eb8ad7b6630a41887016f 100644 (file)
@@ -445,6 +445,9 @@ class RegisterForm extends UserAddForm {
                $user = $result['returnValues'];
                $userEditor = new UserEditor($user);
                
+               // update session
+               WCF::getSession()->changeUser($user);
+               
                // set avatar if provided
                if (!empty($avatarURL)) {
                        $userAvatarAction = new UserAvatarAction(array(), 'fetchRemoteAvatar', array(
@@ -454,9 +457,6 @@ class RegisterForm extends UserAddForm {
                        $userAvatarAction->executeAction();
                }
                
-               // update session
-               WCF::getSession()->changeUser($user);
-               
                // activation management
                if (REGISTER_ACTIVATION_METHOD == 0) {
                        $this->message = 'wcf.user.register.success';