From ebf062d977336ccb12dc8cf6e5dc984dd8c653c2 Mon Sep 17 00:00:00 2001 From: wolfpac444 Date: Sun, 16 Mar 2003 09:19:57 +0000 Subject: [PATCH] Changed to use templates --- .../default/en/members/member-password.tmpl | 21 ++++++ member-password.pl | 67 +++++++++---------- 2 files changed, 52 insertions(+), 36 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/default/en/members/member-password.tmpl diff --git a/koha-tmpl/intranet-tmpl/default/en/members/member-password.tmpl b/koha-tmpl/intranet-tmpl/default/en/members/member-password.tmpl new file mode 100644 index 0000000000..1fabc55c6a --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/members/member-password.tmpl @@ -0,0 +1,21 @@ + + + + + + +Click here to continue to see Member Info. + + +

,

+
+ > + New UserID: >
+ New Password: > +

+ +

+
+ + + diff --git a/member-password.pl b/member-password.pl index a30963c02a..bb4e27b5f8 100755 --- a/member-password.pl +++ b/member-password.pl @@ -1,27 +1,38 @@ #!/usr/bin/perl - #script to set the password, and optionally a userid, for a borrower #written 2/5/00 #by chris@katipo.co.nz +#converted to using templates 3/16/03 by mwhansen@hmc.edu use strict; - -use C4::Search; -use CGI; -use Digest::MD5 qw(md5_base64); -use C4::Output; use C4::Auth; +use C4::Output; +use C4::Interface::CGI::Output; +use C4::Search; use C4::Context; use C4::Circulation::Circ2; -#use C4::Acquisitions; +use CGI; +use HTML::Template; +use Digest::MD5 qw(md5_base64); my $input = new CGI; +my $theme = $input->param('theme') || "default"; + # only used if allowthemeoverride is set + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "members/member-password.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {borrowers => 1}, + debug => 1, + }); + my $flagsrequired; $flagsrequired->{borrowers}=1; my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired); -#print $input->header; my $member=$input->param('member'); my %env; $env{'nottodayissues'}=1; @@ -32,13 +43,15 @@ my $i=0; foreach (sort keys %$issues) { $i++; } -if ($input->param('newpassword')) { + +my $newpassword = $input->param('newpassword'); + +if ( $newpassword ) { my $digest=md5_base64($input->param('newpassword')); my $uid = $input->param('newuserid'); my $dbh=C4::Context->dbh; my $sth=$dbh->prepare("update borrowers set userid=?, password=? where borrowernumber=?"); $sth->execute($uid, $digest, $member); - print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$member"); } else { my ($bor,$flags)=getpatroninformation(\%env, $member,''); my $userid = $bor->{'userid'}; @@ -49,32 +62,14 @@ if ($input->param('newpassword')) { for (my $i=0; $i<$length; $i++) { $defaultnewpassword.=substr($chars, int(rand(length($chars))),1); } - my $spellitout=$defaultnewpassword; - $spellitout=~s/l/\001/g; - $spellitout=~s/1/\002/g; - $spellitout=~s/O/\003/g; - $spellitout=~s/o/\004/g; - $spellitout=~s/0/\005/g; - $spellitout=~s/\001/ el<\/b> /g; - $spellitout=~s/\002/ one<\/b> /g; - $spellitout=~s/\003/ Oh<\/b> /g; - $spellitout=~s/\004/ oh<\/b> /g; - $spellitout=~s/\005/ zero<\/b> /g; + $template->param( surname => $bor->{'surname'}, + firstname => $bor->{'firstname'}, + userid => $bor->{'userid'}, + defaultnewpassword => $defaultnewpassword ); - print $input->header(-cookie => $cookie); - print startpage(); - print startmenu('member'); - print qq| -

$bor->{'surname'}, $bor->{'firstname'}

-
- - New UserID:
- New Password: -

- -

- |; - print endmenu('member'); - print endpage(); } + +$template->param( member => $member, newpassword => $newpassword ); + +output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5