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

(-)a/C4/Auth.pm (-122 / +163 lines)
Lines 156-162 sub get_template_and_user { Link Here
156
156
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
161
        # It's possible for $user to be the borrowernumber if they don't have a
162
        # userid defined (and are logging in through some other method, such as
163
        # SSL certs against an email address)
164
        $borrowernumber = getborrowernumber($user) if defined($user);
165
        if ( !defined($borrowernumber) && defined($user) ) {
166
            my $borrower = GetMember( borrowernumber => $user );
167
            if ($borrower) {
168
                $borrowernumber = $user;
169
170
                # A bit of a hack, but I don't know there's a nicer way to do
171
                # it.
172
                $user = $borrower->{firstname} . ' ' . $borrower->{surname};
173
            }
174
        }
160
175
161
        # load the template variables for stylesheets and JavaScript
176
        # load the template variables for stylesheets and JavaScript
162
        $template->param( css_libs => $in->{'css_libs'} );
177
        $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});
202
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
188
        }
203
        }
189
204
190
        $borrowernumber = getborrowernumber($user) if defined($user);
191
192
        my ( $borr ) = GetMemberDetails( $borrowernumber );
205
        my ( $borr ) = GetMemberDetails( $borrowernumber );
193
        my @bordat;
206
        my @bordat;
194
        $bordat[0] = $borr;
207
        $bordat[0] = $borr;
Lines 746-754 sub checkauth { Link Here
746
    }
759
    }
