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

(-)a/C4/Auth.pm (-135 / +184 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
                    my @users_info = GetBorrowersWithEmail($value);
771
                    if (@users_info) {
772
773
                        # First the userid, then the borrowernum
774
                        $value = $users_info[0][1] || $users_info[0][0];
775
                    } else {
776
                        undef $value;
777
                    }
778
                }
779
780
                # 0 for no user, 1 for normal, 2 for demo user.
781
                $return = $value ? 1 : 0;
782
                $userid = $value;
783
            }
784
            else {
785
                my $retuserid;
786
                ( $return, $cardnumber, $retuserid ) =
787
                  checkpw( $dbh, $userid, $password, $query );
788
                $userid = $retuserid if ( $retuserid ne '' );
789
            }
740
		if ($return) {
790
		if ($return) {
741
               #_session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
791
               #_session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
742
            	if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
792
            	if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
Lines 746-872 sub checkauth { Link Here
746
                	$info{'nopermission'} = 1;
796
                	$info{'nopermission'} = 1;
747
                	C4::Context->_unset_userenv($sessionID);
797
                	C4::Context->_unset_userenv($sessionID);
748
            	}
798
            	}
749
799
                my ($borrowernumber, $firstname, $surname, $userflags,
750
				my ($borrowernumber, $firstname, $surname, $userflags,
800
                    $branchcode, $branchname, $branchprinter, $emailaddress);
751
					$branchcode, $branchname, $branchprinter, $emailaddress);
801
752
802
                if ( $return == 1 ) {
753
            	if ( $return == 1 ) {
803
                    my $select = "
754
                	my $select = "
804
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
755
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
805
                    branches.branchname    as branchname, 
756
                    	    branches.branchname    as branchname, 
806
                    branches.branchprinter as branchprinter, 
757
                        	branches.branchprinter as branchprinter, 
807
                    email 
758
                        	email 
808
                    FROM borrowers 
759
                	FROM borrowers 
809
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
760
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
810
                    ";
761
                	";
811
                    my $sth = $dbh->prepare("$select where userid=?");
762
                	my $sth = $dbh->prepare("$select where userid=?");
812
                    $sth->execute($userid);
763
                	$sth->execute($userid);
813
                    unless ($sth->rows) {
764
			unless ($sth->rows) {
814
                        $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";
815
                        $sth = $dbh->prepare("$select where cardnumber=?");
766
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
816
                        $sth->execute($cardnumber);
767
		       	    $sth->execute($cardnumber);
817
768
818
                        unless ($sth->rows) {
769
		    	    unless ($sth->rows) {
819
                            $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";
820
                            $sth->execute($userid);
771
				$sth->execute($userid);
821
                            unless ($sth->rows) {
772
				unless ($sth->rows) {
822
                                $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";
823
                            }
774
				}
824
                        }
775
			    }
825
                    }
776
			}
826
                    if ($sth->rows) {
777
                	if ($sth->rows) {
827
                        ($borrowernumber, $firstname, $surname, $userflags,
778
			    ($borrowernumber, $firstname, $surname, $userflags,
828
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
779
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
829
                        $debug and print STDERR "AUTH_3 results: " .
780
						$debug and print STDERR "AUTH_3 results: " .
830
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
781
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
831
                    } else {
782
					} else {
832
                        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";
833
                    }
784
					}
785
834
786
# launch a sequence to check if we have a ip for the branch, i
835
# 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.
836
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
788
837
789
					my $ip       = $ENV{'REMOTE_ADDR'};
838
                    my $ip       = $ENV{'REMOTE_ADDR'};
790
					# if they specify at login, use that
839
                    # if they specify at login, use that
791
					if ($query->param('branch')) {
840
                    if ($query->param('branch')) {
792
						$branchcode  = $query->param('branch');
841
                        $branchcode  = $query->param('branch');
793
						$branchname = GetBranchName($branchcode);
842
                        $branchname = GetBranchName($branchcode);
794
					}
843
                    }
795
					my $branches = GetBranches();
844
                    my $branches = GetBranches();
796
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
845
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
797
						# we have to check they are coming from the right ip range
846
                        # we have to check they are coming from the right ip range
798
						my $domain = $branches->{$branchcode}->{'branchip'};
847
                        my $domain = $branches->{$branchcode}->{'branchip'};
799
						if ($ip !~ /^$domain/){
848
                        if ($ip !~ /^$domain/){
800
							$loggedin=0;
849
                            $loggedin=0;
801
							$info{'wrongip'} = 1;
850
                            $info{'wrongip'} = 1;
802
						}
851
                        }
803
					}
852
                    }
804
853
805
					my @branchesloop;
854
                    my @branchesloop;
806
					foreach my $br ( keys %$branches ) {
855
                    foreach my $br ( keys %$branches ) {
807
						#     now we work with the treatment of ip
856
                        #     now we work with the treatment of ip
808
						my $domain = $branches->{$br}->{'branchip'};
857
                        my $domain = $branches->{$br}->{'branchip'};
809
						if ( $domain && $ip =~ /^$domain/ ) {
858
                        if ( $domain && $ip =~ /^$domain/ ) {
810
							$branchcode = $branches->{$br}->{'branchcode'};
859
                            $branchcode = $branches->{$br}->{'branchcode'};
811
860
812
							# new op dev : add the branchprinter and branchname in the cookie
861
                            # new op dev : add the branchprinter and branchname in the cookie
813
							$branchprinter = $branches->{$br}->{'branchprinter'};
862
                            $branchprinter = $branches->{$br}->{'branchprinter'};
814
							$branchname    = $branches->{$br}->{'branchname'};
863
                            $branchname    = $branches->{$br}->{'branchname'};
815
						}
864
                        }
816
					}
865
                    }
817
					$session->param('number',$borrowernumber);
866
                    $session->param('number',$borrowernumber);
818
					$session->param('id',$userid);
867
                    $session->param('id',$userid);
819
					$session->param('cardnumber',$cardnumber);
868
                    $session->param('cardnumber',$cardnumber);
820
					$session->param('firstname',$firstname);
869
                    $session->param('firstname',$firstname);
821
					$session->param('surname',$surname);
870
                    $session->param('surname',$surname);
822
					$session->param('branch',$branchcode);
871
                    $session->param('branch',$branchcode);
823
					$session->param('branchname',$branchname);
872
                    $session->param('branchname',$branchname);
824
					$session->param('flags',$userflags);
873
                    $session->param('flags',$userflags);
825
					$session->param('emailaddress',$emailaddress);
874
                    $session->param('emailaddress',$emailaddress);
826
					$session->param('ip',$session->remote_addr());
875
                    $session->param('ip',$session->remote_addr());
827
					$session->param('lasttime',time());
876
                    $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) ;
877
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
829
				}
878
                }
