Sha256: 7485256ed6ac23525c27776e9b1828119e2b6b3538119c077bfb93d0ee2df30e

Contents?: true

Size: 631 Bytes

Versions: 4

Compression:

Stored size: 631 Bytes

Contents

module LunarShell
  module Satellites
    class SuController < LunarShell::SatellitesController
      def run
        render 'no_username' and return unless provided_username
      end

      def create

        if !log_in!(su_params[:username]).
            try(:authenticate, su_params[:password])
          log_out!
          @error_message = 'Sorry'
        end
      end

      private

      def provided_username
        @provided_username ||= parameters.try(:first)
      end
      helper_method :provided_username

      def su_params
        params.require(:user).permit(:password, :username)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lunar_shell-0.5.2 app/controllers/lunar_shell/satellites/su_controller.rb
lunar_shell-0.5.0 app/controllers/lunar_shell/satellites/su_controller.rb
lunar_shell-0.4.1 app/controllers/lunar_shell/satellites/su_controller.rb
lunar_shell-0.3.0 app/controllers/lunar_shell/satellites/su_controller.rb