Public Member Functions | |
My_Authenticator () | |
~My_Authenticator () | |
virtual bool | authenticate (ACE::INet::AuthenticationBase &auth) const |
Definition at line 69 of file FTP_Simple_exec.cpp.
My_Authenticator::My_Authenticator | ( | ) | [inline] |
Definition at line 73 of file FTP_Simple_exec.cpp.
{}
My_Authenticator::~My_Authenticator | ( | ) | [inline] |
Definition at line 74 of file FTP_Simple_exec.cpp.
{}
virtual bool My_Authenticator::authenticate | ( | ACE::INet::AuthenticationBase & | authentication | ) | const [inline, virtual] |
Verifies authentication for given info and returns true if verification succeeded, false otherwise. If true, the authentication information is updated with the actual credentials.
Implements ACE::INet::AuthenticatorBase.
Definition at line 76 of file FTP_Simple_exec.cpp.
{ if (!password.empty ()) auth.password (password); if (do_login) { std::cout << "Authentication (" << auth.scheme() << ") required." << std::endl; std::cout << "Realm : " << auth.realm () << std::endl << "User: " << auth.user() << std::endl << "Password: \t\t\t (Enter password or press enter for default)\rPassword: "; char buf[80] = {0}; u_int n = 0; int ch = 0; while (n < (sizeof(buf)-1) && (ch = std::cin.get ()) != '\n' && ch != std::char_traits<char>::eof ()) { buf[n++] = char(ch); } if (n>0) auth.password (buf); } return true; }