Index: kernel/user/register.php =================================================================== --- kernel/user/register.php (revision 24372) +++ kernel/user/register.php (working copy) @@ -97,7 +97,20 @@ return $Result; } // else create user object - + + if ( $http->hasSessionVariable( 'StartedRegistration' ) ) + { + eZDebug::writeWarning( 'Cancel module run to protect against multiple form submits', 'user/register' ); + $http->removeSessionVariable( "RegisterUserID" ); + $http->removeSessionVariable( 'StartedRegistration' ); + $db->commit(); + return eZModule::HOOK_STATUS_CANCEL_RUN; + } + else if ( $http->hasPostVariable( 'PublishButton' ) or $http->hasPostVariable( 'CancelButton' ) ) + { + $http->setSessionVariable( 'StartedRegistration', 1 ); + } + $ini = eZINI::instance(); $errMsg = ''; $checkErrNodeId = false; @@ -137,6 +150,15 @@ } else { + if ( $http->hasSessionVariable( 'StartedRegistration' ) ) + { + eZDebug::writeWarning( 'Cancel module run to protect against multiple form submits', 'user/register' ); + $http->removeSessionVariable( "RegisterUserID" ); + $http->removeSessionVariable( 'StartedRegistration' ); + $db->commit(); + return eZModule::HOOK_STATUS_CANCEL_RUN; + } + $userID = $http->sessionVariable( "RegisterUserID" ); } @@ -164,6 +186,7 @@ $http = eZHTTPTool::instance(); $http->removeSessionVariable( "RegisterUserID" ); + $http->removeSessionVariable( 'StartedRegistration' ); return eZModule::HOOK_STATUS_CANCEL_RUN; } @@ -328,6 +351,7 @@ $http->removeSessionVariable( "GeneratedPassword" ); $http->removeSessionVariable( "RegisterUserID" ); + $http->removeSessionVariable( 'StartedRegistration' ); // check for redirectionvariable if ( $http->hasSessionVariable( 'RedirectAfterUserRegister' ) ) Index: design/standard/templates/user/register.tpl =================================================================== --- design/standard/templates/user/register.tpl (revision 24372) +++ design/standard/templates/user/register.tpl (working copy) @@ -43,18 +43,30 @@
{section-else}