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

(-)a/C4/Auth.pm (-143 / +177 lines)
Lines 147-152 sub get_template_and_user { Link Here
147
    my $borrowernumber;
147
    my $borrowernumber;
148
    my $insecure = C4::Context->preference('insecure');
148
    my $insecure = C4::Context->preference('insecure');
149
    if ($user or $insecure) {
149
    if ($user or $insecure) {
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
152
        # as 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
                # A bit of a hack, but I don't know there's a nicer way
159
                # to do it.
160
                $user = $borrower->{firstname} . ' ' . $borrower->{surname};
161
            }
162
        }
150
163
151
        # load the template variables for stylesheets and JavaScript
164
        # load the template variables for stylesheets and JavaScript
152
        $template->param( css_libs => $in->{'css_libs'} );
165
        $template->param( css_libs => $in->{'css_libs'} );
Lines 177-184 sub get_template_and_user { Link Here
177
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
190
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
178
        }
191
        }
179
192
180
        $borrowernumber = getborrowernumber($user) if defined($user);
181
182
        my ( $borr ) = GetMemberDetails( $borrowernumber );
193
        my ( $borr ) = GetMemberDetails( $borrowernumber );
183
        my @bordat;
194
        my @bordat;
184
        $bordat[0] = $borr;
195
        $bordat[0] = $borr;
Lines 722-875 sub checkauth { Link Here
722
    }
733
    }
