- @user = User.new(params[:user])
-
- @user.status = "pending"
- @user.data_public = true
- @user.description = "" if @user.description.nil?
- @user.creation_ip = request.remote_ip
- @user.languages = request.user_preferred_languages
- @user.terms_agreed = Time.now.getutc
- @user.terms_seen = true
- @user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
-
- if (session[:openid_verified])
- openid_verified = session.delete(:openid_verified)
- if (openid_verified[:identity_url]) and (openid_verified[:identity_url] == @user.openid_url) and (openid_verified[:email]) and (openid_verified[:email] == @user.email)
- # if we have an email from an OpenID provider that we trust to have verified the email for us, then activate the account directly
- # without doing our own email verification.
- @user.status = "active"
- end
- end
+ @user = session.delete(:new_user)
+
+ if Acl.no_account_creation(request.remote_ip, @user.email.split("@").last)
+ render :action => 'blocked'
+ else
+ @user.data_public = true
+ @user.description = "" if @user.description.nil?
+ @user.creation_ip = request.remote_ip
+ @user.languages = request.user_preferred_languages
+ @user.terms_agreed = Time.now.getutc
+ @user.terms_seen = true
+ @user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
+
+ if @user.save
+ flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL)
+
+ if @user.status == "active"
+ flash[:notice] = t 'user.new.flash welcome', :email => @user.email