| 1 | # | ||
| 2 | # $Id: User.pm,v 0.16 2003/08/07 00:01:59 lawrence Exp $ | ||
| 3 | # | ||
| 4 | |||
| 5 | package Net::Msmgr::User; | ||
| 6 | use strict; | ||
| 7 | use warnings; | ||
| 8 | use Digest::MD5; | ||
| 9 | our @ISA = qw (Net::Msmgr::Object); | ||
| 10 | |||
| 11 | |||
| 12 | sub _fields { return shift->SUPER::_fields,( salt => undef, | ||
| 13 | user => undef, | ||
| 14 | password => undef ); } | ||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Net::Msmgr::User | ||
| 21 | |||
| 22 | =head1 SYNOPSIS | ||
| 23 | |||
| 24 | use Net::Msmgr::User; | ||
| 25 | |||
| 26 | my $user = Net::Msmgr::User->new(user => 'joeblow@msn.com', | ||
| 27 | password => 'password' ); | ||
| 28 | |||
| 29 | print "Username is: ", $user->user; | ||
| 30 | |||
| 31 | =head1 DESCRIPTION | ||
| 32 | |||
| 33 | Net::Msmgr::User is the encapsulation object for a user/password pair. | ||
| 34 | |||
| 35 | =head1 CONSTRUCTOR | ||
| 36 | |||
| 37 | my $user = new Net::Msmgr::User ( user => ... ); | ||
| 38 | |||
| 39 | - or - | ||
| 40 | |||
| 41 | my $user = Net::Msmgr::User->new(user => .... ); | ||
| 42 | |||
| 43 | Constructor parameters are: | ||
| 44 | |||
| 45 | =over | ||
| 46 | |||
| 47 | =item user (mandatory) | ||
| 48 | |||
| 49 | Registered MSN email address. | ||
| 50 | |||
| 51 | =item password (mandatory) | ||
| 52 | |||
| 53 | Your password. This is never sent "in the clear" | ||
| 54 | |||
| 55 | =back | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | =pod | ||
| 60 | |||
| 61 | =head1 INSTANCE METHODS | ||
| 62 | |||
| 63 | =over | ||
| 64 | |||
| 65 | =item $user->crypto_passwd; | ||
| 66 | |||
| 67 | Returns the MD5 hex digest of the salt, which is assigned during the | ||
| 68 | login authentication process and the user password. | ||
| 69 | |||
| 70 | =back | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | sub crypto_passwd | ||
| 75 | { | ||
| 76 | my $self = shift; | ||
| 77 | my $d = new Digest::MD5; | ||
| 78 | $d->add($self->{salt} . $self->{password} ); | ||
| 79 | return $d->hexdigest; | ||
| 80 | } | ||
| 81 | |||
| 82 | 1; | ||
| 83 | |||
| 84 | # | ||
| 85 | # $Log: User.pm,v $ | ||
| 86 | # Revision 0.16 2003/08/07 00:01:59 lawrence | ||
| 87 | # Initial Release | ||
| 88 | # | ||
| 89 | # |