+ else
+ @user = User.new(params[:user])
+
+ @user.visible = true
+ @user.data_public = true
+ @user.description = "" if @user.description.nil?
+ @user.creation_ip = request.remote_ip
+ @user.languages = request.user_preferred_languages
+
+ if @user.save
+ flash[:notice] = t 'user.new.flash create success message'
+ Notifier.deliver_signup_confirm(@user, @user.tokens.create)
+ redirect_to :action => 'login'
+ else
+ render :action => 'new'
+ end
+ end
+ end
+
+ def account
+ @title = t 'user.account.title'
+
+ if params[:user] and params[:user][:display_name] and params[:user][:description]
+ if params[:user][:email] != @user.email
+ @user.new_email = params[:user][:email]
+ end
+
+ @user.display_name = params[:user][:display_name]
+
+ if params[:user][:pass_crypt].length > 0 or params[:user][:pass_crypt_confirmation].length > 0
+ @user.pass_crypt = params[:user][:pass_crypt]
+ @user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation]
+ end
+
+ @user.description = params[:user][:description]
+ @user.languages = params[:user][:languages].split(",")
+ @user.home_lat = params[:user][:home_lat]
+ @user.home_lon = params[:user][:home_lon]
+
+ if @user.save
+ set_locale
+
+ if params[:user][:email] == @user.new_email
+ flash[:notice] = t 'user.account.flash update success confirm needed'
+ Notifier.deliver_email_confirm(@user, @user.tokens.create)
+ else
+ flash[:notice] = t 'user.account.flash update success'
+ end
+ end