747
    unless ($userid || $sessionID) {
760
    unless ($userid || $sessionID) {
748
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
761
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
749
		my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
762
        my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
750
        my $sessionID = $session->id;
763
        my $sessionID = $session->id;
751
       	C4::Context->_new_userenv($sessionID);
764
        C4::Context->_new_userenv($sessionID);
752
        $cookie = $query->cookie(CGISESSID => $sessionID);
765
        $cookie = $query->cookie(CGISESSID => $sessionID);
753
	    $userid    = $query->param('userid');
766
	    $userid    = $query->param('userid');
754
    	    if ($cas || $userid) {
767
    	    if ($cas || $userid) {
Lines 759-765 sub checkauth { Link Here
759
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
772
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
760
		    $userid = $retuserid;
773
		    $userid = $retuserid;
761
		    $info{'invalidCasLogin'} = 1 unless ($return);
774
		    $info{'invalidCasLogin'} = 1 unless ($return);
762
        	} else {
775
        } elsif (($pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'}) ||
776
            ($pki_field eq 'emailAddress' && $ENV{'SSL_CLIENT_S_DN_Email'})) {
777
            my $value;
778
            if ($pki_field eq 'Common Name') {
779
                $value = $ENV{'SSL_CLIENT_S_DN_CN'};
780
            } elsif ($pki_field eq 'emailAddress') {
781
                $value = $ENV{'SSL_CLIENT_S_DN_Email'};
782
                # If we're looking up the email, there's a chance that the person
783
                # doesn't have a userid. So if there is none, we pass along the
784
                # borrower number, and the bits of code that need to know the user
785
                # ID will have to be smart enough to handle that.
786
                my @users_info = GetBorrowersWithEmail($value);
787
                if (@users_info) {
788
                    # First the userid, then the borrowernum
789
                    $value = $users_info[0][1] || $users_info[0][0];
790
                } else {
791
                    undef $value;
792
                }
793
            }
794
            # 0 for no user, 1 for normal, 2 for demo user.
795
            $return = $value ? 1 : 0;
796
            $userid = $value;
797
        } else {
763
		    my $retuserid;
798
		    my $retuserid;
764
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
799
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
765
		    $userid = $retuserid if ($retuserid ne '');
800
		    $userid = $retuserid if ($retuserid ne '');
Lines 774-899 sub checkauth { Link Here
774
                	C4::Context->_unset_userenv($sessionID);
809
                	C4::Context->_unset_userenv($sessionID);
775
            	}
810
            	}
776
811
777
				my ($borrowernumber, $firstname, $surname, $userflags,
812
                my ($borrowernumber, $firstname, $surname, $userflags,
778
					$branchcode, $branchname, $branchprinter, $emailaddress);
813
                    $branchcode, $branchname, $branchprinter, $emailaddress);
779
814
780
            	if ( $return == 1 ) {
815
                if ( $return == 1 ) {
781
                	my $select = "
816
                    my $select = "
782
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
817
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode,
783
                    	    branches.branchname    as branchname, 
818
                    branches.branchname    as branchname,
784
                        	branches.branchprinter as branchprinter, 
819
                    branches.branchprinter as branchprinter,
785
                        	email 
820
                    email
786
                	FROM borrowers 
821
                    FROM borrowers
787
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
822
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
788
                	";
823
                    ";
789
                	my $sth = $dbh->prepare("$select where userid=?");
824
                    my $sth = $dbh->prepare("$select where userid=?");
790
                	$sth->execute($userid);
825
                    $sth->execute($userid);
791
			unless ($sth->rows) {
826
                    unless ( $sth->rows ) {
792
		    	    $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
827
                        $debug
793
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
828
                          and print STDERR
794
		       	    $sth->execute($cardnumber);
829
                          "AUTH_1: no rows for userid='$userid'\n";
795
830
                        $sth = $dbh->prepare("$select where cardnumber=?");
796
		    	    unless ($sth->rows) {
831
                        $sth->execute($cardnumber);
797
				$debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
832
798
				$sth->execute($userid);
833
                        unless ( $sth->rows ) {
799
				unless ($sth->rows) {
834
                            $debug
800
				    $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
835
                              and print STDERR
801
				}
836
                              "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
802
			    }
837
                            $sth->execute($userid);
803
			}
838
                            unless ( $sth->rows ) {
804
                	if ($sth->rows) {
839
                                $debug
805
			    ($borrowernumber, $firstname, $surname, $userflags,
840
                                  and print STDERR
806
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
841
"AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
807
						$debug and print STDERR "AUTH_3 results: " .
842
                            }
808
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
843
                        }
809
					} else {
844
                    }
810
						print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
845
                    if ($sth->rows) {
811
					}
846
                        ($borrowernumber, $firstname, $surname, $userflags,
847
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
848
                        $debug and print STDERR "AUTH_3 results: " .
849
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
850
                    } else {
851
                        print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
852
                    }
812
853
813
# launch a sequence to check if we have a ip for the branch, i
854
# launch a sequence to check if we have a ip for the branch, i
814
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
855
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
815
856
816
					my $ip       = $ENV{'REMOTE_ADDR'};
857
                    my $ip       = $ENV{'REMOTE_ADDR'};
817
					# if they specify at login, use that
858
                    # if they specify at login, use that
818
					if ($query->param('branch')) {
859
                    if ($query->param('branch')) {
819
						$branchcode  = $query->param('branch');
860
                        $branchcode  = $query->param('branch');
820
						$branchname = GetBranchName($branchcode);
861
                        $branchname = GetBranchName($branchcode);
821
					}
862
                    }
822
					my $branches = GetBranches();
863
                    my $branches = GetBranches();
823
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
864
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
824
						# we have to check they are coming from the right ip range
865
                        # we have to check they are coming from the right ip range
825
						my $domain = $branches->{$branchcode}->{'branchip'};
866
                        my $domain = $branches->{$branchcode}->{'branchip'};
826
						if ($ip !~ /^$domain/){
867
                        if ($ip !~ /^$domain/){
827
							$loggedin=0;
868
                            $loggedin=0;
828
							$info{'wrongip'} = 1;
869
                            $info{'wrongip'} = 1;
829
						}
870
                        }
830
					}
871
                    }
831
872
832
					my @branchesloop;
873
                    my @branchesloop;
833
					foreach my $br ( keys %$branches ) {
874
                    foreach my $br ( keys %$branches ) {
834
						#     now we work with the treatment of ip
875
                        #     now we work with the treatment of ip
835
						my $domain = $branches->{$br}->{'branchip'};
876
                        my $domain = $branches->{$br}->{'branchip'};
836
						if ( $domain && $ip =~ /^$domain/ ) {
877
                        if ( $domain && $ip =~ /^$domain/ ) {
837
							$branchcode = $branches->{$br}->{'branchcode'};
878
                            $branchcode = $branches->{$br}->{'branchcode'};
838
879
839
							# new op dev : add the branchprinter and branchname in the cookie
880
                            # new op dev : add the branchprinter and branchname in the cookie
840
							$branchprinter = $branches->{$br}->{'branchprinter'};
881
                            $branchprinter = $branches->{$br}->{'branchprinter'};
841
							$branchname    = $branches->{$br}->{'branchname'};
882
                            $branchname    = $branches->{$br}->{'branchname'};
842
						}
883
                        }
843
					}
884
                    }
844
					$session->param('number',$borrowernumber);
885
                    $session->param('number',$borrowernumber);
845
					$session->param('id',$userid);
886
                    $session->param('id',$userid);
846
					$session->param('cardnumber',$cardnumber);
887
                    $session->param('cardnumber',$cardnumber);
847
					$session->param('firstname',$firstname);
888
                    $session->param('firstname',$firstname);
848
					$session->param('surname',$surname);
889
                    $session->param('surname',$surname);
849
					$session->param('branch',$branchcode);
890
                    $session->param('branch',$branchcode);
850
					$session->param('branchname',$branchname);
891
                    $session->param('branchname',$branchname);
851
					$session->param('flags',$userflags);
892
                    $session->param('flags',$userflags);
852
					$session->param('emailaddress',$emailaddress);
893
                    $session->param('emailaddress',$emailaddress);
853
					$session->param('ip',$session->remote_addr());
894
                    $session->param('ip',$session->remote_addr());
854
					$session->param('lasttime',time());
895
                    $session->param('lasttime',time());
855
					$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
896
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
856
				}
897
                }
857
				elsif ( $return == 2 ) {
898
                elsif ( $return == 2 ) {
858
					#We suppose the user is the superlibrarian
899
                    #We suppose the user is the superlibrarian
859
					$borrowernumber = 0;
900
                    $borrowernumber = 0;
860
					$session->param('number',0);
901
                    $session->param('number',0);
861
					$session->param('id',C4::Context->config('user'));
902
                    $session->param('id',C4::Context->config('user'));
862
					$session->param('cardnumber',C4::Context->config('user'));
903
                    $session->param('cardnumber',C4::Context->config('user'));
863
					$session->param('firstname',C4::Context->config('user'));
904
                    $session->param('firstname',C4::Context->config('user'));
864
					$session->param('surname',C4::Context->config('user'));
905
                    $session->param('surname',C4::Context->config('user'));
865
					$session->param('branch','NO_LIBRARY_SET');
906
                    $session->param('branch','NO_LIBRARY_SET');
866
					$session->param('branchname','NO_LIBRARY_SET');
907
                    $session->param('branchname','NO_LIBRARY_SET');
867
					$session->param('flags',1);
908
                    $session->param('flags',1);
868
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
909
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
869
					$session->param('ip',$session->remote_addr());
910
                    $session->param('ip',$session->remote_addr());
870
					$session->param('lasttime',time());
911
                    $session->param('lasttime',time());
871
				}
912
                }
872
				C4::Context::set_userenv(
913
                C4::Context::set_userenv(
873
					$session->param('number'),       $session->param('id'),
914
                    $session->param('number'),       $session->param('id'),
874
					$session->param('cardnumber'),   $session->param('firstname'),
915
                    $session->param('cardnumber'),   $session->param('firstname'),
875
					$session->param('surname'),      $session->param('branch'),
916
                    $session->param('surname'),      $session->param('branch'),
876
					$session->param('branchname'),   $session->param('flags'),
917
                    $session->param('branchname'),   $session->param('flags'),
877
					$session->param('emailaddress'), $session->param('branchprinter')
918
                    $session->param('emailaddress'), $session->param('branchprinter')
878
				);
919
                );
879
920
880
				# Grab borrower's shelves and public shelves and add them to the session
921
                # Grab borrower's shelves and public shelves and add them to the session
881
				# $row_count determines how many records are returned from the db query
922
                # $row_count determines how many records are returned from the db query
882
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
923
                # and the number of lists to be displayed of each type in the 'Lists' button drop down
883
				my $row_count = 10; # FIXME:This probably should be a syspref
924
                my $row_count = 10; # FIXME:This probably should be a syspref
884
				my ($total, $totshelves, $barshelves, $pubshelves);
925
                my ($total, $totshelves, $barshelves, $pubshelves);
885
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
926
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
886
				$total->{'bartotal'} = $totshelves;
927
                $total->{'bartotal'} = $totshelves;
887
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
928
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
888
				$total->{'pubtotal'} = $totshelves;
929
                $total->{'pubtotal'} = $totshelves;
889
				$session->param('barshelves', $barshelves);
930
                $session->param('barshelves', $barshelves);
890
				$session->param('pubshelves', $pubshelves);
931
                $session->param('pubshelves', $pubshelves);
891
				$session->param('totshelves', $total);
932
                $session->param('totshelves', $total);
892
933
893
				C4::Context::set_shelves_userenv('bar',$barshelves);
934
                C4::Context::set_shelves_userenv('bar',$barshelves);
894
				C4::Context::set_shelves_userenv('pub',$pubshelves);
935
                C4::Context::set_shelves_userenv('pub',$pubshelves);
895
				C4::Context::set_shelves_userenv('tot',$total);
936
                C4::Context::set_shelves_userenv('tot',$total);
896
			}
937
            }
897
        	else {
938
        	else {
898
            	if ($userid) {
939
            	if ($userid) {
899
                	$info{'invalid_username_or_password'} = 1;
940
                	$info{'invalid_username_or_password'} = 1;
(-)a/C4/Members.pm (+29 lines)
Lines 91-96 BEGIN { Link Here
91
		&DeleteMessage
91
		&DeleteMessage
92
		&GetMessages
92
		&GetMessages
93
		&GetMessagesCount
93
		&GetMessagesCount
94
		GetBorrowersWithEmail
94
	);
95
	);
95
96
96
	#Modify data
97
	#Modify data
Lines 2243-2248 sub DeleteMessage { Link Here
2243
2244
2244
}
2245
}
2245
2246
2247
=head2 GetBorrowersWithEmail
2248
2249
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2250
2251
This gets a list of users and their basic details from their email address.
2252
As it's possible for multiple user to have the same email address, it provides
2253
you with all of them. If there is no userid for the user, there will be an
2254
C<undef> there. An empty list will be returned if there are no matches.
2255
2256
=cut
2257
2258
sub GetBorrowersWithEmail {
2259
    my $email = shift;
2260
2261
    my $dbh = C4::Context->dbh;
2262
2263
    my $query = "SELECT borrowernumber, userid FROM borrowers WHERE email=?";
2264
    my $sth=$dbh->prepare($query);
2265
    $sth->execute($email);
2266
    my @result = ();
2267
    while (my $ref = $sth->fetch) {
2268
        push @result, $ref;
2269
    }
2270
    die "Failure searching for borrowers by email address: $sth->errstr" if $sth->err;
2271
    return @result;
2272
}
2273
2274
2246
END { }    # module clean-up code here (global destructor)
2275
END { }    # module clean-up code here (global destructor)
2247
2276
2248
1;
2277
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 328-331 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
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
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
330
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo');
331
331
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 4550-4555 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4550
    SetVersion ($DBversion);
4550
    SetVersion ($DBversion);
4551
}
4551
}
4552
4552
4553
$DBversion = "XXXX";
4554
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4555
    $dbh->do(qq{
4556
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowPKIAuth',0,'This allows the user to authenticate via client side certificates',NULL,'YesNo');
4557
    });
4558
    print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n";
4559
    SetVersion($DBversion);
4560
}
4561
4553
=head1 FUNCTIONS
4562
=head1 FUNCTIONS
4554
4563
4555
=head2 DropAllForeignKeys($table)
4564
=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 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