Class: Ftpd::CmdLogin
- Inherits:
-
CommandHandler
- Object
- CommandHandler
- Ftpd::CmdLogin
- Defined in:
- lib/ftpd/cmd_login.rb
Overview
The login commands
Constant Summary
Constants inherited from CommandHandler
Ftpd::CommandHandler::COMMAND_FILENAME_PREFIX, Ftpd::CommandHandler::COMMAND_KLASS_PREFIX, Ftpd::CommandHandler::COMMAND_METHOD_PREFIX
Instance Attribute Summary collapse
-
#password ⇒ String
The password for the current login sequence.
-
#user ⇒ String
The user for the current login sequence.
Instance Method Summary collapse
-
#cmd_acct(argument) ⇒ Object
The Account (ACCT) command.
-
#cmd_pass(argument) ⇒ Object
The Password (PASS) command.
-
#cmd_user(argument) ⇒ Object
-
User Name (USER) command.
-
-
#initialize ⇒ CmdLogin
constructor
A new instance of CmdLogin.
Methods inherited from CommandHandler
Methods included from FileSystemHelper
#ensure_accessible, #ensure_directory, #ensure_does_not_exist, #ensure_exists, #ensure_file_system_supports, #path_list, #unique_path
Methods included from Error
#error, #sequence_error, #syntax_error, #unimplemented_error
Methods included from DataConnectionHelper
#close_data_server_socket_when_done, #data_connection_description, #encrypt_data?, #handle_data_disconnect, #make_tls_connection, #open_active_data_connection, #open_active_tls_data_connection, #open_data_connection, #open_passive_data_connection, #open_passive_tls_data_connection, #receive_file, #send_start_of_data_connection_reply, #transmit_file
Constructor Details
#initialize ⇒ CmdLogin
Returns a new instance of CmdLogin.
17 18 19 20 21 |
# File 'lib/ftpd/cmd_login.rb', line 17 def initialize(*) super @user = nil @password = nil end |
Instance Attribute Details
#password ⇒ String
Returns The password for the current login sequence.
15 16 17 |
# File 'lib/ftpd/cmd_login.rb', line 15 def password @password end |
#user ⇒ String
Returns The user for the current login sequence.
11 12 13 |
# File 'lib/ftpd/cmd_login.rb', line 11 def user @user end |
Instance Method Details
#cmd_acct(argument) ⇒ Object
The Account (ACCT) command
52 53 54 55 56 |
# File 'lib/ftpd/cmd_login.rb', line 52 def cmd_acct(argument) syntax_error unless argument account = argument login @user, @password, account end |
#cmd_pass(argument) ⇒ Object
The Password (PASS) command
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ftpd/cmd_login.rb', line 39 def cmd_pass(argument) syntax_error unless argument @password = argument if config.auth_level > AUTH_PASSWORD reply "332 Account required" expect 'acct' else login @user, @password end end |
#cmd_user(argument) ⇒ Object
-
User Name (USER) command.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ftpd/cmd_login.rb', line 25 def cmd_user(argument) syntax_error unless argument sequence_error if logged_in @user = argument if config.auth_level > AUTH_USER reply "331 Password required" expect 'pass' else login @user end end |