$self->load_simple("myopac") if $path =~ m:opac/myopac:; # A default page for myopac parts
- # maybe make these optional parts of load_patron_reg?
- #return $self->load_ecard_form if $path =~ m|opac/ecard/form|;
+ # PINES - online account registration
return $self->load_ecard_submit if $path =~ m|opac/ecard/submit|;
- # this line is only used if verifying by email (from KCLS code):
- # return $self->load_ecard_verify if $path =~ m|opac/ecard/verify|;
# PINES - online account renewal
return $self->load_simple("renew-account") if $path =~ m|opac/renew-account|;
- return $self->load_ecard_submit if $path =~ m|opac/renew/submit|;
if($path =~ m|opac/login|) {
return $self->load_login unless $self->editor->requestor; # already logged in?
}
$logger->info("ECARD: Submit params: $msg");
+#TERRAN - dump out all incoming stuff from form
+$logger->error("TERRAN - all incoming params: $msg");
+
}
sub handle_testmode_api {
my $cgi = $self->cgi;
#determine whether this is a new registration or a renewal
- my $refpath = $self->apache->path_info;
- if ($refpath =~ m|opac/renew/submit|) {
+ if ($cgi->param('patron_id') > 1) {
$update_type = 'renew';
} else {
$update_type = 'register';
}
+ #TERRAN TEST ECARD CONNECTION
+ $logger->error("TERRAN ACTION TYPE: $update_type");
+
$self->log_params;
my $testmode = $cgi->param('testmode') || '';
return $self->compile_response unless $self->save_user;
return $self->compile_response if $ctx->{response}->{status};
}
-
+
+
+# Add extra info to response message
$ctx->{response}->{status} = 'OK';
- $ctx->{response}->{barcode} = $ctx->{user}->card->barcode;
+
if ($update_type eq 'renew') {
$ctx->{response}->{expire_date} = $ctx->{user}->expire_date;
- }
+ # TERRAN - Add code if this is a temp renewal
+ # TERRAN - Add home library code
+ } else {
+ $ctx->{response}->{barcode} = $ctx->{user}->card->barcode;
+ }
return $self->compile_response;
}
$logger->info("ECARD responding with " . $ctx->{response});
#TERRAN TEST
-$logger->error("TERRAN response being sent to Quipu is: " . $ctx->{response});
+ $logger->error("TERRAN - compiled response is " . $ctx->{response});
return Apache2::Const::OK;
}
$au->isnew(1);
$au->net_access_level(1); # Filtered
$au->name_keywords($in_house ? 'quipu_inhouse' : 'quipu_remote');
- my $home_ou = $cgi->param('home_ou');
- my $perm_grp = $U->ou_ancestor_setting_value(
- $home_ou,
- 'lib.ecard_patron_profile'
- );
+# TERRAN - for testing purposes, hardcoding the home_ou temporarily
+# my $home_ou = $cgi->param('home_ou');
+ my $home_ou = '4';
+
+# TERRAN - for testing purposes, hardcoding perm_grp temporarily
+# my $perm_grp = $U->ou_ancestor_setting_value(
+# $home_ou,
+# 'lib.ecard_patron_profile'
+# );
+ my $perm_grp = '2';
$au->profile($perm_grp);
my $grp = new_editor()->retrieve_permission_grp_tree($perm_grp);
$val = undef if $field eq 'day_phone' && $val eq '--';
$self->verify_dob($val) if $field eq 'dob' && $val;
+
$au->$field($val);
}
# If existing account, update instead of create
sub update_user {
+
my $self = shift;
my @extra_flesh = @_;
my $e = $self->editor;