my ($class, $patron_id) = @_;
my $type = ref($class) || $class;
my $self;
-my %ilspatron;
+ my %ilspatron;
my $kp = GetMember($patron_id,'cardnumber');
-use Data::Dumper;
-warn Dumper($kp);
+# use Data::Dumper;
+# warn Dumper($kp);
if ($kp) {
- my $pw = $kp->{password}; ## FIXME - md5hash -- deal with .
- my $dob= $kp->{dateofbirth};
- $dob =~ s/\-//g;
-my $fines_out = GetMemberAccountRecords($kp->{borrowernumber});
-my ($num_cur_issues,$cur_issues) = GetPendingIssues($kp->{borrowernumber});
-
- my $debarred = $kp->{debarred}; ### 1 if ($kp->{flags}->{DBARRED}->{noissues});
-warn "i am debarred: $debarred";
+ my $pw = $kp->{password}; ## FIXME - md5hash -- deal with .
+ my $dob= $kp->{dateofbirth};
+ $dob =~ s/\-//g;
+ my $fines_out = GetMemberAccountRecords($kp->{borrowernumber});
+ my ($num_cur_issues,$cur_issues) = GetPendingIssues($kp->{borrowernumber});
+ my $debarred = $kp->{debarred}; ### 1 if ($kp->{flags}->{DBARRED}->{noissues});
+# warn "i am debarred: $debarred";
#warn Dumper(%{$kp->{flags}});
- my $adr = $kp->{streetnumber} . " ". $kp->{address};
+ my $adr = $kp->{streetnumber} . " ". $kp->{address};
%ilspatron = (
name => $kp->{firstname} . " " . $kp->{surname},
id => $kp->{cardnumber},
}
$self = \%ilspatron;
- warn Dumper($self);
+# warn Dumper($self);
syslog("LOG_DEBUG", "new ILS::Patron(%s): found patron '%s'", $patron_id,$self->{id});
sub check_password {
my ($self, $pwd) = @_;
my $md5pwd=$self->{password}; ### FIXME - we're allowing access if user has no password.
-
-return (!$self->{password} || md5_base64($pwd) eq $md5pwd );
+ warn "check $self->{password} $pwd";
+ warn "$self->{name}";
+ return (!$self->{password} || md5_base64($pwd) eq $md5pwd );
}
sub currency {
# so we'll just do it.
$protocol_version = 2;
}
-warn "PROTOCOL: $protocol_version";
+#warn "PROTOCOL: $protocol_version";
if (!exists($handlers{$msgtag})) {
syslog("LOG_WARNING",
"new Sip::MsgType: Skipping message of unknown type '%s' in '%s'",
($lang, $date) = @{$self->{fixed_fields}};
$fields = $self->{fields};
-warn Dumper($fields);
-warn FID_INST_ID;
-warn $fields->{(FID_INST_ID)};
+#warn Dumper($fields);
+#warn FID_INST_ID;
+#warn $fields->{(FID_INST_ID)};
$ils->check_inst_id($fields->{(FID_INST_ID)}, "handle_patron_status");
$patron = $ils->find_patron($fields->{(FID_PATRON_ID)});
pat => qr/^940/,
fields => [], };
-my $invalid_pwd = { id => 'Invalid username',
+my $invalid_pwd = { id => 'Invalid password',
msg => "9300CN$username|COinvalid$password|CPThe floor|",
pat => qr/^940/,
fields => [], };
$SIPtest::login_test,
$SIPtest::sc_status_test,
{ id => 'valid Patron Status',
- msg => "2300120060101 084237AO$SIPtest::instid|AA$user_barcode|AD$user_pin|AC|",
+ msg => "2300120060101 084237AO$instid|AA$user_barcode|AD$user_pin|AC|",
pat => qr/^24 [ Y]{13}\d{3}$datepat/,
fields => [
$SIPtest::field_specs{(FID_INST_ID)},
# Valid user barcode and corresponding user password/pin and full name
our $user_barcode = '900002';
-our $user_pin = 'password';
+our $user_pin = 'sip test';
our $user_fullname= 'Firstname SURNAME';
our $user_homeaddr= '35 address';
our $user_email = 'patron@liblime.com';
our $user_phone = '555-1212';
our $user_birthday= '1983-10-06';
-our $user_ptype = 'PATRON';
+our $user_ptype = 'A';
our $user_inet = 'N';
# Valid item barcode and corresponding title
}
+$template->param( member => $member);
+
output_html_with_http_headers $input, $cookie, $template->output;