[% END %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
index a73c8bb..b890529 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
@@ -84,8 +84,10 @@ please choose against which one you would like to authenticate:
-
Don't have a password yet?
If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.
-
Don't have a library card?
If you don't have a library card, stop by your local library to sign up.
+
+
Don't have a password yet?
If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.
+
Don't have a library card?
If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration %] or register here[% END %].
+
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
index d291b2a..db5c021 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
@@ -55,6 +55,8 @@
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt
new file mode 100644
index 0000000..9183824
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt
@@ -0,0 +1,29 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% INCLUDE 'doc-head-close.inc' %]
+
+
+[% IF ( OpacNav ) %]
[% ELSE %]
[% END %]
+
+[% INCLUDE 'masthead.inc' %]
+
+
+
+
+
+
+
Your updates have been submitted. A librarian will now review you updates before applying them.
+
+
+
+
+
+
+[% IF ( OpacNav ) %]
+
+ [% INCLUDE 'navigation.inc' %]
+
+[% END %]
+
+
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt
new file mode 100644
index 0000000..38c0bc7
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt
@@ -0,0 +1,713 @@
+[% USE KohaDates %]
+[% SET userupdateview = 1 %]
+
+ [% INCLUDE 'doc-head-open.inc' %]
+ [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges
+ [% INCLUDE 'doc-head-close.inc' %]
+
+
+
+
+
+
+
+ [% INCLUDE 'masthead.inc' %]
+
+
+
+
+
+
+ [% IF empty_mandatory_fields %]
+
You have not filled out all required fields. Please fill in all missing fields and resubmit.
+ [% END %]
+
+ [% IF failed_captcha %]
+
You typed in the wrong characters in the box before submitting. Please try again.
+ [% END %]
+
+
+
+
+
+
+
+
+
+
+ [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
+
+
+
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt
new file mode 100644
index 0000000..968faa0
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt
@@ -0,0 +1,70 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% INCLUDE 'doc-head-close.inc' %]
+
+
+[% IF ( OpacNav ) %]
[% ELSE %]
[% END %]
+
+[% INCLUDE 'masthead.inc' %]
+
+
+
+
+
+
Registration Complete!
+
+
You have successfully registered your new account. To log in, use the following credentials:
For your convenience, the login box on this page has been pre-filled with this data. Please log in[% IF OpacPasswordChange %] and change your password[% END %].
+ [% END %]
+ [% END %]
+ [% END %]
+
+ [% IF ( OpacNavRight ) %]
[% OpacNavRight %]
[% END %]
+
+ [% END %]
+
+
+
+
+[% IF ( OpacNav ) %]
+
+ [% INCLUDE 'navigation.inc' %]
+
+[% END %]
+
+
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt
new file mode 100644
index 0000000..bdad739
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt
@@ -0,0 +1,31 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% INCLUDE 'doc-head-close.inc' %]
+
+
+[% IF ( OpacNav ) %]
[% ELSE %]
[% END %]
+
+[% INCLUDE 'masthead.inc' %]
+
+
+
+
+
+
Please Confirm Registration
+
+
A confirmation email has been sent to the email address [% email %].
+
+
Your account will not be activated until you follow the link provided in the confirmation email.
+
+
+
+
+
+[% IF ( OpacNav ) %]
+
+ [% INCLUDE 'navigation.inc' %]
+
+[% END %]
+
+
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/mainpage.pl b/mainpage.pl
index f834985..78dbe66 100755
--- a/mainpage.pl
+++ b/mainpage.pl
@@ -28,7 +28,9 @@ use C4::NewsChannels;
use C4::Review qw/numberofreviews/;
use C4::Suggestions qw/CountSuggestion/;
use C4::Tags qw/get_count_by_tag_status/;
-my $query = new CGI;
+use Koha::Borrower::Modifications;
+
+my $query = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
@@ -36,9 +38,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
query => $query,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {
- catalogue => 1,
- },
+ flagsrequired => { catalogue => 1, },
}
);
@@ -50,14 +50,17 @@ $template->param(
koha_news_count => $koha_news_count
);
-my $pendingcomments = numberofreviews(0);
-my $pendingtags = get_count_by_tag_status(0);
-my $pendingsuggestions = CountSuggestion("ASKED");
+my $pendingcomments = numberofreviews(0);
+my $pendingtags = get_count_by_tag_status(0);
+my $pendingsuggestions = CountSuggestion("ASKED");
+my $pending_borrower_modifications =
+ Koha::Borrower::Modifications->GetPendingModificationsCount();
$template->param(
- pendingcomments => $pendingcomments,
- pendingtags => $pendingtags,
- pendingsuggestions => $pendingsuggestions
+ pendingcomments => $pendingcomments,
+ pendingtags => $pendingtags,
+ pendingsuggestions => $pendingsuggestions,
+ pending_borrower_modifications => $pending_borrower_modifications,
);
output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/members/members-update-do.pl b/members/members-update-do.pl
new file mode 100755
index 0000000..147975a
--- /dev/null
+++ b/members/members-update-do.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+# Parts Copyright Biblibre 2010
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Context;
+use C4::Members;
+use C4::Branch;
+use C4::Category;
+use Koha::Borrower::Modifications;
+
+my $query = new CGI;
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "about.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { borrowers => 1 },
+ debug => 1,
+ }
+);
+
+my @params = $query->param;
+
+foreach my $param (@params) {
+ if ( $param =~ "^modify_" ) {
+ my (undef, $borrowernumber) = split( /_/, $param );
+
+ my $action = $query->param($param);
+
+ if ( $action eq 'approve' ) {
+ Koha::Borrower::Modifications->ApproveModifications( $borrowernumber );
+ }
+ elsif ( $action eq 'deny' ) {
+ Koha::Borrower::Modifications->DenyModifications( $borrowernumber );
+ }
+ elsif ( $action eq 'ignore' ) {
+
+ }
+ }
+}
+
+print $query->redirect("/cgi-bin/koha/mainpage.pl");
diff --git a/members/members-update.pl b/members/members-update.pl
new file mode 100755
index 0000000..9ffcf42
--- /dev/null
+++ b/members/members-update.pl
@@ -0,0 +1,59 @@
+#!/usr/bin/perl
+
+# Parts Copyright Biblibre 2010
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Context;
+use C4::Members;
+use C4::Branch;
+use C4::Category;
+use Koha::Borrower::Modifications;
+
+my $query = new CGI;
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "members/members-update.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { borrowers => 1 },
+ debug => 1,
+ }
+);
+
+my $pending_modifications =
+ Koha::Borrower::Modifications->GetPendingModifications();
+
+my $borrowers;
+foreach my $pm (@$pending_modifications) {
+ $borrowers->{ $pm->{'borrowernumber'} } =
+ GetMember( borrowernumber => $pm->{'borrowernumber'} );
+
+}
+
+$template->param(
+ PendingModifications => $pending_modifications,
+ borrowers => $borrowers,
+);
+
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/misc/cronjobs/delete_expired_opac_registrations.pl b/misc/cronjobs/delete_expired_opac_registrations.pl
new file mode 100755
index 0000000..c588b03
--- /dev/null
+++ b/misc/cronjobs/delete_expired_opac_registrations.pl
@@ -0,0 +1,54 @@
+#!/usr/bin/perl
+
+# Copyright 2009-2010 Kyle Hall
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+BEGIN {
+
+ # find Koha's Perl modules
+ # test carefully before changing this
+ use FindBin;
+ eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+use C4::Context;
+use C4::Members qw/ DelMember /;
+
+## Delete accounts that haven't been upgraded from the 'temporary' category code'
+my $delay =
+ C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
+my $category_code =
+ C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
+
+my $query = "
+ SELECT borrowernumber
+ FROM borrowers
+ WHERE
+ categorycode = ?
+ AND
+ DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? )
+";
+
+my $dbh = C4::Context->dbh;
+my $sth = $dbh->prepare($query);
+$sth->execute( $category_code, $delay );
+
+while ( my ($borrowernumber) = $sth->fetchrow_array() ) {
+ DelMember($borrowernumber);
+}
diff --git a/misc/cronjobs/delete_unverified_opac_registrations.pl b/misc/cronjobs/delete_unverified_opac_registrations.pl
new file mode 100755
index 0000000..78c2137
--- /dev/null
+++ b/misc/cronjobs/delete_unverified_opac_registrations.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+# Copyright 2009-2010 Kyle Hall
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+BEGIN {
+
+ # find Koha's Perl modules
+ # test carefully before changing this
+ use FindBin;
+ eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+use C4::Context;
+use C4::Members qw/ DelMember /;
+
+my $dbh = C4::Context->dbh;
+
+$dbh->do( "
+ DELETE FROM borrower_modifications
+ WHERE
+ borrowernumber = 0
+ AND
+ TIME_TO_SEC( TIMEDIFF( NOW(), timestamp )) / 3600 > 24
+" );
diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl
new file mode 100755
index 0000000..cf24176
--- /dev/null
+++ b/opac/opac-memberentry.pl
@@ -0,0 +1,273 @@
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use CGI;
+use Digest::MD5 qw( md5_base64 md5_hex );
+use String::Random qw( random_string );
+
+use C4::Auth;
+use C4::Output;
+use C4::Members;
+use Koha::Borrower::Modifications;
+use C4::Branch qw(GetBranchesLoop);
+
+my $cgi = new CGI;
+my $dbh = C4::Context->dbh;
+
+unless ( C4::Context->preference('PatronSelfRegistration') ) {
+ print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
+ exit;
+}
+
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "opac-memberentry.tmpl",
+ type => "opac",
+ query => $cgi,
+ authnotrequired => 1,
+ }
+);
+
+$template->param(
+ hidden => GetHiddenFields(),
+ mandatory => GetMandatoryFields(),
+ member_titles => GetTitles(),
+ branches => GetBranchesLoop()
+);
+
+my $action = $cgi->param('action') || q{};
+if ( $action eq 'create' ) {
+
+ my %borrower = ParseCgiForBorrower($cgi);
+
+ %borrower = DelEmptyFields(%borrower);
+
+ my @empty_mandatory_fields = CheckMandatoryFields( \%borrower );
+
+ if (@empty_mandatory_fields) {
+ $template->param(
+ empty_mandatory_fields => \@empty_mandatory_fields,
+ borrower => \%borrower
+ );
+ }
+ elsif (
+ md5_base64( $cgi->param('captcha') ) ne $cgi->param('captcha_digest') )
+ {
+ $template->param(
+ failed_captcha => 1,
+ borrower => \%borrower
+ );
+ }
+ else {
+ if (
+ C4::Context->boolean_preference(
+ 'PatronSelfRegistrationVerifyByEmail')
+ )
+ {
+ ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "opac-registration-email-sent.tmpl",
+ type => "opac",
+ query => $cgi,
+ authnotrequired => 1,
+ }
+ );
+ $template->param( 'email' => $borrower{'email'} );
+
+ my $verification_token = md5_hex( \%borrower );
+ $borrower{'password'} = random_string("..........");
+
+ Koha::Borrower::Modifications->new(
+ verification_token => $verification_token )
+ ->AddModifications(%borrower);
+
+ #Send verification email
+ my $letter = C4::Letters::GetPreparedLetter(
+ module => 'members',
+ letter_code => 'OPAC_REG_VERIFY',
+ tables => {
+ borrower_modifications =>
+ [ $verification_token, $verification_token ],
+ },
+ );
+
+ C4::Letters::EnqueueLetter(
+ {
+ letter => $letter,
+ message_transport_type => 'email',
+ to_address => $borrower{'email'},
+ from_address =>
+ C4::Context->preference('KohaAdminEmailAddress'),
+ }
+ );
+ }
+ else {
+ ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "opac-registration-confirmation.tmpl",
+ type => "opac",
+ query => $cgi,
+ authnotrequired => 1,
+ }
+ );
+
+ $template->param( OpacPasswordChange =>
+ C4::Context->preference('OpacPasswordChange') );
+
+ my ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
+
+ $template->param( password_cleartext => $password );
+ $template->param(
+ borrower => GetMember( borrowernumber => $borrowernumber ) );
+ $template->param(
+ PatronSelfRegistrationAdditionalInstructions =>
+ C4::Context->preference(
+ 'PatronSelfRegistrationAdditionalInstructions')
+ );
+ }
+ }
+}
+elsif ( $action eq 'update' ) {
+ ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "opac-memberentry-update-submitted.tmpl",
+ type => "opac",
+ query => $cgi,
+ authnotrequired => 1,
+ }
+ );
+
+ my %borrower = ParseCgiForBorrower($cgi);
+
+ %borrower = DelUnchangedFields( $borrowernumber, %borrower );
+
+ my $m =
+ Koha::Borrower::Modifications->new( borrowernumber => $borrowernumber );
+
+ $m->DelModifications;
+ $m->AddModifications(%borrower);
+}
+elsif ($borrowernumber) { #Display logged in borrower's data
+ $action = 'edit';
+
+ $template->param(
+ borrower => GetMember( borrowernumber => $borrowernumber ) );
+}
+
+my $captcha = random_string("CCCCC");
+
+$template->param(
+ captcha => $captcha,
+ captcha_digest => md5_base64($captcha)
+);
+
+$template->param( action => $action );
+
+output_html_with_http_headers $cgi, $cookie, $template->output;
+
+sub GetHiddenFields {
+ my %hidden_fields;
+
+ my $BorrowerUnwantedField =
+ C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
+
+ my @fields = split( /\|/, $BorrowerUnwantedField );
+ foreach (@fields) {
+ next unless m/\w/o;
+ $hidden_fields{$_} = 1;
+ }
+
+ return \%hidden_fields;
+}
+
+sub GetMandatoryFields {
+ my %mandatory_fields;
+
+ my $BorrowerMandatoryField =
+ C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
+
+ my @fields = split( /\|/, $BorrowerMandatoryField );
+
+ foreach (@fields) {
+ $mandatory_fields{$_} = 1;
+ }
+
+ $mandatory_fields{'email'} = 1
+ if C4::Context->boolean_preference('PatronSelfRegistrationVerifyByEmail');
+
+ return \%mandatory_fields;
+}
+
+sub CheckMandatoryFields {
+ my ($borrower) = @_;
+
+ my @empty_mandatory_fields;
+
+ my $mandatory_fields = GetMandatoryFields();
+ delete $mandatory_fields->{'cardnumber'};
+
+ foreach my $key ( keys %$mandatory_fields ) {
+ push( @empty_mandatory_fields, $key )
+ unless ( defined( $borrower->{$key} ) && $borrower->{$key} );
+ }
+
+ return @empty_mandatory_fields;
+}
+
+sub ParseCgiForBorrower {
+ my ($cgi) = @_;
+
+ my %borrower;
+
+ foreach ( $cgi->param ) {
+ my ($key) = substr( $_, 9 );
+ $borrower{$key} = $cgi->param($_)
+ if ( $_ =~ '^borrower_' );
+ }
+
+ $borrower{'dateofbirth'} =
+ C4::Dates->new( $borrower{'dateofbirth'} )->output("iso")
+ if ( defined( $borrower{'dateofbirth'} ) );
+
+ return %borrower;
+}
+
+sub DelUnchangedFields {
+ my ( $borrowernumber, %new_data ) = @_;
+
+ my $current_data = GetMember( borrowernumber => $borrowernumber );
+
+ foreach my $key ( keys %new_data ) {
+ if ( $current_data->{$key} eq $new_data{$key} ) {
+ delete $new_data{$key};
+ }
+ }
+
+ return %new_data;
+}
+
+sub DelEmptyFields {
+ my (%borrower) = @_;
+
+ foreach my $key ( keys %borrower ) {
+ delete $borrower{$key} unless $borrower{$key};
+ }
+
+ return %borrower;
+}
diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl
new file mode 100755
index 0000000..bf0eae4
--- /dev/null
+++ b/opac/opac-registration-verify.pl
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use CGI;
+
+use C4::Auth;
+use C4::Output;
+use C4::Members;
+use Koha::Borrower::Modifications;
+
+my $cgi = new CGI;
+my $dbh = C4::Context->dbh;
+
+unless ( C4::Context->preference('PatronSelfRegistration') ) {
+ print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
+ exit;
+}
+
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "opac-registration-confirmation.tmpl",
+ type => "opac",
+ query => $cgi,
+ authnotrequired => 1,
+ }
+);
+
+$template->param(
+ OpacPasswordChange => C4::Context->preference('OpacPasswordChange') );
+
+my $token = $cgi->param('token');
+my $m = Koha::Borrower::Modifications->new( verification_token => $token );
+
+if ( $m->Verify() ) {
+ my $borrower = $m->GetModifications();
+
+ my $password;
+ ( $borrowernumber, $password ) = AddMember_Opac(%$borrower);
+
+ if ($borrowernumber) {
+ $m->DelModifications();
+
+ $template->param( password_cleartext => $password );
+ $template->param(
+ borrower => GetMember( borrowernumber => $borrowernumber ) );
+ $template->param(
+ PatronSelfRegistrationAdditionalInstructions =>
+ C4::Context->preference(
+ 'PatronSelfRegistrationAdditionalInstructions')
+ );
+ }
+
+}
+else {
+
+}
+
+output_html_with_http_headers $cgi, $cookie, $template->output;
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index 50a167e..e1fd678 100755
--- a/opac/opac-user.pl
+++ b/opac/opac-user.pl
@@ -367,7 +367,7 @@ $template->param(
$template->param( DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar() );
$template->param(
SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
- AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') ,
+ AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
);
output_html_with_http_headers $query, $cookie, $template->output;
--
1.7.10.4