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

(-)a/C4/Auth.pm (-120 / +163 lines)
Lines 145-151 sub get_template_and_user { Link Here
145
145
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
150
        # It's possible for $user to be the borrowernumber if they don't have a
151
        # userid defined (and are logging in through some other method, such as
152
        # SSL certs against an email address)
153
        $borrowernumber = getborrowernumber($user) if defined($user);
154
        if ( !defined($borrowernumber) && defined($user) ) {
155
            my $borrower = GetMember( borrowernumber => $user );
156
            if ($borrower) {
157
                $borrowernumber = $user;
158
159
                # A bit of a hack, but I don't know there's a nicer way to do
160
                # it.
161
                $user = $borrower->{firstname} . ' ' . $borrower->{surname};
162
            }
163
        }
149
164
150
        # user info
165
        # user info
151
        $template->param( loggedinusername => $user );
166
        $template->param( loggedinusername => $user );
Lines 717-725 sub checkauth { Link Here
717
    }
732
    }
718
    unless ($userid || $sessionID) {
733
    unless ($userid || $sessionID) {
719
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
734
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
720
		my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
735
        my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
721
        my $sessionID = $session->id;
736
        my $sessionID = $session->id;
722
       	C4::Context->_new_userenv($sessionID);
737
        C4::Context->_new_userenv($sessionID);
723
        $cookie = $query->cookie(CGISESSID => $sessionID);
738
        $cookie = $query->cookie(CGISESSID => $sessionID);
724
	    $userid    = $query->param('userid');
739
	    $userid    = $query->param('userid');
725
            if (($cas && $query->param('ticket')) || $userid) {
740
            if (($cas && $query->param('ticket')) || $userid) {
Lines 730-736 sub checkauth { Link Here
730
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
745
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
731
		    $userid = $retuserid;
746
		    $userid = $retuserid;
732
		    $info{'invalidCasLogin'} = 1 unless ($return);
747
		    $info{'invalidCasLogin'} = 1 unless ($return);
733
        	} else {
748
        } elsif (($pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'}) ||
749
            ($pki_field eq 'emailAddress' && $ENV{'SSL_CLIENT_S_DN_Email'})) {
750
            my $value;
751
            if ($pki_field eq 'Common Name') {
752
                $value = $ENV{'SSL_CLIENT_S_DN_CN'};
753
            } elsif ($pki_field eq 'emailAddress') {
754
                $value = $ENV{'SSL_CLIENT_S_DN_Email'};
755
                # If we're looking up the email, there's a chance that the person
756
                # doesn't have a userid. So if there is none, we pass along the
757
                # borrower number, and the bits of code that need to know the user
758
                # ID will have to be smart enough to handle that.
759
                my @users_info = GetBorrowersWithEmail($value);
760
                if (@users_info) {
761
                    # First the userid, then the borrowernum
762
                    $value = $users_info[0][1] || $users_info[0][0];
763
                } else {
764
                    undef $value;
765
                }
766
            }
767
            # 0 for no user, 1 for normal, 2 for demo user.
768
            $return = $value ? 1 : 0;
769
            $userid = $value;
770
        } else {
734
		    my $retuserid;
771
		    my $retuserid;
735
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
772
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
736
		    $userid = $retuserid if ($retuserid ne '');
773
		    $userid = $retuserid if ($retuserid ne '');
Lines 745-870 sub checkauth { Link Here
745
                	C4::Context->_unset_userenv($sessionID);
782
                	C4::Context->_unset_userenv($sessionID);
746
            	}
783
            	}
747
784
748
				my ($borrowernumber, $firstname, $surname, $userflags,
785
                my ($borrowernumber, $firstname, $surname, $userflags,
749
					$branchcode, $branchname, $branchprinter, $emailaddress);
786
                    $branchcode, $branchname, $branchprinter, $emailaddress);
750
787
751
            	if ( $return == 1 ) {
788
                if ( $return == 1 ) {
752
                	my $select = "
789
                    my $select = "
753
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
790
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode,
754
                    	    branches.branchname    as branchname, 
791
                    branches.branchname    as branchname,
755
                        	branches.branchprinter as branchprinter, 
792
                    branches.branchprinter as branchprinter,
756
                        	email 
793
                    email
757
                	FROM borrowers 
794
                    FROM borrowers
758
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
795
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
759
                	";
796
                    ";
760
                	my $sth = $dbh->prepare("$select where userid=?");
797
                    my $sth = $dbh->prepare("$select where userid=?");
761
                	$sth->execute($userid);
798
                    $sth->execute($userid);
762
			unless ($sth->rows) {
799
                    unless ( $sth->rows ) {
763
		    	    $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
800
                        $debug
764
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
801
                          and print STDERR
765
		       	    $sth->execute($cardnumber);
802
                          "AUTH_1: no rows for userid='$userid'\n";
766
803
                        $sth = $dbh->prepare("$select where cardnumber=?");
767
		    	    unless ($sth->rows) {
804
                        $sth->execute($cardnumber);
768
				$debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
805
769
				$sth->execute($userid);
806
                        unless ( $sth->rows ) {
770
				unless ($sth->rows) {
807
                            $debug
771
				    $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
808
                              and print STDERR
772
				}
809
                              "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
773
			    }
810
                            $sth->execute($userid);
774
			}
811
                            unless ( $sth->rows ) {
775
                	if ($sth->rows) {
812
                                $debug
776
			    ($borrowernumber, $firstname, $surname, $userflags,
813
                                  and print STDERR
777
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
814
"AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
778
						$debug and print STDERR "AUTH_3 results: " .
815
                            }
779
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
816
                        }
780
					} else {
817
                    }
781
						print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
818
                    if ($sth->rows) {
782
					}
819
                        ($borrowernumber, $firstname, $surname, $userflags,
820
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
821
                        $debug and print STDERR "AUTH_3 results: " .
822
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
823
                    } else {
824
                        print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
825
                    }
783
826
784
# launch a sequence to check if we have a ip for the branch, i
827
# launch a sequence to check if we have a ip for the branch, i
785
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
828
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
786
829
787
					my $ip       = $ENV{'REMOTE_ADDR'};
830
                    my $ip       = $ENV{'REMOTE_ADDR'};
788
					# if they specify at login, use that
831
                    # if they specify at login, use that
789
					if ($query->param('branch')) {
832
                    if ($query->param('branch')) {
790
						$branchcode  = $query->param('branch');
833
                        $branchcode  = $query->param('branch');
791
						$branchname = GetBranchName($branchcode);
834
                        $branchname = GetBranchName($branchcode);
792
					}
835
                    }
793
					my $branches = GetBranches();
836
                    my $branches = GetBranches();
794
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
837
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
795
						# we have to check they are coming from the right ip range
838
                        # we have to check they are coming from the right ip range
796
						my $domain = $branches->{$branchcode}->{'branchip'};
839
                        my $domain = $branches->{$branchcode}->{'branchip'};
797
						if ($ip !~ /^$domain/){
840
                        if ($ip !~ /^$domain/){
798
							$loggedin=0;
841
                            $loggedin=0;
799
							$info{'wrongip'} = 1;
842
                            $info{'wrongip'} = 1;
800
						}
843
                        }
801
					}
844
                    }
802
845
803
					my @branchesloop;
846
                    my @branchesloop;
804
					foreach my $br ( keys %$branches ) {
847
                    foreach my $br ( keys %$branches ) {
805
						#     now we work with the treatment of ip
848
                        #     now we work with the treatment of ip
806
						my $domain = $branches->{$br}->{'branchip'};
849
                        my $domain = $branches->{$br}->{'branchip'};
807
						if ( $domain && $ip =~ /^$domain/ ) {
850
                        if ( $domain && $ip =~ /^$domain/ ) {
808
							$branchcode = $branches->{$br}->{'branchcode'};
851
                            $branchcode = $branches->{$br}->{'branchcode'};
809
852
810
							# new op dev : add the branchprinter and branchname in the cookie
853
                            # new op dev : add the branchprinter and branchname in the cookie
811
							$branchprinter = $branches->{$br}->{'branchprinter'};
854
                            $branchprinter = $branches->{$br}->{'branchprinter'};
812
							$branchname    = $branches->{$br}->{'branchname'};
855
                            $branchname    = $branches->{$br}->{'branchname'};
813
						}
856
                        }
814
					}
857
                    }
815
					$session->param('number',$borrowernumber);
858
                    $session->param('number',$borrowernumber);
816
					$session->param('id',$userid);
859
                    $session->param('id',$userid);
817
					$session->param('cardnumber',$cardnumber);
860
                    $session->param('cardnumber',$cardnumber);
818
					$session->param('firstname',$firstname);
861
                    $session->param('firstname',$firstname);
819
					$session->param('surname',$surname);
862
                    $session->param('surname',$surname);
820
					$session->param('branch',$branchcode);
863
                    $session->param('branch',$branchcode);
821
					$session->param('branchname',$branchname);
864
                    $session->param('branchname',$branchname);
822
					$session->param('flags',$userflags);
865
                    $session->param('flags',$userflags);
823
					$session->param('emailaddress',$emailaddress);
866
                    $session->param('emailaddress',$emailaddress);
824
					$session->param('ip',$session->remote_addr());
867
                    $session->param('ip',$session->remote_addr());
825
					$session->param('lasttime',time());
868
                    $session->param('lasttime',time());
826
					$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
869
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
827
				}
870
                }
828
				elsif ( $return == 2 ) {
871
                elsif ( $return == 2 ) {
829
					#We suppose the user is the superlibrarian
872
                    #We suppose the user is the superlibrarian
830
					$borrowernumber = 0;
873
                    $borrowernumber = 0;
831
					$session->param('number',0);
874
                    $session->param('number',0);
832
					$session->param('id',C4::Context->config('user'));
875
                    $session->param('id',C4::Context->config('user'));
833
					$session->param('cardnumber',C4::Context->config('user'));
876
                    $session->param('cardnumber',C4::Context->config('user'));
834
					$session->param('firstname',C4::Context->config('user'));
877
                    $session->param('firstname',C4::Context->config('user'));
835
					$session->param('surname',C4::Context->config('user'));
878
                    $session->param('surname',C4::Context->config('user'));
836
					$session->param('branch','NO_LIBRARY_SET');
879
                    $session->param('branch','NO_LIBRARY_SET');
837
					$session->param('branchname','NO_LIBRARY_SET');
880
                    $session->param('branchname','NO_LIBRARY_SET');
838
					$session->param('flags',1);
881
                    $session->param('flags',1);
839
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
882
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
840
					$session->param('ip',$session->remote_addr());
883
                    $session->param('ip',$session->remote_addr());
841
					$session->param('lasttime',time());
884
                    $session->param('lasttime',time());
842
				}
885
                }
843
				C4::Context::set_userenv(
886
                C4::Context::set_userenv(
844
					$session->param('number'),       $session->param('id'),
887
                    $session->param('number'),       $session->param('id'),
845
					$session->param('cardnumber'),   $session->param('firstname'),
888
                    $session->param('cardnumber'),   $session->param('firstname'),
846
					$session->param('surname'),      $session->param('branch'),
889
                    $session->param('surname'),      $session->param('branch'),
847
					$session->param('branchname'),   $session->param('flags'),
890
                    $session->param('branchname'),   $session->param('flags'),
848
					$session->param('emailaddress'), $session->param('branchprinter')
891
                    $session->param('emailaddress'), $session->param('branchprinter')
849
				);
892
                );
850
893
851
				# Grab borrower's shelves and public shelves and add them to the session
894
                # Grab borrower's shelves and public shelves and add them to the session
852
				# $row_count determines how many records are returned from the db query
895
                # $row_count determines how many records are returned from the db query
853
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
896
                # and the number of lists to be displayed of each type in the 'Lists' button drop down
854
				my $row_count = 10; # FIXME:This probably should be a syspref
897
                my $row_count = 10; # FIXME:This probably should be a syspref
855
				my ($total, $totshelves, $barshelves, $pubshelves);
898
                my ($total, $totshelves, $barshelves, $pubshelves);
856
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
899
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
857
				$total->{'bartotal'} = $totshelves;
900
                $total->{'bartotal'} = $totshelves;
858
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
901
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
859
				$total->{'pubtotal'} = $totshelves;
902
                $total->{'pubtotal'} = $totshelves;
860
				$session->param('barshelves', $barshelves);
903
                $session->param('barshelves', $barshelves);
861
				$session->param('pubshelves', $pubshelves);
904
                $session->param('pubshelves', $pubshelves);
862
				$session->param('totshelves', $total);
905
                $session->param('totshelves', $total);
863
906
864
				C4::Context::set_shelves_userenv('bar',$barshelves);
907
                C4::Context::set_shelves_userenv('bar',$barshelves);
865
				C4::Context::set_shelves_userenv('pub',$pubshelves);
908
                C4::Context::set_shelves_userenv('pub',$pubshelves);
866
				C4::Context::set_shelves_userenv('tot',$total);
909
                C4::Context::set_shelves_userenv('tot',$total);
867
			}
910
            }
868
        	else {
911
        	else {
869
            	if ($userid) {
912
            	if ($userid) {
870
                	$info{'invalid_username_or_password'} = 1;
913
                	$info{'invalid_username_or_password'} = 1;
(-)a/C4/Members.pm (-1 / +31 lines)
Lines 93-100 BEGIN { Link Here
93
		&DeleteMessage
93
		&DeleteMessage
94
		&GetMessages
94
		&GetMessages
95
		&GetMessagesCount
95
		&GetMessagesCount
96
97
        &IssueSlip
96
        &IssueSlip
97
		GetBorrowersWithEmail
98
	);
98
	);
99
99
100
	#Modify data
100
	#Modify data
Lines 2308-2313 sub IssueSlip { Link Here
2308
    );
2308
    );
2309
}
2309
}
2310
2310
2311
=head2 GetBorrowersWithEmail
2312
2313
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2314
2315
This gets a list of users and their basic details from their email address.
2316
As it's possible for multiple user to have the same email address, it provides
2317
you with all of them. If there is no userid for the user, there will be an
2318
C<undef> there. An empty list will be returned if there are no matches.
2319
2320
=cut
2321
2322
sub GetBorrowersWithEmail {
2323
    my $email = shift;
2324
2325
    my $dbh = C4::Context->dbh;
2326
2327
    my $query = "SELECT borrowernumber, userid FROM borrowers WHERE email=?";
2328
    my $sth=$dbh->prepare($query);
2329
    $sth->execute($email);
2330
    my @result = ();
2331
    while (my $ref = $sth->fetch) {
2332
        push @result, $ref;
2333
    }
2334
    die "Failure searching for borrowers by email address: $sth->errstr" if $sth->err;
2335
    return @result;
2336
}
2337
2338
2339
END { }    # module clean-up code here (global destructor)
2340
2311
1;
2341
1;
2312
2342
2313
__END__
2343
__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/etc/koha-httpd.conf (+16 lines)
Lines 20-25 Link Here
20
   SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
20
   SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
21
   SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
21
   SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
22
22
23
# If your Apache is configured to use SSL, activating these will allow you
24
# to use client-side certificates to authenticate users. See the 'AllowPKIAuth'
25
# system preference.
26
#   SSLVerifyClient require
27
#   SSLVerifyDepth 2
28
#   SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
29
#   SSLOptions +StdEnvVars
30
23
   <IfModule mod_gzip.c>
31
   <IfModule mod_gzip.c>
24
     mod_gzip_on yes
32
     mod_gzip_on yes
25
     mod_gzip_dechunk yes
33
     mod_gzip_dechunk yes
Lines 119-124 Link Here
119
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
127
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
120
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl
128
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl
121
129
130
# If your Apache is configured to use SSL, activating these will allow you
131
# to use client-side certificates to authenticate users. See the 'AllowPKIAuth'
132
# system preference.
133
#   SSLVerifyClient require
134
#   SSLVerifyDepth 2
135
#   SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
136
#   SSLOptions +StdEnvVars
137
122
   <IfModule mod_gzip.c>
138
   <IfModule mod_gzip.c>
123
     mod_gzip_on yes
139
     mod_gzip_on yes
124
     mod_gzip_dechunk yes
140
     mod_gzip_dechunk yes
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 348-350 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
348
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogModuleRelink',0,'If OFF the linker will never replace the authids that are set in the cataloging module.',NULL,'YesNo');
348
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('CatalogModuleRelink',0,'If OFF the linker will never replace the authids that are set in the cataloging module.',NULL,'YesNo');
349
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelay',  '0',  '',  'Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay',  'YesNo');
349
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ExpireReservesMaxPickUpDelay',  '0',  '',  'Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay',  'YesNo');
350
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')
350
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')
351
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 (+9 lines)
Lines 4892-4897 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4892
    SetVersion($DBversion);
4892
    SetVersion($DBversion);
4893
}
4893
}
4894
4894
4895
$DBversion = "3.07.00.XXX";
4896
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4897
    $dbh->do(qq{
4898
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowPKIAuth',0,'This allows the user to authenticate via client side certificates',NULL,'YesNo');
4899
    });
4900
    print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n";
4901
    SetVersion($DBversion);
4902
}
4903
4895
=head1 FUNCTIONS
4904
=head1 FUNCTIONS
4896
4905
4897
=head2 DropAllForeignKeys($table)
4906
=head2 DropAllForeignKeys($table)
(-)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 (checked against userid)
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