Class: ItunesController::LoginCommand
- Inherits:
-
ServerCommand
- Object
- ServerCommand
- ItunesController::LoginCommand
- Defined in:
- lib/itunesController/controllserver.rb
Overview
The login command taks the format LOGIN:<username> and causes the server to prompt for a password. This command is used to start the user login process
Instance Attribute Summary
Attributes inherited from ServerCommand
#name, #requiredLoginState, #singleThreaded
Instance Method Summary collapse
-
#initialize(state, itunes) ⇒ LoginCommand
constructor
The constructor.
-
#processData(line, io) ⇒ Boolean, String
The line is processed to get the username, then the response “222 Password?” is sent to the the client to request the password.
Methods inherited from ServerCommand
#executeSingleThreaded, #processLine
Constructor Details
#initialize(state, itunes) ⇒ LoginCommand
The constructor
196 197 198 |
# File 'lib/itunesController/controllserver.rb', line 196 def initialize(state,itunes) super(ItunesController::CommandName::LOGIN,nil,false,state,itunes) end |
Instance Method Details
#processData(line, io) ⇒ Boolean, String
The line is processed to get the username, then the response “222 Password?” is sent to the the client to request the password.
207 208 209 210 211 212 213 214 |
# File 'lib/itunesController/controllserver.rb', line 207 def processData(line,io) if (line =~ /^\:(.+)$/) @state.user=$1 @state.state=ServerState::DOING_AUTH return true,"222 Password?\r\n" end return false, "502 ERROR no username\r\n" end |