def create
      @user = Incline::User.new(user_params :before_create)

      if system_admin? # skip recaptcha check if an admin is currently logged in.
        @user.recaptcha = :verified
      end

      if @user.valid?
        if @user.save
          @user.send_activation_email request.remote_ip
          if system_admin?
            flash[:info] = "The user #{@user} has been created, but will need to activate their account before use."
            additional_params = user_params :after_create
            if additional_params.any?
              unless @user.update_attributes(additional_params)
                flash[:warning] = 'Failed to apply additional attributes to new user account.'
              end
            end
            if inline_request?
              render 'show', formats: [ :json ]
            else
              redirect_to users_url
            end
            return
          else
            flash[:safe_info] = 'Your account has been created, but needs to be activated before you can use it.<br>Please check your email to activate your account.'
            if inline_request?
              render 'show', formats: [ :json ]
            else
              redirect_to main_app.root_url
            end
            return
          end
        else
          @user.errors[:base] << 'Failed to create user account.'
        end
      end
      render 'new'
    end
def create
      @user = Incline::User.new(user_params :before_create)

      if system_admin? # skip recaptcha check if an admin is currently logged in.
        @user.recaptcha = :verified
      end

      if @user.valid?
        if @user.save
          @user.send_activation_email request.remote_ip
          if system_admin?
            flash[:info] = "The user #{@user} has been created, but will need to activate their account before use."
            additional_params = user_params :after_create
            if additional_params.any?
              unless @user.update_attributes(additional_params)
                flash[:warning] = 'Failed to apply additional attributes to new user account.'
              end
            end
            if inline_request?
              render 'show', formats: [ :json ]
            else
              redirect_to users_url
            end
            return
          else
            flash[:safe_info] = 'Your account has been created, but needs to be activated before you can use it.<br>Please check your email to activate your account.'
            if inline_request?
              render 'show', formats: [ :json ]
            else
              redirect_to main_app.root_url
            end
            return
          end
        else
          @user.errors[:base] << 'Failed to create user account.'
        end
      end
      render 'new'
    end
POST /incline/signup