From: berick Date: Thu, 7 Apr 2011 15:18:23 +0000 (-0400) Subject: implemented username update X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2ff0d7d9dd635707b29874a5b215317339774260;p=evergreen%2Fequinox.git implemented username update --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 33e2822501..79ab04f452 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -124,6 +124,7 @@ sub load { return $self->load_myopac_payments if $path =~ m|opac/myopac/main_payments|; return $self->load_myopac_main if $path =~ m|opac/myopac/main|; return $self->load_myopac_update_email if $path =~ m|opac/myopac/update_email|; + return $self->load_myopac_update_username if $path =~ m|opac/myopac/update_username|; return $self->load_myopac_bookbags if $path =~ m|opac/myopac/lists|; return $self->load_myopac_bookbag_update if $path =~ m|opac/myopac/list/update|; return $self->load_myopac_circ_history if $path =~ m|opac/myopac/circ_history|; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index e51ddd95c2..3bde775fe7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -668,6 +668,36 @@ sub load_myopac_update_email { return $self->generic_redirect($url); } +sub load_myopac_update_username { + my $self = shift; + my $e = $self->editor; + my $ctx = $self->ctx; + my $username = $self->cgi->param('username') || ''; + + unless($username and $username !~ /\s/) { # any other username restrictions? + $ctx->{invalid_username} = $username; + return Apache2::Const::OK; + } + + if($username ne $e->requestor->usrname) { + + my $evt = $U->simplereq( + 'open-ils.actor', + 'open-ils.actor.user.username.update', + $e->authtoken, $username); + + if($U->event_equals($evt, 'USERNAME_EXISTS')) { + $ctx->{username_exists} = $username; + return Apache2::Const::OK; + } + } + + my $url = $self->apache->unparsed_uri; + $url =~ s/update_username/prefs/; + + return $self->generic_redirect($url); +} + sub load_myopac_bookbags { my $self = shift; my $e = $self->editor; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 67e419d0e7..36e67973c0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -267,7 +267,7 @@ sub load_locale_handlers { our %Lexicon = (%Lexicon, %{ Locale::Maketext::Lexicon::Gettext->parse() }); close F; } else { - warn "unable to open messages file: $messages"; + warn "EGWeb: unable to open messages file: $messages"; } } EVAL diff --git a/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 b/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 index 4b2f27b941..28d4b2a2e2 100644 --- a/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 +++ b/Open-ILS/web/templates/default/opac/myopac/circ_history.tt2 @@ -19,7 +19,7 @@
- [% l('Current Items Checked Out') %] + [% l('Previously Checked Out Items') %] [% IF offset > 0 %] [% l('Previous') %] @@ -37,22 +37,10 @@ [% IF ctx.circs.size < 1 %]
- [% l('You have no items checked out.') %] + [% l('There are no items in your circulation history.') %]
[% ELSE %] - [% IF ctx.success_renewals %] -
- [% l("Successfully renewed [_1] item(s)", ctx.success_renewals) %] -
- [% END %] - - [% IF ctx.failed_renewals %] -
- [% l("Failed to renew [_1] item(s)", ctx.failed_renewals) %] -
- [% END %] -
@@ -97,9 +85,12 @@ [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT); %] diff --git a/Open-ILS/web/templates/default/opac/myopac/prefs.tt2 b/Open-ILS/web/templates/default/opac/myopac/prefs.tt2 index 5846c153ff..37cce3dee4 100644 --- a/Open-ILS/web/templates/default/opac/myopac/prefs.tt2 +++ b/Open-ILS/web/templates/default/opac/myopac/prefs.tt2 @@ -152,24 +152,14 @@ - - - + + [% l('Change') %] - - - [% IF ctx.user.ident_value %] diff --git a/Open-ILS/web/templates/default/opac/myopac/update_email.tt2 b/Open-ILS/web/templates/default/opac/myopac/update_email.tt2 index 92aed44faa..2261c29351 100644 --- a/Open-ILS/web/templates/default/opac/myopac/update_email.tt2 +++ b/Open-ILS/web/templates/default/opac/myopac/update_email.tt2 @@ -1,7 +1,7 @@ [% PROCESS "default/opac/parts/header.tt2"; PROCESS "default/opac/parts/misc_util.tt2"; WRAPPER "default/opac/parts/myopac/base.tt2"; - myopac_page = "update_email" %] + myopac_page = "prefs" %]
[% IF ctx.invalid_email %]
- [% IF circ.circ.checkin_time; - date.format(ctx.parse_datetime(circ.circ.checkin_time),DATE_FORMAT); - END; %] + [% + IF circ.circ.checkin_time; + date.format(ctx.parse_datetime(circ.circ.checkin_time),DATE_FORMAT); + ELSE; %] + * + [% END; %] [% circ.circ.target_copy.barcode %] [% circ.circ.target_copy.call_number.label %]
-
- - Username Help +
+ Username Help
[% l("Username") %]
[% ctx.user.usrname | html %][% l("Change") %][% ctx.user.usrname | html %][% l("Change") %]
- - [% l("Enter new email address:") %] - - - - - - - - -
[% l("Primary Identification") %]