3.10 User Registration Update

Well thanks has to go to Kristof Coomans for the quick patch on the 3.10 user registration issue. For starters that means you can now register on this site, but it should also make it a lot easier to start rolling out sites on 3.10.

I have included the patch information below:

** Watch out for long lines wrapping below – please copy and paste to a text editor to preserve line breaks ** – will implement a fix on the site for this in near future

	Index: kernel/user/register.php
===================================================================
--- kernel/user/register.php    (revision 20561)
+++ kernel/user/register.php    (working copy)

@@ -163,7 +163,6 @@
             // Check if user should be enabled and logged in
             unset($user);
             $user = eZUser::fetch( $object->attribute( 'id' ) );
-            $user->loginCurrent();

             $receiver = $user->attribute( 'email' );
             $mail = new eZMail();
@@ -193,9 +192,6 @@
                 $userSetting->setAttribute( 'is_enabled', 0 );

                 $userSetting->store();

-                // Log out current user
-                eZUser::logoutCurrent();
-

                 // Create enable account hash and send it to the newly registered user
                 $hash = md5( mktime( ) . $user->attribute( 'contentobject_id' ) );
                 include_once( "kernel/classes/datatypes/ezuser/ezuseraccountkey.php" );
@@ -204,6 +200,10 @@

                 $tpl->setVariable( 'hash', $hash );
             }
+            else
+            {
+                $user->loginCurrent();

+            }

             $templateResult =& $tpl->fetch( 'design:user/registrationinfo.tpl' );
             $emailSender = $ini->variable( 'MailSettings', 'EmailSender' );

In addition the .patch file can be downloaded from the eZ Issue Tracker at Bug ID: 11598

Special thanks must go to Kristof for aiding in debugging an additional template problem plaguing the registration form on this site, everything is now working properly :)


 
 
 
blog comments powered by Disqus