830
				elsif ( $return == 2 ) {
879
                elsif ( $return == 2 ) {
831
					#We suppose the user is the superlibrarian
880
                    #We suppose the user is the superlibrarian
832
					$borrowernumber = 0;
881
                    $borrowernumber = 0;
833
					$session->param('number',0);
882
                    $session->param('number',0);
834
					$session->param('id',C4::Context->config('user'));
883
                    $session->param('id',C4::Context->config('user'));
835
					$session->param('cardnumber',C4::Context->config('user'));
884
                    $session->param('cardnumber',C4::Context->config('user'));
836
					$session->param('firstname',C4::Context->config('user'));
885
                    $session->param('firstname',C4::Context->config('user'));
837
					$session->param('surname',C4::Context->config('user'));
886
                    $session->param('surname',C4::Context->config('user'));
838
					$session->param('branch','NO_LIBRARY_SET');
887
                    $session->param('branch','NO_LIBRARY_SET');
839
					$session->param('branchname','NO_LIBRARY_SET');
888
                    $session->param('branchname','NO_LIBRARY_SET');
840
					$session->param('flags',1);
889
                    $session->param('flags',1);
841
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
890
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
842
					$session->param('ip',$session->remote_addr());
891
                    $session->param('ip',$session->remote_addr());
843
					$session->param('lasttime',time());
892
                    $session->param('lasttime',time());
844
				}
893
                }
845
				C4::Context::set_userenv(
894
                C4::Context::set_userenv(
846
					$session->param('number'),       $session->param('id'),
895
                    $session->param('number'),       $session->param('id'),
847
					$session->param('cardnumber'),   $session->param('firstname'),
896
                    $session->param('cardnumber'),   $session->param('firstname'),
848
					$session->param('surname'),      $session->param('branch'),
897
                    $session->param('surname'),      $session->param('branch'),
849
					$session->param('branchname'),   $session->param('flags'),
898
                    $session->param('branchname'),   $session->param('flags'),
850
					$session->param('emailaddress'), $session->param('branchprinter')
899
                    $session->param('emailaddress'), $session->param('branchprinter')
851
				);
900
                );
852
901
853
				# Grab borrower's shelves and public shelves and add them to the session
902
                # 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
903
                # $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
904
                # 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
905
                my $row_count = 10; # FIXME:This probably should be a syspref
857
				my ($total, $totshelves, $barshelves, $pubshelves);
906
                my ($total, $totshelves, $barshelves, $pubshelves);
858
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
907
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
859
				$total->{'bartotal'} = $totshelves;
908
                $total->{'bartotal'} = $totshelves;
860
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
909
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
861
				$total->{'pubtotal'} = $totshelves;
910
                $total->{'pubtotal'} = $totshelves;
862
				$session->param('barshelves', $barshelves);
911
                $session->param('barshelves', $barshelves);
863
				$session->param('pubshelves', $pubshelves);
912
                $session->param('pubshelves', $pubshelves);
864
				$session->param('totshelves', $total);
913
                $session->param('totshelves', $total);
865
914
866
				C4::Context::set_shelves_userenv('bar',$barshelves);
915
                C4::Context::set_shelves_userenv('bar',$barshelves);
867
				C4::Context::set_shelves_userenv('pub',$pubshelves);
916
                C4::Context::set_shelves_userenv('pub',$pubshelves);
868
				C4::Context::set_shelves_userenv('tot',$total);
917
                C4::Context::set_shelves_userenv('tot',$total);
869
			}
918
            }
870
        	else {
919
        	else {
871
            	if ($userid) {
920
            	if ($userid) {
872
                	$info{'invalid_username_or_password'} = 1;
921
                	$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 = "XXX";
4927
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4928
    $dbh->do(qq{
4929
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowPKIAuth',0,'This allows the user to authenticate via client side certificates',NULL,'YesNo');
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