Lines 24-30
my $input = new CGI;
Link Here
|
24 |
|
24 |
|
25 |
my $flagsrequired = { permissions => 1 }; |
25 |
my $flagsrequired = { permissions => 1 }; |
26 |
my $member=$input->param('member'); |
26 |
my $member=$input->param('member'); |
27 |
my $bor = GetMemberDetails( $member,''); |
27 |
my $bor = GetMember( borrowernumber => $member ); |
28 |
if( $bor->{'category_type'} eq 'S' ) { |
28 |
if( $bor->{'category_type'} eq 'S' ) { |
29 |
$flagsrequired->{'staffaccess'} = 1; |
29 |
$flagsrequired->{'staffaccess'} = 1; |
30 |
} |
30 |
} |
Lines 85-99
if ($input->param('newflags')) {
Link Here
|
85 |
|
85 |
|
86 |
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member"); |
86 |
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member"); |
87 |
} else { |
87 |
} else { |
88 |
# my ($bor,$flags,$accessflags)=GetMemberDetails($member,''); |
88 |
|
89 |
my $flags = $bor->{'flags'}; |
89 |
my $flags = $bor->{'flags'}; |
90 |
my $accessflags = $bor->{'authflags'}; |
90 |
my $accessflags; |
91 |
my $dbh=C4::Context->dbh(); |
91 |
my $dbh = C4::Context->dbh(); |
|
|
92 |
# FIXME This needs to be improved to avoid doing the same query |
93 |
my $sth = $dbh->prepare("select bit,flag from userflags"); |
94 |
$sth->execute; |
95 |
while ( my ( $bit, $flag ) = $sth->fetchrow ) { |
96 |
if ( $bor->{flags} && $bor->{flags} & 2**$bit ) { |
97 |
$accessflags->{$flag} = 1; |
98 |
} |
99 |
} |
100 |
|
92 |
my $all_perms = get_all_subpermissions(); |
101 |
my $all_perms = get_all_subpermissions(); |
93 |
my $user_perms = get_user_subpermissions($bor->{'userid'}); |
102 |
my $user_perms = get_user_subpermissions($bor->{'userid'}); |
94 |
my $sth=$dbh->prepare("SELECT bit, flag FROM userflags ORDER BY bit"); |
103 |
$sth = $dbh->prepare("SELECT bit, flag FROM userflags ORDER BY bit"); |
95 |
$sth->execute; |
104 |
$sth->execute; |
96 |
my @loop; |
105 |
my @loop; |
|
|
106 |
|
97 |
while (my ($bit, $flag) = $sth->fetchrow) { |
107 |
while (my ($bit, $flag) = $sth->fetchrow) { |
98 |
my $checked=''; |
108 |
my $checked=''; |
99 |
if ($accessflags->{$flag}) { |
109 |
if ($accessflags->{$flag}) { |
100 |
- |
|
|