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

(-)a/C4/Auth.pm (-2 / +3 lines)
Lines 1115-1120 sub checkauth { Link Here
1115
        INPUTS               => \@inputs,
1115
        INPUTS               => \@inputs,
1116
        casAuthentication    => C4::Context->preference("casAuthentication"),
1116
        casAuthentication    => C4::Context->preference("casAuthentication"),
1117
        shibbolethAuthentication => $shib,
1117
        shibbolethAuthentication => $shib,
1118
        SessionRestrictionByIP     => C4::Context->preference("SessionRestrictionByIP"),
1118
        suggestion           => C4::Context->preference("suggestion"),
1119
        suggestion           => C4::Context->preference("suggestion"),
1119
        virtualshelves       => C4::Context->preference("virtualshelves"),
1120
        virtualshelves       => C4::Context->preference("virtualshelves"),
1120
        LibraryName          => "" . C4::Context->preference("LibraryName"),
1121
        LibraryName          => "" . C4::Context->preference("LibraryName"),
Lines 1301-1307 sub check_api_auth { Link Here
1301
                $userid    = undef;
1302
                $userid    = undef;
1302
                $sessionID = undef;
1303
                $sessionID = undef;
1303
                return ("expired", undef, undef);
1304
                return ("expired", undef, undef);
1304
            } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
1305
            } elsif ( C4::Context->preference('SessionRestrictionByIP') && $ip ne $ENV{'REMOTE_ADDR'} ) {
1305
                # IP address changed
1306
                # IP address changed
1306
                $session->delete();
1307
                $session->delete();
1307
                $session->flush;
1308
                $session->flush;
Lines 1543-1549 sub check_cookie_auth { Link Here
1543
            $userid    = undef;
1544
            $userid    = undef;
1544
            $sessionID = undef;
1545
            $sessionID = undef;
1545
            return ("expired", undef);
1546
            return ("expired", undef);
1546
        } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
1547
        } elsif ( C4::Context->preference('SessionRestrictionByIP') && $ip ne $ENV{'REMOTE_ADDR'} ) {
1547
            # IP address changed
1548
            # IP address changed
1548
            $session->delete();
1549
            $session->delete();
1549
            $session->flush;
1550
            $session->flush;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-1 / +7 lines)
Lines 63-68 Administration: Link Here
63
                  yes: Require
63
                  yes: Require
64
                  no: "Don't require"
64
                  no: "Don't require"
65
            - staff to log in from a computer in the IP address range <a href="/cgi-bin/koha/admin/branches.pl">specified by their library</a> (if any).
65
            - staff to log in from a computer in the IP address range <a href="/cgi-bin/koha/admin/branches.pl">specified by their library</a> (if any).
66
        -
67
            - pref: SessionRestrictionByIP
68
              default: 0
69
              choices:
70
                  yes: Enable
71
                  no: "Disable"
72
            - Check for Change in Remote IP address for Session Security. Disable when remote ip address changes frequently.
66
        # PostgreSQL is supported by CGI::Session but not by Koha.
73
        # PostgreSQL is supported by CGI::Session but not by Koha.
67
        -
74
        -
68
            - Store login session information
75
            - Store login session information
69
- 

Return to bug 5511