From df9296696b1d8576dce981398bdbd8d193cce3e4 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sat, 8 Dec 2007 17:33:04 -0600 Subject: [PATCH] get_template_and_user returns $flags from checkauth for in-page perms. Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 2 +- members/member-password.pl | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 63b6ea5252..cb7c338153 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -317,7 +317,7 @@ sub get_template_and_user { OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"), ); } - return ( $template, $borrowernumber, $cookie ); + return ( $template, $borrowernumber, $cookie, $flags); } =item checkauth diff --git a/members/member-password.pl b/members/member-password.pl index 760860b58f..62adb79aa5 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -19,7 +19,7 @@ my $input = new CGI; my $theme = $input->param('theme') || "default"; # only used if allowthemeoverride is set -my ($template, $loggedinuser, $cookie) +my ($template, $loggedinuser, $cookie, $staffflags) = get_template_and_user({template_name => "members/member-password.tmpl", query => $input, type => "intranet", @@ -36,12 +36,11 @@ $flagsrequired->{borrowers}=1; my $member=$input->param('member'); my $cardnumber = $input->param('cardnumber'); my $destination = $input->param('destination'); - my $errormsg; -my ($bor,$flags)=GetMemberDetails( $member,''); -if(( $member ne $loggedinuser ) && ($bor->{'category_type'} eq 'S' || $bor->{'authflags'}->{'catalogue'}) ) { - my $luser = GetMemberDetails($loggedinuser); - $errormsg = 'NOPERMISSION' unless($luser->{'authflags'}->{'staffaccess'} ); +my ($bor)=GetMember($member); +if(( $member ne $loggedinuser ) && ($bor->{'category_type'} eq 'S' ) ) { + $errormsg = 'NOPERMISSION' unless($staffflags->{'superlibrarian'} || $staffflags->{'staffaccess'} ); + # need superlibrarian for koha.xml fakeuser. } my $newpassword = $input->param('newpassword'); my $minpw = C4::Context->preference('minPasswordLength'); -- 2.39.5