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

(-)a/C4/Auth.pm (-143 / +177 lines)
Lines 150-155 sub get_template_and_user { Link Here
150
    my $borrowernumber;
150
    my $borrowernumber;
151
    my $insecure = C4::Context->preference('insecure');
151
    my $insecure = C4::Context->preference('insecure');
152
    if ($user or $insecure) {
152
    if ($user or $insecure) {
153
        # It's possible for $user to be the borrowernumber if they don't have a
154
        # userid defined (and are logging in through some other method, such
155
        # as SSL certs against an email address)
156
        $borrowernumber = getborrowernumber($user) if defined($user);
157
        if (!defined($borrowernumber) && defined($user)) {
158
        	my $borrower = GetMember(borrowernumber => $user);
159
        	if ($borrower) {
160
            	$borrowernumber = $user;
161
                # A bit of a hack, but I don't know there's a nicer way
162
                # to do it.
163
                $user = $borrower->{firstname} . ' ' . $borrower->{surname};
164
            }
165
        }
153
166
154
        # load the template variables for stylesheets and JavaScript
167
        # load the template variables for stylesheets and JavaScript
155
        $template->param( css_libs => $in->{'css_libs'} );
168
        $template->param( css_libs => $in->{'css_libs'} );
Lines 180-187 sub get_template_and_user { Link Here
180
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
193
            $template->param( bartotal  => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves});
181
        }
194
        }
182
195
183
        $borrowernumber = getborrowernumber($user) if defined($user);
184
185
        my ( $borr ) = GetMemberDetails( $borrowernumber );
196
        my ( $borr ) = GetMemberDetails( $borrowernumber );
186
        my @bordat;
197
        my @bordat;
187
        $bordat[0] = $borr;
198
        $bordat[0] = $borr;
Lines 726-879 sub checkauth { Link Here
726
    }
737
    }
