Details
-
Bug
-
Resolution: Fixed
-
Medium
-
3.10.0, 3.10.1rc1, 3.9.4, 4.0.0, 4.0.1rc1
-
None
Description
$contentObject = $class->instantiate( $userCreatorID, $defaultSectionID ); $objectID = $contentObject->attribute( 'id' ); // Store the ID in session variable $http->setSessionVariable( "RegisterUserID", $objectID ); $userID = $objectID; $nodeAssignment = eZNodeAssignment::create( array( 'contentobject_id' => $contentObject->attribute( 'id' ), 'contentobject_version' => 1, 'parent_node' => $defaultUserPlacement, 'is_main' => 1 ) ); $nodeAssignment->store();
should be in a database transaction.
There's more... setting is_enabled attribute and adding verification code should also be in a transaction I think:
// Disable user account and send verification mail to the user $userSetting = eZUserSetting::fetch( $user->attribute( 'contentobject_id' ) ); $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( time() . $user->attribute( 'contentobject_id' ) ); $accountKey = eZUserAccountKey::createNew( $user->attribute( 'contentobject_id' ), $hash, time() ); $accountKey->store();