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

(-)a/C4/Auth.pm (-4 / +12 lines)
Lines 244-249 sub get_template_and_user { Link Here
244
                -value    => '',
244
                -value    => '',
245
                -expires  => '',
245
                -expires  => '',
246
                -HttpOnly => 1,
246
                -HttpOnly => 1,
247
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
247
            );
248
            );
248
249
249
            $template->param(
250
            $template->param(
Lines 862-867 sub checkauth { Link Here
862
            -value    => '',
863
            -value    => '',
863
            -expires  => '',
864
            -expires  => '',
864
            -HttpOnly => 1,
865
            -HttpOnly => 1,
866
            -secure => ( $ENV{HTTPS} ? 1 : 0 ),
865
        );
867
        );
866
        $loggedin = 1;
868
        $loggedin = 1;
867
    }
869
    }
Lines 993-999 sub checkauth { Link Here
993
            $cookie = $query->cookie(
995
            $cookie = $query->cookie(
994
                -name     => 'CGISESSID',
996
                -name     => 'CGISESSID',
995
                -value    => $session->id,
997
                -value    => $session->id,
996
                -HttpOnly => 1
998
                -HttpOnly => 1,
999
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
997
            );
1000
            );
998
            $session->param( 'lasttime', time() );
1001
            $session->param( 'lasttime', time() );
999
            unless ( $sessiontype && $sessiontype eq 'anon' ) {    #if this is an anonymous session, we want to update the session, but not behave as if they are logged in...
1002
            unless ( $sessiontype && $sessiontype eq 'anon' ) {    #if this is an anonymous session, we want to update the session, but not behave as if they are logged in...
Lines 1022-1028 sub checkauth { Link Here
1022
        $cookie = $query->cookie(
1025
        $cookie = $query->cookie(
1023
            -name     => 'CGISESSID',
1026
            -name     => 'CGISESSID',
1024
            -value    => $session->id,
1027
            -value    => $session->id,
1025
            -HttpOnly => 1
1028
            -HttpOnly => 1,
1029
            -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1026
        );
1030
        );
1027
        my $pki_field = C4::Context->preference('AllowPKIAuth');
1031
        my $pki_field = C4::Context->preference('AllowPKIAuth');
1028
        if ( !defined($pki_field) ) {
1032
        if ( !defined($pki_field) ) {
Lines 1215-1221 sub checkauth { Link Here
1215
                            $cookie = $query->cookie(
1219
                            $cookie = $query->cookie(
1216
                                -name     => 'CGISESSID',
1220
                                -name     => 'CGISESSID',
1217
                                -value    => '',
1221
                                -value    => '',
1218
                                -HttpOnly => 1
1222
                                -HttpOnly => 1,
1223
                                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1219
                            );
1224
                            );
1220
                            $info{'wrongip'} = 1;
1225
                            $info{'wrongip'} = 1;
1221
                        }
1226
                        }
Lines 1304-1310 sub checkauth { Link Here
1304
            $cookie = $query->cookie(
1309
            $cookie = $query->cookie(
1305
                -name     => 'CGISESSID',
1310
                -name     => 'CGISESSID',
1306
                -value    => '',
1311
                -value    => '',
1307
                -HttpOnly => 1
1312
                -HttpOnly => 1,
1313
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1308
            );
1314
            );
1309
        }
1315
        }
1310
1316
Lines 1720-1725 sub check_api_auth { Link Here
1720
                    -name     => 'CGISESSID',
1726
                    -name     => 'CGISESSID',
1721
                    -value    => $session->id,
1727
                    -value    => $session->id,
1722
                    -HttpOnly => 1,
1728
                    -HttpOnly => 1,
1729
                    -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1723
                );
1730
                );
1724
                $session->param( 'lasttime', time() );
1731
                $session->param( 'lasttime', time() );
1725
                my $flags = haspermission( $userid, $flagsrequired );
1732
                my $flags = haspermission( $userid, $flagsrequired );
Lines 1774-1779 sub check_api_auth { Link Here
1774
                -name     => 'CGISESSID',
1781
                -name     => 'CGISESSID',
1775
                -value    => $sessionID,
1782
                -value    => $sessionID,
1776
                -HttpOnly => 1,
1783
                -HttpOnly => 1,
1784
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1777
            );
1785
            );
1778
            if ( $return == 1 ) {
1786
            if ( $return == 1 ) {
1779
                my (
1787
                my (
(-)a/C4/InstallAuth.pm (-3 / +6 lines)
Lines 267-272 sub checkauth { Link Here
267
                -name     => 'CGISESSID',
267
                -name     => 'CGISESSID',
268
                -value    => $session->id,
268
                -value    => $session->id,
269
                -HttpOnly => 1,
269
                -HttpOnly => 1,
270
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
270
            );
271
            );
271
            $loggedin = 1;
272
            $loggedin = 1;
272
            $userid   = $session->param('cardnumber');
273
            $userid   = $session->param('cardnumber');
Lines 307-312 sub checkauth { Link Here
307
                -name     => 'CGISESSID',
308
                -name     => 'CGISESSID',
308
                -value    => $sessionID,
309
                -value    => $sessionID,
309
                -HttpOnly => 1,
310
                -HttpOnly => 1,
311
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
310
            );
312
            );
311
            if ( $return == 2 ) {
313
            if ( $return == 2 ) {
312
314
Lines 352-358 sub checkauth { Link Here
352
                -name    => 'CGISESSID',
354
                -name    => 'CGISESSID',
353
                -value   => '',
355
                -value   => '',
354
                -HttpOnly => 1,
356
                -HttpOnly => 1,
355
                -expires => ''
357
                -expires => '',
358
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
356
            );
359
            );
357
        }
360
        }
358
        if ($envcookie) {
361
        if ($envcookie) {
Lines 394-400 sub checkauth { Link Here
394
        -name    => 'CGISESSID',
397
        -name    => 'CGISESSID',
395
        -value   => $sessionID,
398
        -value   => $sessionID,
396
        -HttpOnly => 1,
399
        -HttpOnly => 1,
397
        -expires => ''
400
        -expires => '',
401
        -secure => ( $ENV{HTTPS} ? 1 : 0 ),
398
    );
402
    );
399
    print $query->header(
403
    print $query->header(
400
        -type    => 'text/html; charset=utf-8',
404
        -type    => 'text/html; charset=utf-8',
401
- 

Return to bug 25360