723
    unless ($userid || $sessionID) {
734
    unless ($userid || $sessionID) {
724
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
735
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
725
		my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
736
        my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
726
        my $sessionID = $session->id;
737
        my $sessionID = $session->id;
727
       	C4::Context->_new_userenv($sessionID);
738
        C4::Context->_new_userenv($sessionID);
728
        $cookie = $query->cookie(CGISESSID => $sessionID);
739
        $cookie = $query->cookie(CGISESSID => $sessionID);
729
	    $userid    = $query->param('userid');
740
        $userid    = $query->param('userid');
730
    	    if ($cas || $userid) {
741
        if ($cas || $userid ||
731
        	my $password = $query->param('password');
742
        	(my $pki_field = C4::Context->preference('AllowPKIAuth')) ne 'None') {
732
		my ($return, $cardnumber);
743
            my $password = $query->param('password');
733
		if ($cas && $query->param('ticket')) {
744
            my ($return, $cardnumber);
734
		    my $retuserid;
745
            if ($cas && $query->param('ticket')) {
735
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
746
                my $retuserid;
736
		    $userid = $retuserid;
747
                ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
737
		    $info{'invalidCasLogin'} = 1 unless ($return);
748
                $userid = $retuserid;
738
        	} else {
749
                $info{'invalidCasLogin'} = 1 unless ($return);
739
		    my $retuserid;
750
            } elsif (($pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'}) ||
740
		    ( $return, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
751
                ($pki_field eq 'emailAddress' && $ENV{'SSL_CLIENT_S_DN_Email'})) {
741
		    $userid = $retuserid if ($retuserid ne '');
752
                my $value;
742
		}
753
                if ($pki_field eq 'Common Name') {
743
		if ($return) {
754
                    $value = $ENV{'SSL_CLIENT_S_DN_CN'};
744
               _session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
755
                } elsif ($pki_field eq 'emailAddress') {
745
            	if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
756
                    $value = $ENV{'SSL_CLIENT_S_DN_Email'};
746
					$loggedin = 1;
757
                    # If we're looking up the email, there's a chance that the person
747
            	}
758
                    # doesn't have a userid. So if there is none, we pass along the
748
           		else {
759
                    # borrower number, and the bits of code that need to know the user
749
                	$info{'nopermission'} = 1;
760
                    # ID will have to be smart enough to handle that.
750
                	C4::Context->_unset_userenv($sessionID);
761
                    my @users_info = GetBorrowersWithEmail($value);
751
            	}
762
                    if (@users_info) {
763
                        # First the userid, then the borrowernum
764
                        $value = $users_info[0][1] || $users_info[0][0];
765
                    } else {
766
                        undef $value;
767
                    }
768
                }
769
                # 0 for no user, 1 for normal, 2 for demo user.
770
                $return = $value ? 1 : 0;
771
                $userid = $value;
772
            } else {
773
                my $retuserid;
774
                ( $return, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
775
                $userid = $retuserid if ($retuserid ne '');
776
            }
777
            if ($return) {
778
                _session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
779
                if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
780
                    $loggedin = 1;
781
                }
782
                else {
783
                    $info{'nopermission'} = 1;
784
                    C4::Context->_unset_userenv($sessionID);
785
                }
752
786
753
				my ($borrowernumber, $firstname, $surname, $userflags,
787
                my ($borrowernumber, $firstname, $surname, $userflags,
754
					$branchcode, $branchname, $branchprinter, $emailaddress);
788
                    $branchcode, $branchname, $branchprinter, $emailaddress);
755
789
756
            	if ( $return == 1 ) {
790
                if ( $return == 1 ) {
757
                	my $select = "
791
                    my $select = "
758
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
792
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
759
                    	    branches.branchname    as branchname, 
793
                    branches.branchname    as branchname, 
760
                        	branches.branchprinter as branchprinter, 
794
                    branches.branchprinter as branchprinter, 
761
                        	email 
795
                    email 
762
                	FROM borrowers 
796
                    FROM borrowers 
763
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
797
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
764
                	";
798
                    ";
765
                	my $sth = $dbh->prepare("$select where userid=?");
799
                    my $sth = $dbh->prepare("$select where userid=?");
766
                	$sth->execute($userid);
800
                    $sth->execute($userid);
767
			unless ($sth->rows) {
801
                    unless ($sth->rows) {
768
		    	    $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
802
                        $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
769
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
803
                        $sth = $dbh->prepare("$select where cardnumber=?");
770
		       	    $sth->execute($cardnumber);
804
                        $sth->execute($cardnumber);
771
805
772
		    	    unless ($sth->rows) {
806
                        unless ($sth->rows) {
773
				$debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
807
                            $debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
774
				$sth->execute($userid);
808
                            $sth->execute($userid);
775
				unless ($sth->rows) {
809
                            unless ($sth->rows) {
776
				    $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
810
                                $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
777
				}
811
                            }
778
			    }
812
                        }
779
			}
813
                    }
780
                	if ($sth->rows) {
814
                    if ($sth->rows) {
781
			    ($borrowernumber, $firstname, $surname, $userflags,
815
                        ($borrowernumber, $firstname, $surname, $userflags,
782
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
816
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
783
						$debug and print STDERR "AUTH_3 results: " .
817
                        $debug and print STDERR "AUTH_3 results: " .
784
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
818
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
785
					} else {
819
                    } else {
786
						print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
820
                        print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
787
					}
821
                    }
788
822
789
# launch a sequence to check if we have a ip for the branch, i
823
# launch a sequence to check if we have a ip for the branch, i
790
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
824
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
791
825
792
					my $ip       = $ENV{'REMOTE_ADDR'};
826
                    my $ip       = $ENV{'REMOTE_ADDR'};
793
					# if they specify at login, use that
827
                    # if they specify at login, use that
794
					if ($query->param('branch')) {
828
                    if ($query->param('branch')) {
795
						$branchcode  = $query->param('branch');
829
                        $branchcode  = $query->param('branch');
796
						$branchname = GetBranchName($branchcode);
830
                        $branchname = GetBranchName($branchcode);
797
					}
831
                    }
798
					my $branches = GetBranches();
832
                    my $branches = GetBranches();
799
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
833
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
800
						# we have to check they are coming from the right ip range
834
                        # we have to check they are coming from the right ip range
801
						my $domain = $branches->{$branchcode}->{'branchip'};
835
                        my $domain = $branches->{$branchcode}->{'branchip'};
802
						if ($ip !~ /^$domain/){
836
                        if ($ip !~ /^$domain/){
803
							$loggedin=0;
837
                            $loggedin=0;
804
							$info{'wrongip'} = 1;
838
                            $info{'wrongip'} = 1;
805
						}
839
                        }
806
					}
840
                    }
807
841
808
					my @branchesloop;
842
                    my @branchesloop;
809
					foreach my $br ( keys %$branches ) {
843
                    foreach my $br ( keys %$branches ) {
810
						#     now we work with the treatment of ip
844
                        #     now we work with the treatment of ip
811
						my $domain = $branches->{$br}->{'branchip'};
845
                        my $domain = $branches->{$br}->{'branchip'};
812
						if ( $domain && $ip =~ /^$domain/ ) {
846
                        if ( $domain && $ip =~ /^$domain/ ) {
813
							$branchcode = $branches->{$br}->{'branchcode'};
847
                            $branchcode = $branches->{$br}->{'branchcode'};
814
848
815
							# new op dev : add the branchprinter and branchname in the cookie
849
                            # new op dev : add the branchprinter and branchname in the cookie
816
							$branchprinter = $branches->{$br}->{'branchprinter'};
850
                            $branchprinter = $branches->{$br}->{'branchprinter'};
817
							$branchname    = $branches->{$br}->{'branchname'};
851
                            $branchname    = $branches->{$br}->{'branchname'};
818
						}
852
                        }
819
					}
853
                    }
820
					$session->param('number',$borrowernumber);
854
                    $session->param('number',$borrowernumber);
821
					$session->param('id',$userid);
855
                    $session->param('id',$userid);
822
					$session->param('cardnumber',$cardnumber);
856
                    $session->param('cardnumber',$cardnumber);
823
					$session->param('firstname',$firstname);
857
                    $session->param('firstname',$firstname);
824
					$session->param('surname',$surname);
858
                    $session->param('surname',$surname);
825
					$session->param('branch',$branchcode);
859
                    $session->param('branch',$branchcode);
826
					$session->param('branchname',$branchname);
860
                    $session->param('branchname',$branchname);
827
					$session->param('flags',$userflags);
861
                    $session->param('flags',$userflags);
828
					$session->param('emailaddress',$emailaddress);
862
                    $session->param('emailaddress',$emailaddress);
829
					$session->param('ip',$session->remote_addr());
863
                    $session->param('ip',$session->remote_addr());
830
					$session->param('lasttime',time());
864
                    $session->param('lasttime',time());
831
					$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
865
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
832
				}
866
                }
833
				elsif ( $return == 2 ) {
867
                elsif ( $return == 2 ) {
834
					#We suppose the user is the superlibrarian
868
                    #We suppose the user is the superlibrarian
835
					$borrowernumber = 0;
869
                    $borrowernumber = 0;
836
					$session->param('number',0);
870
                    $session->param('number',0);
837
					$session->param('id',C4::Context->config('user'));
871
                    $session->param('id',C4::Context->config('user'));
838
					$session->param('cardnumber',C4::Context->config('user'));
872
                    $session->param('cardnumber',C4::Context->config('user'));
839
					$session->param('firstname',C4::Context->config('user'));
873
                    $session->param('firstname',C4::Context->config('user'));
840
					$session->param('surname',C4::Context->config('user'));
874
                    $session->param('surname',C4::Context->config('user'));
841
					$session->param('branch','NO_LIBRARY_SET');
875
                    $session->param('branch','NO_LIBRARY_SET');
842
					$session->param('branchname','NO_LIBRARY_SET');
876
                    $session->param('branchname','NO_LIBRARY_SET');
843
					$session->param('flags',1);
877
                    $session->param('flags',1);
844
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
878
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
845
					$session->param('ip',$session->remote_addr());
879
                    $session->param('ip',$session->remote_addr());
846
					$session->param('lasttime',time());
880
                    $session->param('lasttime',time());
847
				}
881
                }
848
				C4::Context::set_userenv(
882
                C4::Context::set_userenv(
849
					$session->param('number'),       $session->param('id'),
883
                    $session->param('number'),       $session->param('id'),
850
					$session->param('cardnumber'),   $session->param('firstname'),
884
                    $session->param('cardnumber'),   $session->param('firstname'),
851
					$session->param('surname'),      $session->param('branch'),
885
                    $session->param('surname'),      $session->param('branch'),
852
					$session->param('branchname'),   $session->param('flags'),
886
                    $session->param('branchname'),   $session->param('flags'),
853
					$session->param('emailaddress'), $session->param('branchprinter')
887
                    $session->param('emailaddress'), $session->param('branchprinter')
854
				);
888
                );
855
889
856
				# Grab borrower's shelves and public shelves and add them to the session
890
                # Grab borrower's shelves and public shelves and add them to the session
857
				# $row_count determines how many records are returned from the db query
891
                # $row_count determines how many records are returned from the db query
858
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
892
                # and the number of lists to be displayed of each type in the 'Lists' button drop down
859
				my $row_count = 10; # FIXME:This probably should be a syspref
893
                my $row_count = 10; # FIXME:This probably should be a syspref
860
				my ($total, $totshelves, $barshelves, $pubshelves);
894
                my ($total, $totshelves, $barshelves, $pubshelves);
861
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
895
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
862
				$total->{'bartotal'} = $totshelves;
896
                $total->{'bartotal'} = $totshelves;
863
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
897
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
864
				$total->{'pubtotal'} = $totshelves;
898
                $total->{'pubtotal'} = $totshelves;
865
				$session->param('barshelves', $barshelves);
899
                $session->param('barshelves', $barshelves);
866
				$session->param('pubshelves', $pubshelves);
900
                $session->param('pubshelves', $pubshelves);
867
				$session->param('totshelves', $total);
901
                $session->param('totshelves', $total);
868
902
869
				C4::Context::set_shelves_userenv('bar',$barshelves);
903
                C4::Context::set_shelves_userenv('bar',$barshelves);
870
				C4::Context::set_shelves_userenv('pub',$pubshelves);
904
                C4::Context::set_shelves_userenv('pub',$pubshelves);
871
				C4::Context::set_shelves_userenv('tot',$total);
905
                C4::Context::set_shelves_userenv('tot',$total);
872
			}
906
            }
873
        	else {
907
        	else {
874
            	if ($userid) {
908
            	if ($userid) {
875
                	$info{'invalid_username_or_password'} = 1;
909
                	$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 2257-2262 sub DeleteMessage { Link Here
2257
2258
2258
}
2259
}
2259
2260
2261
=head2 GetBorrowersWithEmail
2262
2263
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2264
2265
This gets a list of users and their basic details from their email address.
2266
As it's possible for multiple user to have the same email address, it provides
2267
you with all of them. If there is no userid for the user, there will be an
2268
C<undef> there. An empty list will be returned if there are no matches.
2269
2270
=cut
2271
2272
sub GetBorrowersWithEmail {
2273
    my $email = shift;
2274
2275
    my $dbh = C4::Context->dbh;
2276
2277
    my $query = "SELECT borrowernumber, userid FROM borrowers WHERE email=?";
2278
    my $sth=$dbh->prepare($query);
2279
    $sth->execute($email);
2280
    my @result = ();
2281
    while (my $ref = $sth->fetch) {
2282
        push @result, $ref;
2283
    }
2284
    die "Failure searching for borrowers by email address: $sth->errstr" if $sth->err;
2285
    return @result;
2286
}
2287
2288
2260
END { }    # module clean-up code here (global destructor)
2289
END { }    # module clean-up code here (global destructor)
2261
2290
2262
1;
2291
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 31-37 use C4::Reserves; Link Here
31
31
32
my $cgi= new CGI;
32
my $cgi= new CGI;
33
33
34
my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
34
checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
35
35
36
my $biblionumber=$cgi->param('biblionumber');
36
my $biblionumber=$cgi->param('biblionumber');
37
my $itemnumber=$cgi->param('itemnumber');
37
my $itemnumber=$cgi->param('itemnumber');
Lines 57-63 for ($damaged,$itemlost,$wthdrawn) { Link Here
57
# modify MARC item if input differs from items table.
57
# modify MARC item if input differs from items table.
58
my $item_changes = {};
58
my $item_changes = {};
59
if (defined $itemnotes) { # i.e., itemnotes parameter passed from form
59
if (defined $itemnotes) { # i.e., itemnotes parameter passed from form
60
    my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
60
    checkauth($cgi, 0, {editcatalogue => 'edit_items'}, 'intranet');
61
    if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
61
    if ((not defined  $item_data_hashref->{'itemnotes'}) or $itemnotes ne $item_data_hashref->{'itemnotes'}) {
62
        $item_changes->{'itemnotes'} = $itemnotes;
62
        $item_changes->{'itemnotes'} = $itemnotes;
63
    }
63
    }
(-)a/installer/data/mysql/de-DE/mandatory/sysprefs.sql (-1 / +2 lines)
Lines 311-314 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
311
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
311
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
312
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
312
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
313
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems' ,'','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
313
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems' ,'','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
314
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
314
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
315
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/en/mandatory/sysprefs.sql (+1 lines)
Lines 312-314 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
312
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
312
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
313
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
313
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
314
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
314
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
315
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/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql (-1 / +2 lines)
Lines 312-315 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
312
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
312
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
313
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
313
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
314
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
314
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
316
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/it-IT/necessari/sysprefs.sql (+1 lines)
Lines 299-301 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
300
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
300
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
302
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/pl-PL/mandatory/sysprefs.sql (-1 / +2 lines)
Lines 310-313 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
310
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
310
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
311
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
311
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
312
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
312
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
313
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
313
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
314
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/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql (-1 / +2 lines)
Lines 365-368 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
365
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
365
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
366
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
366
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
367
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
367
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
368
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
368
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
369
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/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql (+1 lines)
Lines 391-393 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
391
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
391
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
392
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
392
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
393
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
393
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
394
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 4354-4359 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4354
    SetVersion ($DBversion);
4354
    SetVersion ($DBversion);
4355
}
4355
}
4356
4356
4357
$DBversion = "3.04.01.001";
4358
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4359
    $dbh->do(qq{
4360
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowPKIAuth',0,'This allows the user to authenticate via client side certificates',NULL,'YesNo');
4361
    });
4362
    print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n";
4363
    SetVersion($DBversion);
4364
}
4365
4357
=head1 FUNCTIONS
4366
=head1 FUNCTIONS
4358
4367
4359
=head2 DropAllForeignKeys($table)
4368
=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
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