View | Details | Raw Unified | Return to bug 6296
Collapse All | Expand All

(-)a/C4/Auth.pm (-135 / +185 lines)
Lines 146-151 sub get_template_and_user { Link Here
146
    my $borrowernumber;
146
    my $borrowernumber;
147
    my $insecure = C4::Context->preference('insecure');
147
    my $insecure = C4::Context->preference('insecure');
148
    if ($user or $insecure) {
148
    if ($user or $insecure) {
149
        # It's possible for $user to be the borrowernumber if they don't have a
150
        # userid defined (and are logging in through some other method, such
151
        # as SSL certs against an email address)
152
        $borrowernumber = getborrowernumber($user) if defined($user);
153
        if (!defined($borrowernumber) && defined($user)) {
154
		my $borrower = GetMember(borrowernumber => $user);
155
		if ($borrower) {
156
		$borrowernumber = $user;
157
                # A bit of a hack, but I don't know there's a nicer way
158
                # to do it.
159
                $user = $borrower->{firstname} . ' ' . $borrower->{surname};
160
            }
161
        }
149
162
150
        # user info
163
        # user info
151
        $template->param( loggedinusername => $user );
164
        $template->param( loggedinusername => $user );
Lines 165-171 sub get_template_and_user { Link Here
165
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
178
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
166
        }
179
        }
167
180
168
        $borrowernumber = getborrowernumber($user) if defined($user);
169
        require C4::Members;
181
        require C4::Members;
170
        my ( $borr ) = C4::Members::GetMemberDetails( $borrowernumber );
182
        my ( $borr ) = C4::Members::GetMemberDetails( $borrowernumber );
171
        my @bordat;
183
        my @bordat;
Lines 719-742 sub checkauth { Link Here
719
    }
731
    }
720
    unless ($userid || $sessionID) {
732
    unless ($userid || $sessionID) {
721
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
733
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
722
		my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
734
        my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
723
        my $sessionID = $session->id;
735
        my $sessionID = $session->id;
724
       	C4::Context->_new_userenv($sessionID);
736
        C4::Context->_new_userenv($sessionID);
725
        $cookie = $query->cookie(CGISESSID => $sessionID);
737
        $cookie = $query->cookie( CGISESSID => $sessionID );
726
	    $userid    = $query->param('userid');
738
        $userid = $query->param('userid');
727
            if (($cas && $query->param('ticket')) || $userid) {
739
        if (   ( $cas && $query->param('ticket') )
728
        	my $password = $query->param('password');
740
            || $userid
729
		my ($return, $cardnumber);
741
            || ( my $pki_field = C4::Context->preference('AllowPKIAuth') ) ne
730
		if ($cas && $query->param('ticket')) {
742
            'None' )
731
		    my $retuserid;
743
        {
732
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
744
            my $password = $query->param('password');
733
		    $userid = $retuserid;
745
            my ( $return, $cardnumber );
734
		    $info{'invalidCasLogin'} = 1 unless ($return);
746
            if ( $cas && $query->param('ticket') ) {
735
        	} else {
747
                my $retuserid;
736
		    my $retuserid;
748
                ( $return, $cardnumber, $retuserid ) =
737
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
749
                  checkpw( $dbh, $userid, $password, $query );
738
		    $userid = $retuserid if ($retuserid ne '');
750
                $userid = $retuserid;
739
		}
751
                $info{'invalidCasLogin'} = 1 unless ($return);
752
            }
753
            elsif (
754
                ( $pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'} )
755
                || (   $pki_field eq 'emailAddress'
756
                    && $ENV{'SSL_CLIENT_S_DN_Email'} )
757
              )
758
            {
759
                my $value;
760
                if ( $pki_field eq 'Common Name' ) {
761
                    $value = $ENV{'SSL_CLIENT_S_DN_CN'};
762
                }
763
                elsif ( $pki_field eq 'emailAddress' ) {
764
                    $value = $ENV{'SSL_CLIENT_S_DN_Email'};
765
766
              # If we're looking up the email, there's a chance that the person
767
              # doesn't have a userid. So if there is none, we pass along the
768
              # borrower number, and the bits of code that need to know the user
769
              # ID will have to be smart enough to handle that.
770
                    require C4::Members;
771
                    my @users_info = C4::Members::GetBorrowersWithEmail($value);
772
                    if (@users_info) {
773
774
                        # First the userid, then the borrowernum
775
                        $value = $users_info[0][1] || $users_info[0][0];
776
                    } else {
777
                        undef $value;
778
                    }
779
                }
780
781
                # 0 for no user, 1 for normal, 2 for demo user.
782
                $return = $value ? 1 : 0;
783
                $userid = $value;
784
            }
785
            else {
786
                my $retuserid;
787
                ( $return, $cardnumber, $retuserid ) =
788
                  checkpw( $dbh, $userid, $password, $query );
789
                $userid = $retuserid if ( $retuserid ne '' );
790
            }
740
		if ($return) {
791
		if ($return) {
741
               #_session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
792
               #_session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
742
            	if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
793
            	if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
Lines 746-872 sub checkauth { Link Here
746
                	$info{'nopermission'} = 1;
797
                	$info{'nopermission'} = 1;
747
                	C4::Context->_unset_userenv($sessionID);
798
                	C4::Context->_unset_userenv($sessionID);
748
            	}
799
            	}
749
800
                my ($borrowernumber, $firstname, $surname, $userflags,
750
				my ($borrowernumber, $firstname, $surname, $userflags,
801
                    $branchcode, $branchname, $branchprinter, $emailaddress);
751
					$branchcode, $branchname, $branchprinter, $emailaddress);
802
752
803
                if ( $return == 1 ) {
753
            	if ( $return == 1 ) {
804
                    my $select = "
754
                	my $select = "
805
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode,
755
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
806
                    branches.branchname    as branchname,
756
                    	    branches.branchname    as branchname, 
807
                    branches.branchprinter as branchprinter,
757
                        	branches.branchprinter as branchprinter, 
808
                    email
758
                        	email 
809
                    FROM borrowers
759
                	FROM borrowers 
810
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
760
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
811
                    ";
761
                	";
812
                    my $sth = $dbh->prepare("$select where userid=?");
762
                	my $sth = $dbh->prepare("$select where userid=?");
813
                    $sth->execute($userid);
763
                	$sth->execute($userid);
814
                    unless ($sth->rows) {
764
			unless ($sth->rows) {
815
                        $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
765
		    	    $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
816
                        $sth = $dbh->prepare("$select where cardnumber=?");
766
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
817
                        $sth->execute($cardnumber);
767
		       	    $sth->execute($cardnumber);
818
768
819
                        unless ($sth->rows) {
769
		    	    unless ($sth->rows) {
820
                            $debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
770
				$debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
821
                            $sth->execute($userid);
771
				$sth->execute($userid);
822
                            unless ($sth->rows) {
772
				unless ($sth->rows) {
823
                                $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
773
				    $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
824
                            }
774
				}
825
                        }
775
			    }
826
                    }
776
			}
827
                    if ($sth->rows) {
777
                	if ($sth->rows) {
828
                        ($borrowernumber, $firstname, $surname, $userflags,
778
			    ($borrowernumber, $firstname, $surname, $userflags,
829
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
779
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
830
                        $debug and print STDERR "AUTH_3 results: " .
780
						$debug and print STDERR "AUTH_3 results: " .
831
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
781
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
832
                    } else {
782
					} else {
833
                        print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
783
						print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
834
                    }
784
					}
785
835
786
# launch a sequence to check if we have a ip for the branch, i
836
# launch a sequence to check if we have a ip for the branch, i
787
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
837
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
788
838
789
					my $ip       = $ENV{'REMOTE_ADDR'};
839
                    my $ip       = $ENV{'REMOTE_ADDR'};
790
					# if they specify at login, use that
840
                    # if they specify at login, use that
791
					if ($query->param('branch')) {
841
                    if ($query->param('branch')) {
792
						$branchcode  = $query->param('branch');
842
                        $branchcode  = $query->param('branch');
793
						$branchname = GetBranchName($branchcode);
843
                        $branchname = GetBranchName($branchcode);
794
					}
844
                    }
795
					my $branches = GetBranches();
845
                    my $branches = GetBranches();
796
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
846
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
797
						# we have to check they are coming from the right ip range
847
                        # we have to check they are coming from the right ip range
798
						my $domain = $branches->{$branchcode}->{'branchip'};
848
                        my $domain = $branches->{$branchcode}->{'branchip'};
799
						if ($ip !~ /^$domain/){
849
                        if ($ip !~ /^$domain/){
800
							$loggedin=0;
850
                            $loggedin=0;
801
							$info{'wrongip'} = 1;
851
                            $info{'wrongip'} = 1;
802
						}
852
                        }
803
					}
853
                    }
804
854
805
					my @branchesloop;
855
                    my @branchesloop;
806
					foreach my $br ( keys %$branches ) {
856
                    foreach my $br ( keys %$branches ) {
807
						#     now we work with the treatment of ip
857
                        #     now we work with the treatment of ip
808
						my $domain = $branches->{$br}->{'branchip'};
858
                        my $domain = $branches->{$br}->{'branchip'};
809
						if ( $domain && $ip =~ /^$domain/ ) {
859
                        if ( $domain && $ip =~ /^$domain/ ) {
810
							$branchcode = $branches->{$br}->{'branchcode'};
860
                            $branchcode = $branches->{$br}->{'branchcode'};
811
861
812
							# new op dev : add the branchprinter and branchname in the cookie
862
                            # new op dev : add the branchprinter and branchname in the cookie
813
							$branchprinter = $branches->{$br}->{'branchprinter'};
863
                            $branchprinter = $branches->{$br}->{'branchprinter'};
814
							$branchname    = $branches->{$br}->{'branchname'};
864
                            $branchname    = $branches->{$br}->{'branchname'};
815
						}
865
                        }
816
					}
866
                    }
817
					$session->param('number',$borrowernumber);
867
                    $session->param('number',$borrowernumber);
818
					$session->param('id',$userid);
868
                    $session->param('id',$userid);
819
					$session->param('cardnumber',$cardnumber);
869
                    $session->param('cardnumber',$cardnumber);
820
					$session->param('firstname',$firstname);
870
                    $session->param('firstname',$firstname);
821
					$session->param('surname',$surname);
871
                    $session->param('surname',$surname);
822
					$session->param('branch',$branchcode);
872
                    $session->param('branch',$branchcode);
823
					$session->param('branchname',$branchname);
873
                    $session->param('branchname',$branchname);
824
					$session->param('flags',$userflags);
874
                    $session->param('flags',$userflags);
825
					$session->param('emailaddress',$emailaddress);
875
                    $session->param('emailaddress',$emailaddress);
826
					$session->param('ip',$session->remote_addr());
876
                    $session->param('ip',$session->remote_addr());
827
					$session->param('lasttime',time());
877
                    $session->param('lasttime',time());
828
					$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
878
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
829
				}
879
                }
830
				elsif ( $return == 2 ) {
880
                elsif ( $return == 2 ) {
831
					#We suppose the user is the superlibrarian
881
                    #We suppose the user is the superlibrarian
832
					$borrowernumber = 0;
882
                    $borrowernumber = 0;
833
					$session->param('number',0);
883
                    $session->param('number',0);
834
					$session->param('id',C4::Context->config('user'));
884
                    $session->param('id',C4::Context->config('user'));
835
					$session->param('cardnumber',C4::Context->config('user'));
885
                    $session->param('cardnumber',C4::Context->config('user'));
836
					$session->param('firstname',C4::Context->config('user'));
886
                    $session->param('firstname',C4::Context->config('user'));
837
					$session->param('surname',C4::Context->config('user'));
887
                    $session->param('surname',C4::Context->config('user'));
838
					$session->param('branch','NO_LIBRARY_SET');
888
                    $session->param('branch','NO_LIBRARY_SET');
839
					$session->param('branchname','NO_LIBRARY_SET');
889
                    $session->param('branchname','NO_LIBRARY_SET');
840
					$session->param('flags',1);
890
                    $session->param('flags',1);
841
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
891
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
842
					$session->param('ip',$session->remote_addr());
892
                    $session->param('ip',$session->remote_addr());
843
					$session->param('lasttime',time());
893
                    $session->param('lasttime',time());
844
				}
894
                }
845
				C4::Context::set_userenv(
895
                C4::Context::set_userenv(
846
					$session->param('number'),       $session->param('id'),
896
                    $session->param('number'),       $session->param('id'),
847
					$session->param('cardnumber'),   $session->param('firstname'),
897
                    $session->param('cardnumber'),   $session->param('firstname'),
848
					$session->param('surname'),      $session->param('branch'),
898
                    $session->param('surname'),      $session->param('branch'),
849
					$session->param('branchname'),   $session->param('flags'),
899
                    $session->param('branchname'),   $session->param('flags'),
850
					$session->param('emailaddress'), $session->param('branchprinter')
900
                    $session->param('emailaddress'), $session->param('branchprinter')
851
				);
901
                );
852
902
853
				# Grab borrower's shelves and public shelves and add them to the session
903
                # Grab borrower's shelves and public shelves and add them to the session
854
				# $row_count determines how many records are returned from the db query
904
                # $row_count determines how many records are returned from the db query
855
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
905
                # and the number of lists to be displayed of each type in the 'Lists' button drop down
856
				my $row_count = 10; # FIXME:This probably should be a syspref
906
                my $row_count = 10; # FIXME:This probably should be a syspref
857
				my ($total, $totshelves, $barshelves, $pubshelves);
907
                my ($total, $totshelves, $barshelves, $pubshelves);
858
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
908
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
859
				$total->{'bartotal'} = $totshelves;
909
                $total->{'bartotal'} = $totshelves;
860
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
910
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
861
				$total->{'pubtotal'} = $totshelves;
911
                $total->{'pubtotal'} = $totshelves;
862
				$session->param('barshelves', $barshelves);
912
                $session->param('barshelves', $barshelves);
863
				$session->param('pubshelves', $pubshelves);
913
                $session->param('pubshelves', $pubshelves);
864
				$session->param('totshelves', $total);
914
                $session->param('totshelves', $total);
865
915
866
				C4::Context::set_shelves_userenv('bar',$barshelves);
916
                C4::Context::set_shelves_userenv('bar',$barshelves);
867
				C4::Context::set_shelves_userenv('pub',$pubshelves);
917
                C4::Context::set_shelves_userenv('pub',$pubshelves);
868
				C4::Context::set_shelves_userenv('tot',$total);
918
                C4::Context::set_shelves_userenv('tot',$total);
869
			}
919
            }
870
        	else {
920
        	else {
871
            	if ($userid) {
921
            	if ($userid) {
872
                	$info{'invalid_username_or_password'} = 1;
922
                	$info{'invalid_username_or_password'} = 1;
(-)a/C4/Members.pm (+31 lines)
Lines 95-100 BEGIN { Link Here
95
		&GetMessagesCount
95
		&GetMessagesCount
96
96
97
        &IssueSlip
97
        &IssueSlip
98
		GetBorrowersWithEmail
98
	);
99
	);
99
100
100
	#Modify data
101
	#Modify data
Lines 2308-2313 sub IssueSlip { Link Here
2308
    );
2309
    );
2309
}
2310
}
2310
2311
2312
=head2 GetBorrowersWithEmail
2313
2314
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2315
2316
This gets a list of users and their basic details from their email address.
2317
As it's possible for multiple user to have the same email address, it provides
2318
you with all of them. If there is no userid for the user, there will be an
2319
C<undef> there. An empty list will be returned if there are no matches.
2320
2321
=cut
2322
2323
sub GetBorrowersWithEmail {
2324
    my $email = shift;
2325
2326
    my $dbh = C4::Context->dbh;
2327
2328
    my $query = "SELECT borrowernumber, userid FROM borrowers WHERE email=?";
2329
    my $sth=$dbh->prepare($query);
2330
    $sth->execute($email);
2331
    my @result = ();
2332
    while (my $ref = $sth->fetch) {
2333
        push @result, $ref;
2334
    }
2335
    die "Failure searching for borrowers by email address: $sth->errstr" if $sth->err;
2336
    return @result;
2337
}
2338
2339
2340
END { }    # module clean-up code here (global destructor)
2341
2311
1;
2342
1;
2312
2343
2313
__END__
2344
__END__
(-)a/acqui/finishreceive.pl (-1 / +3 lines)
Lines 34-40 use List::MoreUtils qw/any/; Link Here
34
34
35
my $input=new CGI;
35
my $input=new CGI;
36
my $flagsrequired = {acquisition => 'order_receive'};
36
my $flagsrequired = {acquisition => 'order_receive'};
37
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired, 'intranet');
37
38
checkauth($input, 0, $flagsrequired, 'intranet');
39
38
my $user=$input->remote_user;
40
my $user=$input->remote_user;
39
my $biblionumber = $input->param('biblionumber');
41
my $biblionumber = $input->param('biblionumber');
40
my $biblioitemnumber=$input->param('biblioitemnumber');
42
my $biblioitemnumber=$input->param('biblioitemnumber');
(-)a/catalogue/updateitem.pl (-2 / +2 lines)
Lines 30-36 use C4::Reserves; Link Here
30
30
31
my $cgi= new CGI;
31
my $cgi= new CGI;
32
32
33
my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
33
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
34
34
35
my $biblionumber=$cgi->param('biblionumber');
35
my $biblionumber=$cgi->param('biblionumber');
36
my $itemnumber=$cgi->param('itemnumber');
36
my $itemnumber=$cgi->param('itemnumber');
Lines 56-62 for ($damaged,$itemlost,$wthdrawn) { Link Here
56
# modify MARC item if input differs from items table.
56
# modify MARC item if input differs from items table.
57
my $item_changes = {};
57
my $item_changes = {};
58
if (defined $itemnotes) { # i.e., itemnotes parameter passed from form
58
if (defined $itemnotes) { # i.e., itemnotes parameter passed from form
59
    my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
59
    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
60
    if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
60
    if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
61
        $item_changes->{'itemnotes'} = $itemnotes;
61
        $item_changes->{'itemnotes'} = $itemnotes;
62
    }
62
    }
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 351-353 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
351
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CalendarFirstDayOfWeek','Sunday','Select the first day of week to use in the calendar.','Sunday|Monday','Choice');
351
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CalendarFirstDayOfWeek','Sunday','Select the first day of week to use in the calendar.','Sunday|Monday','Choice');
352
INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.',  'free')
352
INSERT INTO systempreferences` (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelayCharge', '0', NULL , 'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.',  'free')
353
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RoutingListNote','To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutlingListNote</a> system preference.','Define a note to be shown on all routing lists','70|10','Textarea');
353
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RoutingListNote','To change this note edit <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutlingListNote</a> system preference.','Define a note to be shown on all routing lists','70|10','Textarea');
354
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPKIAuth','None','Use the field from a client-side SSL certificate to look a user in the Koha database','None|Common Name|emailAddress','Choice');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4923-4928 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4923
    SetVersion($DBversion);
4923
    SetVersion($DBversion);
4924
}
4924
}
4925
4925
4926
$DBversion = "3.07.00.XXX";
4927
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4928
    $dbh->do(qq{
4929
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowPKIAuth','None','Use the field from a client-side SSL certificate to look a user in the Koha database','None|Common Name|emailAddress','Choice');
4930
    });
4931
    print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n";
4932
    SetVersion($DBversion);
4933
}
4926
4934
4927
=head1 FUNCTIONS
4935
=head1 FUNCTIONS
4928
4936
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-1 / +10 lines)
Lines 94-97 Administration: Link Here
94
            - of CAS when logging out of Koha.
94
            - of CAS when logging out of Koha.
95
        -
95
        -
96
            - The CAS Authentication Server can be found at
96
            - The CAS Authentication Server can be found at
97
            - pref: casServerUrl           
97
            - pref: casServerUrl
98
        -
99
            - Use
100
            - pref: AllowPkiAuth
101
              default: None
102
              choices:
103
                  None: "no"
104
                  Common Name: the Common Name
105
                  emailAddress: the emailAddress
106
            - field for SSL client certificate authentication
(-)a/members/setstatus.pl (-1 / +1 lines)
Lines 36-42 my $input = new CGI; Link Here
36
36
37
my $flagsrequired;
37
my $flagsrequired;
38
$flagsrequired->{borrowers}=1;
38
$flagsrequired->{borrowers}=1;
39
my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
39
checkauth($input, 0, $flagsrequired);
40
40
41
my $destination = $input->param("destination") || '';
41
my $destination = $input->param("destination") || '';
42
my $cardnumber = $input->param("cardnumber");
42
my $cardnumber = $input->param("cardnumber");
(-)a/reserve/placerequest.pl (-1 / +1 lines)
Lines 35-41 use C4::Auth qw/checkauth/; Link Here
35
35
36
my $input = CGI->new();
36
my $input = CGI->new();
37
37
38
my ($user, $cookie, $sesion_id, $flags) = checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
38
checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet');
39
39
40
my @bibitems=$input->param('biblioitem');
40
my @bibitems=$input->param('biblioitem');
41
# FIXME I think reqbib does not exist anymore, it's used in line 82, to AddReserve of contraint type 'o'
41
# FIXME I think reqbib does not exist anymore, it's used in line 82, to AddReserve of contraint type 'o'
(-)a/serials/reorder_members.pl (-2 / +1 lines)
Lines 29-36 my $subscriptionid = $query->param('subscriptionid'); Link Here
29
my $routingid      = $query->param('routingid');
29
my $routingid      = $query->param('routingid');
30
my $rank           = $query->param('rank');
30
my $rank           = $query->param('rank');
31
31
32
my ( $user, $cookie, $sesion_id, $flags ) =
32
checkauth( $query, 0, { serials => 1 }, 'intranet' );
33
  checkauth( $query, 0, { serials => 1 }, 'intranet' );
34
33
35
reorder_members( $subscriptionid, $routingid, $rank );
34
reorder_members( $subscriptionid, $routingid, $rank );
36
35
(-)a/serials/subscription-detail.pl (-3 / +1 lines)
Lines 95-102 if ($op eq 'del') { Link Here
95
}
95
}
96
my $hasRouting = check_routing($subscriptionid);
96
my $hasRouting = check_routing($subscriptionid);
97
97
98
my ($user, $sessionID, $flags);
98
(undef, $cookie, undef, undef)
99
($user, $cookie, $sessionID, $flags)
100
    = checkauth($query, 0, {catalogue => 1}, "intranet");
99
    = checkauth($query, 0, {catalogue => 1}, "intranet");
101
100
102
# COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ?
101
# COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ?
103
- 

Return to bug 6296