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

(-)a/C4/Auth.pm (-4 / +12 lines)
Lines 229-234 sub get_template_and_user { Link Here
229
                -value    => '',
229
                -value    => '',
230
                -expires  => '',
230
                -expires  => '',
231
                -HttpOnly => 1,
231
                -HttpOnly => 1,
232
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
232
            );
233
            );
233
234
234
            $template->param(
235
            $template->param(
Lines 829-834 sub checkauth { Link Here
829
            -value    => '',
830
            -value    => '',
830
            -expires  => '',
831
            -expires  => '',
831
            -HttpOnly => 1,
832
            -HttpOnly => 1,
833
            -secure => ( $ENV{HTTPS} ? 1 : 0 ),
832
        );
834
        );
833
        $loggedin = 1;
835
        $loggedin = 1;
834
    }
836
    }
Lines 929-935 sub checkauth { Link Here
929
            $cookie = $query->cookie(
931
            $cookie = $query->cookie(
930
                -name     => 'CGISESSID',
932
                -name     => 'CGISESSID',
931
                -value    => $session->id,
933
                -value    => $session->id,
932
                -HttpOnly => 1
934
                -HttpOnly => 1,
935
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
933
            );
936
            );
934
            $session->param( 'lasttime', time() );
937
            $session->param( 'lasttime', time() );
935
            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...
938
            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 958-964 sub checkauth { Link Here
958
        $cookie = $query->cookie(
961
        $cookie = $query->cookie(
959
            -name     => 'CGISESSID',
962
            -name     => 'CGISESSID',
960
            -value    => $session->id,
963
            -value    => $session->id,
961
            -HttpOnly => 1
964
            -HttpOnly => 1,
965
            -secure => ( $ENV{HTTPS} ? 1 : 0 ),
962
        );
966
        );
963
        my $pki_field = C4::Context->preference('AllowPKIAuth');
967
        my $pki_field = C4::Context->preference('AllowPKIAuth');
964
        if ( !defined($pki_field) ) {
968
        if ( !defined($pki_field) ) {
Lines 1124-1130 sub checkauth { Link Here
1124
                            $cookie = $query->cookie(
1128
                            $cookie = $query->cookie(
1125
                                -name     => 'CGISESSID',
1129
                                -name     => 'CGISESSID',
1126
                                -value    => '',
1130
                                -value    => '',
1127
                                -HttpOnly => 1
1131
                                -HttpOnly => 1,
1132
                                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1128
                            );
1133
                            );
1129
                            $info{'wrongip'} = 1;
1134
                            $info{'wrongip'} = 1;
1130
                        }
1135
                        }
Lines 1202-1208 sub checkauth { Link Here
1202
            $cookie = $query->cookie(
1207
            $cookie = $query->cookie(
1203
                -name     => 'CGISESSID',
1208
                -name     => 'CGISESSID',
1204
                -value    => '',
1209
                -value    => '',
1205
                -HttpOnly => 1
1210
                -HttpOnly => 1,
1211
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1206
            );
1212
            );
1207
        }
1213
        }
1208
1214
Lines 1469-1474 sub check_api_auth { Link Here
1469
                    -name     => 'CGISESSID',
1475
                    -name     => 'CGISESSID',
1470
                    -value    => $session->id,
1476
                    -value    => $session->id,
1471
                    -HttpOnly => 1,
1477
                    -HttpOnly => 1,
1478
                    -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1472
                );
1479
                );
1473
                $session->param( 'lasttime', time() );
1480
                $session->param( 'lasttime', time() );
1474
                my $flags = haspermission( $userid, $flagsrequired );
1481
                my $flags = haspermission( $userid, $flagsrequired );
Lines 1523-1528 sub check_api_auth { Link Here
1523
                -name     => 'CGISESSID',
1530
                -name     => 'CGISESSID',
1524
                -value    => $sessionID,
1531
                -value    => $sessionID,
1525
                -HttpOnly => 1,
1532
                -HttpOnly => 1,
1533
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
1526
            );
1534
            );
1527
            if ( $return == 1 ) {
1535
            if ( $return == 1 ) {
1528
                my (
1536
                my (
(-)a/C4/InstallAuth.pm (-3 / +6 lines)
Lines 266-271 sub checkauth { Link Here
266
                -name     => 'CGISESSID',
266
                -name     => 'CGISESSID',
267
                -value    => $session->id,
267
                -value    => $session->id,
268
                -HttpOnly => 1,
268
                -HttpOnly => 1,
269
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
269
            );
270
            );
270
            $loggedin = 1;
271
            $loggedin = 1;
271
            $userid   = $session->param('cardnumber');
272
            $userid   = $session->param('cardnumber');
Lines 306-311 sub checkauth { Link Here
306
                -name     => 'CGISESSID',
307
                -name     => 'CGISESSID',
307
                -value    => $sessionID,
308
                -value    => $sessionID,
308
                -HttpOnly => 1,
309
                -HttpOnly => 1,
310
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
309
            );
311
            );
310
            if ( $return == 2 ) {
312
            if ( $return == 2 ) {
311
313
Lines 351-357 sub checkauth { Link Here
351
                -name    => 'CGISESSID',
353
                -name    => 'CGISESSID',
352
                -value   => '',
354
                -value   => '',
353
                -HttpOnly => 1,
355
                -HttpOnly => 1,
354
                -expires => ''
356
                -expires => '',
357
                -secure => ( $ENV{HTTPS} ? 1 : 0 ),
355
            );
358
            );
356
        }
359
        }
357
        if ($envcookie) {
360
        if ($envcookie) {
Lines 393-399 sub checkauth { Link Here
393
        -name    => 'CGISESSID',
396
        -name    => 'CGISESSID',
394
        -value   => $sessionID,
397
        -value   => $sessionID,
395
        -HttpOnly => 1,
398
        -HttpOnly => 1,
396
        -expires => ''
399
        -expires => '',
400
        -secure => ( $ENV{HTTPS} ? 1 : 0 ),
397
    );
401
    );
398
    print $query->header(
402
    print $query->header(
399
        -type    => 'text/html; charset=utf-8',
403
        -type    => 'text/html; charset=utf-8',
400
- 

Return to bug 25360