line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OSCAR::Callbacks; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
24
|
$Net::OSCAR::Callbacks::VERSION = '1.928'; |
4
|
|
|
|
|
|
|
} |
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
39
|
|
7
|
1
|
|
|
1
|
|
6
|
use vars qw($connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
893
|
|
8
|
|
|
|
|
|
|
sub { |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $reqdesc = ""; |
11
|
|
|
|
|
|
|
$data{subrequest} ||= 0; |
12
|
|
|
|
|
|
|
if($data{request_type} == 2) { |
13
|
|
|
|
|
|
|
$reqdesc = ADMIN_TYPE_PASSWORD_CHANGE; |
14
|
|
|
|
|
|
|
} elsif($data{request_type} == 3) { |
15
|
|
|
|
|
|
|
if(exists($data{new_email})) { |
16
|
|
|
|
|
|
|
$reqdesc = ADMIN_TYPE_EMAIL_CHANGE; |
17
|
|
|
|
|
|
|
} else { |
18
|
|
|
|
|
|
|
$reqdesc = ADMIN_TYPE_SCREENNAME_FORMAT; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} elsif($data{request_type} == 0x1E) { |
21
|
|
|
|
|
|
|
$reqdesc = ADMIN_TYPE_ACCOUNT_CONFIRM; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
delete $session->{adminreq}->{0+$reqdesc} if $reqdesc; |
24
|
|
|
|
|
|
|
$reqdesc ||= sprintf "unknown admin reply type 0x%04X/0x%04X", $data{request_type}, $data{subrequest}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $errdesc = ""; |
27
|
|
|
|
|
|
|
if(exists($data{error_code})) { |
28
|
|
|
|
|
|
|
if($reqdesc eq "account confirm") { |
29
|
|
|
|
|
|
|
$errdesc = "Your account is already confirmed."; |
30
|
|
|
|
|
|
|
} else { |
31
|
|
|
|
|
|
|
if($data{error_code} == 1) { |
32
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_DIFFSN; |
33
|
|
|
|
|
|
|
} elsif($data{error_code} == 2) { |
34
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_BADPASS; |
35
|
|
|
|
|
|
|
} elsif($data{error_code} == 6) { |
36
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_BADINPUT; |
37
|
|
|
|
|
|
|
} elsif($data{error_code} == 0xB or $data{error_code} == 0xC) { |
38
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_BADLENGTH; |
39
|
|
|
|
|
|
|
} elsif($data{error_code} == 0x13) { |
40
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_TRYLATER; |
41
|
|
|
|
|
|
|
} elsif($data{error_code} == 0x1D) { |
42
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_REQPENDING; |
43
|
|
|
|
|
|
|
} elsif($data{error_code} == 0x21) { |
44
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_EMAILLIM; |
45
|
|
|
|
|
|
|
} elsif($data{error_code} == 0x23) { |
46
|
|
|
|
|
|
|
$errdesc = ADMIN_ERROR_EMAILBAD; |
47
|
|
|
|
|
|
|
} else { |
48
|
|
|
|
|
|
|
$errdesc = sprintf("Unknown error 0x%04X.", $data{error_code}); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
$session->callback_admin_error($reqdesc, $errdesc, $data{error_url}); |
52
|
|
|
|
|
|
|
} else { |
53
|
|
|
|
|
|
|
if($reqdesc eq "screenname format") { |
54
|
|
|
|
|
|
|
$session->{screenname} = Net::OSCAR::Screenname->new(\$data{new_screenname}); |
55
|
|
|
|
|
|
|
} elsif($reqdesc eq "email change") { |
56
|
|
|
|
|
|
|
$session->{email} = $data{new_email}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
$session->callback_admin_ok($reqdesc); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
}; |