| 1 | package Net::YMSG::Login; | ||
| 2 | use base 'Net::YMSG::Event'; | ||
| 3 | use Crypt::PasswdMD5; | ||
| 4 | use strict; | ||
| 5 | |||
| 6 | sub id | ||
| 7 | { | ||
| 8 | my $self = shift; | ||
| 9 | $self->_set_by_name('ID', shift) if @_; | ||
| 10 | $self->_get_by_name('ID'); | ||
| 11 | } | ||
| 12 | |||
| 13 | |||
| 14 | sub password | ||
| 15 | { | ||
| 16 | my $self = shift; | ||
| 17 | my $password = shift; | ||
| 18 | $self->_set_by_name( | ||
| 19 | 'CRYPTED_PASSWORD', | ||
| 20 | unix_md5_crypt($password, $self->YMSG_SALT) | ||
| 21 | ); | ||
| 22 | } | ||
| 23 | |||
| 24 | |||
| 25 | sub from | ||
| 26 | { | ||
| 27 | my $self = shift; | ||
| 28 | $self->_set_by_name('NICKNAME', shift) if @_; | ||
| 29 | $self->_get_by_name('NICKNAME'); | ||
| 30 | } | ||
| 31 | |||
| 32 | |||
| 33 | sub hide | ||
| 34 | { | ||
| 35 | my $self = shift; | ||
| 36 | my $value = shift; | ||
| 37 | if ($value) { | ||
| 38 | $self->option($self->HIDE_LOGIN); | ||
| 39 | } else { | ||
| 40 | $self->option($self->DEFAULT_OPTION); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | sub code | ||
| 46 | { | ||
| 47 | return 1; | ||
| 48 | } | ||
| 49 | |||
| 50 | |||
| 51 | sub to_string | ||
| 52 | { | ||
| 53 | my $self = shift; | ||
| 54 | "I'm login Yahoo!Messenger server"; | ||
| 55 | } | ||
| 56 | |||
| 57 | 1; | ||
| 58 | __END__ |