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

(-)a/C4/Auth.pm (-121 / +154 lines)
Lines 157-162 sub get_template_and_user { Link Here
157
    my $borrowernumber;
157
    my $borrowernumber;
158
    my $insecure = C4::Context->preference('insecure');
158
    my $insecure = C4::Context->preference('insecure');
159
    if ($user or $insecure) {
159
    if ($user or $insecure) {
160
        # It's possible for $user to be the borrowernumber if they don't have a
161
        # userid defined (and are logging in through some other method, such
162
        # as SSL certs against an email address)
163
        $borrowernumber = getborrowernumber($user) if defined($user);
164
        if (!defined($borrowernumber) && defined($user)) {
165
        	my $borrower = GetMember(borrowernumber => $user);
166
        	if ($borrower) {
167
            	$borrowernumber = $user;
168
                # A bit of a hack, but I don't know there's a nicer way
169
                # to do it.
170
                $user = $borrower->{firstname} . ' ' . $borrower->{surname};
171
            }
172
        }
160
173
161
        # load the template variables for stylesheets and JavaScript
174
        # load the template variables for stylesheets and JavaScript
162
        $template->param( css_libs => $in->{'css_libs'} );
175
        $template->param( css_libs => $in->{'css_libs'} );
Lines 187-194 sub get_template_and_user { Link Here
187
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
200
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
188
        }
201
        }
189
202
190
        $borrowernumber = getborrowernumber($user) if defined($user);
191
192
        my ( $borr ) = GetMemberDetails( $borrowernumber );
203
        my ( $borr ) = GetMemberDetails( $borrowernumber );
193
        my @bordat;
204
        my @bordat;
194
        $bordat[0] = $borr;
205
        $bordat[0] = $borr;
Lines 740-748 sub checkauth { Link Here
740
    }
751
    }
741
    unless ($userid || $sessionID) {
752
    unless ($userid || $sessionID) {
742
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
753
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
743
		my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
754
        my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
744
        my $sessionID = $session->id;
755
        my $sessionID = $session->id;
745
       	C4::Context->_new_userenv($sessionID);
756
        C4::Context->_new_userenv($sessionID);
746
        $cookie = $query->cookie(CGISESSID => $sessionID);
757
        $cookie = $query->cookie(CGISESSID => $sessionID);
747
	    $userid    = $query->param('userid');
758
	    $userid    = $query->param('userid');
748
    	    if ($cas || $userid) {
759
    	    if ($cas || $userid) {
Lines 753-759 sub checkauth { Link Here
753
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
764
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
754
		    $userid = $retuserid;
765
		    $userid = $retuserid;
755
		    $info{'invalidCasLogin'} = 1 unless ($return);
766
		    $info{'invalidCasLogin'} = 1 unless ($return);
756
        	} else {
767
        } elsif (($pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'}) ||
768
            ($pki_field eq 'emailAddress' && $ENV{'SSL_CLIENT_S_DN_Email'})) {
769
            my $value;
770
            if ($pki_field eq 'Common Name') {
771
                $value = $ENV{'SSL_CLIENT_S_DN_CN'};
772
            } elsif ($pki_field eq 'emailAddress') {
773
                $value = $ENV{'SSL_CLIENT_S_DN_Email'};
774
                # If we're looking up the email, there's a chance that the person
775
                # doesn't have a userid. So if there is none, we pass along the
776
                # borrower number, and the bits of code that need to know the user
777
                # ID will have to be smart enough to handle that.
778
                my @users_info = GetBorrowersWithEmail($value);
779
                if (@users_info) {
780
                    # First the userid, then the borrowernum
781
                    $value = $users_info[0][1] || $users_info[0][0];
782
                } else {
783
                    undef $value;
784
                }
785
            }
786
            # 0 for no user, 1 for normal, 2 for demo user.
787
            $return = $value ? 1 : 0;
788
            $userid = $value;
789
        } else {
757
		    my $retuserid;
790
		    my $retuserid;
758
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
791
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
759
		    $userid = $retuserid if ($retuserid ne '');
792
		    $userid = $retuserid if ($retuserid ne '');
Lines 768-893 sub checkauth { Link Here
768
                	C4::Context->_unset_userenv($sessionID);
801
                	C4::Context->_unset_userenv($sessionID);
769
            	}
802
            	}
770
803
771
				my ($borrowernumber, $firstname, $surname, $userflags,
804
                my ($borrowernumber, $firstname, $surname, $userflags,
772
					$branchcode, $branchname, $branchprinter, $emailaddress);
805
                    $branchcode, $branchname, $branchprinter, $emailaddress);
773
806
774
            	if ( $return == 1 ) {
807
                if ( $return == 1 ) {
775
                	my $select = "
808
                    my $select = "
776
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
809
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
777
                    	    branches.branchname    as branchname, 
810
                    branches.branchname    as branchname, 
778
                        	branches.branchprinter as branchprinter, 
811
                    branches.branchprinter as branchprinter, 
779
                        	email 
812
                    email 
780
                	FROM borrowers 
813
                    FROM borrowers 
781
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
814
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
782
                	";
815
                    ";
783
                	my $sth = $dbh->prepare("$select where userid=?");
816
                    my $sth = $dbh->prepare("$select where userid=?");
784
                	$sth->execute($userid);
817
                    $sth->execute($userid);
785
			unless ($sth->rows) {
818
                    unless ($sth->rows) {
786
		    	    $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
819
                        $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
787
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
820
                        $sth = $dbh->prepare("$select where cardnumber=?");
788
		       	    $sth->execute($cardnumber);
821
                        $sth->execute($cardnumber);
789
822
790
		    	    unless ($sth->rows) {
823
                        unless ($sth->rows) {
791
				$debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
824
                            $debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
792
				$sth->execute($userid);
825
                            $sth->execute($userid);
793
				unless ($sth->rows) {
826
                            unless ($sth->rows) {
794
				    $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
827
                                $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
795
				}
828
                            }
796
			    }
829
                        }
797
			}
830
                    }
798
                	if ($sth->rows) {
831
                    if ($sth->rows) {
799
			    ($borrowernumber, $firstname, $surname, $userflags,
832
                        ($borrowernumber, $firstname, $surname, $userflags,
800
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
833
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
801
						$debug and print STDERR "AUTH_3 results: " .
834
                        $debug and print STDERR "AUTH_3 results: " .
802
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
835
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
803
					} else {
836
                    } else {
804
						print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
837
                        print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
805
					}
838
                    }
806
839
807
# launch a sequence to check if we have a ip for the branch, i
840
# launch a sequence to check if we have a ip for the branch, i
808
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
841
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
809
842
810
					my $ip       = $ENV{'REMOTE_ADDR'};
843
                    my $ip       = $ENV{'REMOTE_ADDR'};
811
					# if they specify at login, use that
844
                    # if they specify at login, use that
812
					if ($query->param('branch')) {
845
                    if ($query->param('branch')) {
813
						$branchcode  = $query->param('branch');
846
                        $branchcode  = $query->param('branch');
814
						$branchname = GetBranchName($branchcode);
847
                        $branchname = GetBranchName($branchcode);
815
					}
848
                    }
816
					my $branches = GetBranches();
849
                    my $branches = GetBranches();
817
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
850
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
818
						# we have to check they are coming from the right ip range
851
                        # we have to check they are coming from the right ip range
819
						my $domain = $branches->{$branchcode}->{'branchip'};
852
                        my $domain = $branches->{$branchcode}->{'branchip'};
820
						if ($ip !~ /^$domain/){
853
                        if ($ip !~ /^$domain/){
821
							$loggedin=0;
854
                            $loggedin=0;
822
							$info{'wrongip'} = 1;
855
                            $info{'wrongip'} = 1;
823
						}
856
                        }
824
					}
857
                    }
825
858
826
					my @branchesloop;
859
                    my @branchesloop;
827
					foreach my $br ( keys %$branches ) {
860
                    foreach my $br ( keys %$branches ) {
828
						#     now we work with the treatment of ip
861
                        #     now we work with the treatment of ip
829
						my $domain = $branches->{$br}->{'branchip'};
862
                        my $domain = $branches->{$br}->{'branchip'};
830
						if ( $domain && $ip =~ /^$domain/ ) {
863
                        if ( $domain && $ip =~ /^$domain/ ) {
831
							$branchcode = $branches->{$br}->{'branchcode'};
864
                            $branchcode = $branches->{$br}->{'branchcode'};
832
865
833
							# new op dev : add the branchprinter and branchname in the cookie
866
                            # new op dev : add the branchprinter and branchname in the cookie
834
							$branchprinter = $branches->{$br}->{'branchprinter'};
867
                            $branchprinter = $branches->{$br}->{'branchprinter'};
835
							$branchname    = $branches->{$br}->{'branchname'};
868
                            $branchname    = $branches->{$br}->{'branchname'};
836
						}
869
                        }
837
					}
870
                    }
838
					$session->param('number',$borrowernumber);
871
                    $session->param('number',$borrowernumber);
839
					$session->param('id',$userid);
872
                    $session->param('id',$userid);
840
					$session->param('cardnumber',$cardnumber);
873
                    $session->param('cardnumber',$cardnumber);
841
					$session->param('firstname',$firstname);
874
                    $session->param('firstname',$firstname);
842
					$session->param('surname',$surname);
875
                    $session->param('surname',$surname);
843
					$session->param('branch',$branchcode);
876
                    $session->param('branch',$branchcode);
844
					$session->param('branchname',$branchname);
877
                    $session->param('branchname',$branchname);
845
					$session->param('flags',$userflags);
878
                    $session->param('flags',$userflags);
846
					$session->param('emailaddress',$emailaddress);
879
                    $session->param('emailaddress',$emailaddress);
847
					$session->param('ip',$session->remote_addr());
880
                    $session->param('ip',$session->remote_addr());
848
					$session->param('lasttime',time());
881
                    $session->param('lasttime',time());
849
					$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
882
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
850
				}
883
                }
851
				elsif ( $return == 2 ) {
884
                elsif ( $return == 2 ) {
852
					#We suppose the user is the superlibrarian
885
                    #We suppose the user is the superlibrarian
853
					$borrowernumber = 0;
886
                    $borrowernumber = 0;
854
					$session->param('number',0);
887
                    $session->param('number',0);
855
					$session->param('id',C4::Context->config('user'));
888
                    $session->param('id',C4::Context->config('user'));
856
					$session->param('cardnumber',C4::Context->config('user'));
889
                    $session->param('cardnumber',C4::Context->config('user'));
857
					$session->param('firstname',C4::Context->config('user'));
890
                    $session->param('firstname',C4::Context->config('user'));
858
					$session->param('surname',C4::Context->config('user'));
891
                    $session->param('surname',C4::Context->config('user'));
859
					$session->param('branch','NO_LIBRARY_SET');
892
                    $session->param('branch','NO_LIBRARY_SET');
860
					$session->param('branchname','NO_LIBRARY_SET');
893
                    $session->param('branchname','NO_LIBRARY_SET');
861
					$session->param('flags',1);
894
                    $session->param('flags',1);
862
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
895
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
863
					$session->param('ip',$session->remote_addr());
896
                    $session->param('ip',$session->remote_addr());
864
					$session->param('lasttime',time());
897
                    $session->param('lasttime',time());
865
				}
898
                }
866
				C4::Context::set_userenv(
899
                C4::Context::set_userenv(
867
					$session->param('number'),       $session->param('id'),
900
                    $session->param('number'),       $session->param('id'),
868
					$session->param('cardnumber'),   $session->param('firstname'),
901
                    $session->param('cardnumber'),   $session->param('firstname'),
869
					$session->param('surname'),      $session->param('branch'),
902
                    $session->param('surname'),      $session->param('branch'),
870
					$session->param('branchname'),   $session->param('flags'),
903
                    $session->param('branchname'),   $session->param('flags'),
871
					$session->param('emailaddress'), $session->param('branchprinter')
904
                    $session->param('emailaddress'), $session->param('branchprinter')
872
				);
905
                );
873
906
874
				# Grab borrower's shelves and public shelves and add them to the session
907
                # Grab borrower's shelves and public shelves and add them to the session
875
				# $row_count determines how many records are returned from the db query
908
                # $row_count determines how many records are returned from the db query
876
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
909
                # and the number of lists to be displayed of each type in the 'Lists' button drop down
877
				my $row_count = 10; # FIXME:This probably should be a syspref
910
                my $row_count = 10; # FIXME:This probably should be a syspref
878
				my ($total, $totshelves, $barshelves, $pubshelves);
911
                my ($total, $totshelves, $barshelves, $pubshelves);
879
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
912
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
880
				$total->{'bartotal'} = $totshelves;
913
                $total->{'bartotal'} = $totshelves;
881
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
914
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
882
				$total->{'pubtotal'} = $totshelves;
915
                $total->{'pubtotal'} = $totshelves;
883
				$session->param('barshelves', $barshelves);
916
                $session->param('barshelves', $barshelves);
884
				$session->param('pubshelves', $pubshelves);
917
                $session->param('pubshelves', $pubshelves);
885
				$session->param('totshelves', $total);
918
                $session->param('totshelves', $total);
886
919
887
				C4::Context::set_shelves_userenv('bar',$barshelves);
920
                C4::Context::set_shelves_userenv('bar',$barshelves);
888
				C4::Context::set_shelves_userenv('pub',$pubshelves);
921
                C4::Context::set_shelves_userenv('pub',$pubshelves);
889
				C4::Context::set_shelves_userenv('tot',$total);
922
                C4::Context::set_shelves_userenv('tot',$total);
890
			}
923
            }
891
        	else {
924
        	else {
892
            	if ($userid) {
925
            	if ($userid) {
893
                	$info{'invalid_username_or_password'} = 1;
926
                	$info{'invalid_username_or_password'} = 1;
(-)a/C4/Members.pm (+29 lines)
Lines 92-97 BEGIN { Link Here
92
		&DeleteMessage
92
		&DeleteMessage
93
		&GetMessages
93
		&GetMessages
94
		&GetMessagesCount
94
		&GetMessagesCount
95
		GetBorrowersWithEmail
95
	);
96
	);
96
97
97
	#Modify data
98
	#Modify data
Lines 2283-2288 sub DeleteMessage { Link Here
2283
2284
2284
}
2285
}
2285
2286
2287
=head2 GetBorrowersWithEmail
2288
2289
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2290
2291
This gets a list of users and their basic details from their email address.
2292
As it's possible for multiple user to have the same email address, it provides
2293
you with all of them. If there is no userid for the user, there will be an
2294
C<undef> there. An empty list will be returned if there are no matches.
2295
2296
=cut
2297
2298
sub GetBorrowersWithEmail {
2299
    my $email = shift;
2300
2301
    my $dbh = C4::Context->dbh;
2302
2303
    my $query = "SELECT borrowernumber, userid FROM borrowers WHERE email=?";
2304
    my $sth=$dbh->prepare($query);
2305
    $sth->execute($email);
2306
    my @result = ();
2307
    while (my $ref = $sth->fetch) {
2308
        push @result, $ref;
2309
    }
2310
    die "Failure searching for borrowers by email address: $sth->errstr" if $sth->err;
2311
    return @result;
2312
}
2313
2314
2286
END { }    # module clean-up code here (global destructor)
2315
END { }    # module clean-up code here (global destructor)
2287
2316
2288
1;
2317
1;
(-)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 18-23 Link Here
18
   SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
18
   SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
19
   SetEnv PERL5LIB "__PERL_MODULE_DIR__"
19
   SetEnv PERL5LIB "__PERL_MODULE_DIR__"
20
20
21
# If your Apache is configured to use SSL, activating these will allow you
22
# to use client-side certificates to authenticate users. See the 'AllowPKIAuth'
23
# system preference.
24
#   SSLVerifyClient require
25
#   SSLVerifyDepth 2
26
#   SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
27
#   SSLOptions +StdEnvVars
28
21
   <IfModule mod_gzip.c>
29
   <IfModule mod_gzip.c>
22
     mod_gzip_on yes
30
     mod_gzip_on yes
23
     mod_gzip_dechunk yes
31
     mod_gzip_dechunk yes
Lines 115-120 Link Here
115
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
123
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
116
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl
124
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl
117
125
126
# If your Apache is configured to use SSL, activating these will allow you
127
# to use client-side certificates to authenticate users. See the 'AllowPKIAuth'
128
# system preference.
129
#   SSLVerifyClient require
130
#   SSLVerifyDepth 2
131
#   SSLCACertificateFile /etc/apache2/ssl/test/ca.crt
132
#   SSLOptions +StdEnvVars
133
118
   <IfModule mod_gzip.c>
134
   <IfModule mod_gzip.c>
119
     mod_gzip_on yes
135
     mod_gzip_on yes
120
     mod_gzip_dechunk yes
136
     mod_gzip_dechunk yes
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 327-330 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
327
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
327
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo');
328
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
328
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL);
329
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
329
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo');
330
330
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 4523-4528 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4523
    SetVersion($DBversion);
4523
    SetVersion($DBversion);
4524
}
4524
}
4525
4525
4526
$DBversion = "XXXX";
4527
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4528
    $dbh->do(qq{
4529
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowPKIAuth',0,'This allows the user to authenticate via client side certificates',NULL,'YesNo');
4530
    });
4531
    print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n";
4532
    SetVersion($DBversion);
4533
}
4526
4534
4527
=head1 FUNCTIONS
4535
=head1 FUNCTIONS
4528
4536
(-)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 94-101 if ($op eq 'del') { Link Here
94
}
94
}
95
my $hasRouting = check_routing($subscriptionid);
95
my $hasRouting = check_routing($subscriptionid);
96
96
97
my ($user, $sessionID, $flags);
97
(undef, $cookie, undef, undef)
98
($user, $cookie, $sessionID, $flags)
99
    = checkauth($query, 0, {catalogue => 1}, "intranet");
98
    = checkauth($query, 0, {catalogue => 1}, "intranet");
100
99
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 ?
100
# COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ?
102
- 

Return to bug 6296