File Coverage

blib/lib/Net/OSCAR/Callbacks/23/authorization_response.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 14 100.0


line stmt bran cond sub pod time code
1             package Net::OSCAR::Callbacks;
2             BEGIN {
3 1     1   129 $Net::OSCAR::Callbacks::VERSION = '1.928';
4             }
5 1     1   9 use strict;
  1         2  
  1         42  
6 1     1   4 use warnings;
  1         2  
  1         41  
7 1     1   4 use vars qw($connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
  1         2  
  1         423  
8             sub {
9              
10             if($data{error}) {
11             my $error = $data{error};
12             $session->crapout($connection, "Invalid screenname.") if $error == 0x01;
13             $session->crapout($connection, "Invalid password.") if $error == 0x05;
14             $session->crapout($connection, "You've been connecting too frequently.") if $error == 0x18;
15             my($errstr) = ((ERRORS)[$error]) || "unknown error";
16             $errstr .= " ($data{error_details})" if $data{error_details};
17             $session->crapout($connection, $errstr, $error);
18             return 0;
19             } else {
20             $connection->log_print(OSCAR_DBG_SIGNON, "Login OK - connecting to BOS");
21             $session->addconn(
22             auth => $data{auth_cookie},
23             conntype => CONNTYPE_BOS,
24             description => "basic OSCAR service",
25             peer => $data{server_ip}
26             );
27             $connection->{closing} = 1;
28             $connection->disconnect;
29             $session->{screenname} = $data{screenname};
30             $session->{email} = $data{email};
31              
32             Net::OSCAR::Screenname->new(\$session->{screenname});
33             }
34              
35             };