727
    unless ($userid || $sessionID) {
738
    unless ($userid || $sessionID) {
728
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
739
        #we initiate a session prior to checking for a username to allow for anonymous sessions...
729
		my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
740
        my $session = get_session("") or die "Auth ERROR: Cannot get_session()";
730
        my $sessionID = $session->id;
741
        my $sessionID = $session->id;
731
       	C4::Context->_new_userenv($sessionID);
742
        C4::Context->_new_userenv($sessionID);
732
        $cookie = $query->cookie(CGISESSID => $sessionID);
743
        $cookie = $query->cookie(CGISESSID => $sessionID);
733
	    $userid    = $query->param('userid');
744
        $userid    = $query->param('userid');
734
    	    if ($cas || $userid) {
745
        if ($cas || $userid ||
735
        	my $password = $query->param('password');
746
        	(my $pki_field = C4::Context->preference('AllowPKIAuth')) ne 'None') {
736
		my ($return, $cardnumber);
747
            my $password = $query->param('password');
737
		if ($cas && $query->param('ticket')) {
748
            my ($return, $cardnumber);
738
		    my $retuserid;
749
            if ($cas && $query->param('ticket')) {
739
		    ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
750
                my $retuserid;
740
		    $userid = $retuserid;
751
                ( $return, $cardnumber, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
741
		    $info{'invalidCasLogin'} = 1 unless ($return);
752
                $userid = $retuserid;
742
        	} else {
753
                $info{'invalidCasLogin'} = 1 unless ($return);
743
		    my $retuserid;
754
            } elsif (($pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'}) ||
744
		    ( $return, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
755
                ($pki_field eq 'emailAddress' && $ENV{'SSL_CLIENT_S_DN_Email'})) {
745
		    $userid = $retuserid if ($retuserid ne '');
756
                my $value;
746
		}
757
                if ($pki_field eq 'Common Name') {
747
		if ($return) {
758
                    $value = $ENV{'SSL_CLIENT_S_DN_CN'};
748
               _session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
759
                } elsif ($pki_field eq 'emailAddress') {
749
            	if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
760
                    $value = $ENV{'SSL_CLIENT_S_DN_Email'};
750
					$loggedin = 1;
761
                    # If we're looking up the email, there's a chance that the person
751
            	}
762
                    # doesn't have a userid. So if there is none, we pass along the
752
           		else {
763
                    # borrower number, and the bits of code that need to know the user
753
                	$info{'nopermission'} = 1;
764
                    # ID will have to be smart enough to handle that.
754
                	C4::Context->_unset_userenv($sessionID);
765
                    my @users_info = GetBorrowersWithEmail($value);
755
            	}
766
                    if (@users_info) {
767
                        # First the userid, then the borrowernum
768
                        $value = $users_info[0][1] || $users_info[0][0];
769
                    } else {
770
                        undef $value;
771
                    }
772
                }
773
                # 0 for no user, 1 for normal, 2 for demo user.
774
                $return = $value ? 1 : 0;
775
                $userid = $value;
776
            } else {
777
                my $retuserid;
778
                ( $return, $retuserid ) = checkpw( $dbh, $userid, $password, $query );
779
                $userid = $retuserid if ($retuserid ne '');
780
            }
781
            if ($return) {
782
                _session_log(sprintf "%20s from %16s logged in  at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime));
783
                if ( $flags = haspermission(  $userid, $flagsrequired ) ) {
784
                    $loggedin = 1;
785
                }
786
                else {
787
                    $info{'nopermission'} = 1;
788
                    C4::Context->_unset_userenv($sessionID);
789
                }
756
790
757
				my ($borrowernumber, $firstname, $surname, $userflags,
791
                my ($borrowernumber, $firstname, $surname, $userflags,
758
					$branchcode, $branchname, $branchprinter, $emailaddress);
792
                    $branchcode, $branchname, $branchprinter, $emailaddress);
759
793
760
            	if ( $return == 1 ) {
794
                if ( $return == 1 ) {
761
                	my $select = "
795
                    my $select = "
762
                	SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
796
                    SELECT borrowernumber, firstname, surname, flags, borrowers.branchcode, 
763
                    	    branches.branchname    as branchname, 
797
                    branches.branchname    as branchname, 
764
                        	branches.branchprinter as branchprinter, 
798
                    branches.branchprinter as branchprinter, 
765
                        	email 
799
                    email 
766
                	FROM borrowers 
800
                    FROM borrowers 
767
                	LEFT JOIN branches on borrowers.branchcode=branches.branchcode
801
                    LEFT JOIN branches on borrowers.branchcode=branches.branchcode
768
                	";
802
                    ";
769
                	my $sth = $dbh->prepare("$select where userid=?");
803
                    my $sth = $dbh->prepare("$select where userid=?");
770
                	$sth->execute($userid);
804
                    $sth->execute($userid);
771
			unless ($sth->rows) {
805
                    unless ($sth->rows) {
772
		    	    $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
806
                        $debug and print STDERR "AUTH_1: no rows for userid='$userid'\n";
773
		    	    $sth = $dbh->prepare("$select where cardnumber=?");
807
                        $sth = $dbh->prepare("$select where cardnumber=?");
774
		       	    $sth->execute($cardnumber);
808
                        $sth->execute($cardnumber);
775
809
776
		    	    unless ($sth->rows) {
810
                        unless ($sth->rows) {
777
				$debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
811
                            $debug and print STDERR "AUTH_2a: no rows for cardnumber='$cardnumber'\n";
778
				$sth->execute($userid);
812
                            $sth->execute($userid);
779
				unless ($sth->rows) {
813
                            unless ($sth->rows) {
780
				    $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
814
                                $debug and print STDERR "AUTH_2b: no rows for userid='$userid' AS cardnumber\n";
781
				}
815
                            }
782
			    }
816
                        }
783
			}
817
                    }
784
                	if ($sth->rows) {
818
                    if ($sth->rows) {
785
			    ($borrowernumber, $firstname, $surname, $userflags,
819
                        ($borrowernumber, $firstname, $surname, $userflags,
786
                    		$branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
820
                            $branchcode, $branchname, $branchprinter, $emailaddress) = $sth->fetchrow;
787
						$debug and print STDERR "AUTH_3 results: " .
821
                        $debug and print STDERR "AUTH_3 results: " .
788
							"$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
822
                        "$cardnumber,$borrowernumber,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress\n";
789
					} else {
823
                    } else {
790
						print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
824
                        print STDERR "AUTH_3: no results for userid='$userid', cardnumber='$cardnumber'.\n";
791
					}
825
                    }
792
826
793
# launch a sequence to check if we have a ip for the branch, i
827
# launch a sequence to check if we have a ip for the branch, i
794
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
828
# if we have one we replace the branchcode of the userenv by the branch bound in the ip.
795
829
796
					my $ip       = $ENV{'REMOTE_ADDR'};
830
                    my $ip       = $ENV{'REMOTE_ADDR'};
797
					# if they specify at login, use that
831
                    # if they specify at login, use that
798
					if ($query->param('branch')) {
832
                    if ($query->param('branch')) {
799
						$branchcode  = $query->param('branch');
833
                        $branchcode  = $query->param('branch');
800
						$branchname = GetBranchName($branchcode);
834
                        $branchname = GetBranchName($branchcode);
801
					}
835
                    }
802
					my $branches = GetBranches();
836
                    my $branches = GetBranches();
803
					if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
837
                    if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
804
						# we have to check they are coming from the right ip range
838
                        # we have to check they are coming from the right ip range
805
						my $domain = $branches->{$branchcode}->{'branchip'};
839
                        my $domain = $branches->{$branchcode}->{'branchip'};
806
						if ($ip !~ /^$domain/){
840
                        if ($ip !~ /^$domain/){
807
							$loggedin=0;
841
                            $loggedin=0;
808
							$info{'wrongip'} = 1;
842
                            $info{'wrongip'} = 1;
809
						}
843
                        }
810
					}
844
                    }
811
845
812
					my @branchesloop;
846
                    my @branchesloop;
813
					foreach my $br ( keys %$branches ) {
847
                    foreach my $br ( keys %$branches ) {
814
						#     now we work with the treatment of ip
848
                        #     now we work with the treatment of ip
815
						my $domain = $branches->{$br}->{'branchip'};
849
                        my $domain = $branches->{$br}->{'branchip'};
816
						if ( $domain && $ip =~ /^$domain/ ) {
850
                        if ( $domain && $ip =~ /^$domain/ ) {
817
							$branchcode = $branches->{$br}->{'branchcode'};
851
                            $branchcode = $branches->{$br}->{'branchcode'};
818
852
819
							# new op dev : add the branchprinter and branchname in the cookie
853
                            # new op dev : add the branchprinter and branchname in the cookie
820
							$branchprinter = $branches->{$br}->{'branchprinter'};
854
                            $branchprinter = $branches->{$br}->{'branchprinter'};
821
							$branchname    = $branches->{$br}->{'branchname'};
855
                            $branchname    = $branches->{$br}->{'branchname'};
822
						}
856
                        }
823
					}
857
                    }
824
					$session->param('number',$borrowernumber);
858
                    $session->param('number',$borrowernumber);
825
					$session->param('id',$userid);
859
                    $session->param('id',$userid);
826
					$session->param('cardnumber',$cardnumber);
860
                    $session->param('cardnumber',$cardnumber);
827
					$session->param('firstname',$firstname);
861
                    $session->param('firstname',$firstname);
828
					$session->param('surname',$surname);
862
                    $session->param('surname',$surname);
829
					$session->param('branch',$branchcode);
863
                    $session->param('branch',$branchcode);
830
					$session->param('branchname',$branchname);
864
                    $session->param('branchname',$branchname);
831
					$session->param('flags',$userflags);
865
                    $session->param('flags',$userflags);
832
					$session->param('emailaddress',$emailaddress);
866
                    $session->param('emailaddress',$emailaddress);
833
					$session->param('ip',$session->remote_addr());
867
                    $session->param('ip',$session->remote_addr());
834
					$session->param('lasttime',time());
868
                    $session->param('lasttime',time());
835
					$debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
869
                    $debug and printf STDERR "AUTH_4: (%s)\t%s %s - %s\n", map {$session->param($_)} qw(cardnumber firstname surname branch) ;
836
				}
870
                }
837
				elsif ( $return == 2 ) {
871
                elsif ( $return == 2 ) {
838
					#We suppose the user is the superlibrarian
872
                    #We suppose the user is the superlibrarian
839
					$borrowernumber = 0;
873
                    $borrowernumber = 0;
840
					$session->param('number',0);
874
                    $session->param('number',0);
841
					$session->param('id',C4::Context->config('user'));
875
                    $session->param('id',C4::Context->config('user'));
842
					$session->param('cardnumber',C4::Context->config('user'));
876
                    $session->param('cardnumber',C4::Context->config('user'));
843
					$session->param('firstname',C4::Context->config('user'));
877
                    $session->param('firstname',C4::Context->config('user'));
844
					$session->param('surname',C4::Context->config('user'));
878
                    $session->param('surname',C4::Context->config('user'));
845
					$session->param('branch','NO_LIBRARY_SET');
879
                    $session->param('branch','NO_LIBRARY_SET');
846
					$session->param('branchname','NO_LIBRARY_SET');
880
                    $session->param('branchname','NO_LIBRARY_SET');
847
					$session->param('flags',1);
881
                    $session->param('flags',1);
848
					$session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
882
                    $session->param('emailaddress', C4::Context->preference('KohaAdminEmailAddress'));
849
					$session->param('ip',$session->remote_addr());
883
                    $session->param('ip',$session->remote_addr());
850
					$session->param('lasttime',time());
884
                    $session->param('lasttime',time());
851
				}
885
                }
852
				C4::Context::set_userenv(
886
                C4::Context::set_userenv(
853
					$session->param('number'),       $session->param('id'),
887
                    $session->param('number'),       $session->param('id'),
854
					$session->param('cardnumber'),   $session->param('firstname'),
888
                    $session->param('cardnumber'),   $session->param('firstname'),
855
					$session->param('surname'),      $session->param('branch'),
889
                    $session->param('surname'),      $session->param('branch'),
856
					$session->param('branchname'),   $session->param('flags'),
890
                    $session->param('branchname'),   $session->param('flags'),
857
					$session->param('emailaddress'), $session->param('branchprinter')
891
                    $session->param('emailaddress'), $session->param('branchprinter')
858
				);
892
                );
859
893
860
				# Grab borrower's shelves and public shelves and add them to the session
894
                # Grab borrower's shelves and public shelves and add them to the session
861
				# $row_count determines how many records are returned from the db query
895
                # $row_count determines how many records are returned from the db query
862
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
896
                # and the number of lists to be displayed of each type in the 'Lists' button drop down
863
				my $row_count = 10; # FIXME:This probably should be a syspref
897
                my $row_count = 10; # FIXME:This probably should be a syspref
864
				my ($total, $totshelves, $barshelves, $pubshelves);
898
                my ($total, $totshelves, $barshelves, $pubshelves);
865
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
899
                ($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
866
				$total->{'bartotal'} = $totshelves;
900
                $total->{'bartotal'} = $totshelves;
867
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
901
                ($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
868
				$total->{'pubtotal'} = $totshelves;
902
                $total->{'pubtotal'} = $totshelves;
869
				$session->param('barshelves', $barshelves);
903
                $session->param('barshelves', $barshelves);
870
				$session->param('pubshelves', $pubshelves);
904
                $session->param('pubshelves', $pubshelves);
871
				$session->param('totshelves', $total);
905
                $session->param('totshelves', $total);
872
906
873
				C4::Context::set_shelves_userenv('bar',$barshelves);
907
                C4::Context::set_shelves_userenv('bar',$barshelves);
874
				C4::Context::set_shelves_userenv('pub',$pubshelves);
908
                C4::Context::set_shelves_userenv('pub',$pubshelves);
875
				C4::Context::set_shelves_userenv('tot',$total);
909
                C4::Context::set_shelves_userenv('tot',$total);
876
			}
910
            }
877
        	else {
911
        	else {
878
            	if ($userid) {
912
            	if ($userid) {
879
                	$info{'invalid_username_or_password'} = 1;
913
                	$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 2271-2276 sub DeleteMessage { Link Here
2271
2272
2272
}
2273
}
2273
2274
2275
=head2 GetBorrowersWithEmail
2276
2277
    ([$borrnum,$userid], ...) = GetBorrowersWithEmail('me@example.com');
2278
2279
This gets a list of users and their basic details from their email address.
2280
As it's possible for multiple user to have the same email address, it provides
2281
you with all of them. If there is no userid for the user, there will be an
2282
C<undef> there. An empty list will be returned if there are no matches.
2283
2284
=cut
2285
2286
sub GetBorrowersWithEmail {
2287
    my $email = shift;
2288
2289
    my $dbh = C4::Context->dbh;
2290
2291
    my $query = "SELECT borrowernumber, userid FROM borrowers WHERE email=?";
2292
    my $sth=$dbh->prepare($query);
2293
    $sth->execute($email);
2294
    my @result = ();
2295
    while (my $ref = $sth->fetch) {
2296
        push @result, $ref;
2297
    }
2298
    die "Failure searching for borrowers by email address: $sth->errstr" if $sth->err;
2299
    return @result;
2300
}
2301
2302
2274
END { }    # module clean-up code here (global destructor)
2303
END { }    # module clean-up code here (global destructor)
2275
2304
2276
1;
2305
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 (+2 lines)
Lines 314-316 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
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/O    pacHiddenItems.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/O    pacHiddenItems.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 ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
317
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');
318
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+2 lines)
Lines 314-316 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
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 ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
316
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
317
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');
318
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql (+2 lines)
Lines 315-317 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
315
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('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
316
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('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
317
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
317
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
318
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');
319
(-)a/installer/data/mysql/it-IT/necessari/sysprefs.sql (+2 lines)
Lines 301-303 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
301
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('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
302
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('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
303
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
303
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
304
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');
305
(-)a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql (+2 lines)
Lines 313-315 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
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 ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
315
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
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');
317
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql (+1 lines)
Lines 368-370 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
368
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('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','','Textarea');
369
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('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
370
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
370
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
371
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 (+2 lines)
Lines 393-395 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
393
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('OpacHiddenItems','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/O    pacHiddenItems.txt for more informations.','','Textarea');
394
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('numSearchRSSResults',50,'Specify the maximum number of results to display on a RSS page of results',NULL,'Integer');
395
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
395
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacRenewalBranch','checkoutbranch','Choose how the branch for an OPAC renewal is recorded in statistics','itemhomebranch|patronhomebranch|checkoutbranch|null','Choice');
396
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');
397
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4367-4372 $DBversion = "3.05.00.004"; Link Here
4367
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4367
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4368
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC',NULL,'YesNo');");
4368
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ShowReviewerPhoto',1,'If ON, photo of reviewer will be shown beside comments in OPAC',NULL,'YesNo');");
4369
    print "Upgrade to $DBversion done (Add syspref ShowReviewerPhoto)\n";
4369
    print "Upgrade to $DBversion done (Add syspref ShowReviewerPhoto)\n";
4370
}
4371
4372
$DBversion = "3.05.00.XXX";
4373
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4374
    $dbh->do(qq{
4375
    INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowPKIAuth',0,'This allows the user to authenticate via client side certificates',NULL,'YesNo');
4376
    });
4377
    print "Upgrade to $DBversion done (Bug 6296 New System preference AllowPKIAuth)\n";
4370
    SetVersion($DBversion);
4378
    SetVersion($DBversion);
4371
}
4379
}
4372
4380
(-)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