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

(-)a/C4/Auth.pm (-2 / +3 lines)
Lines 1009-1014 sub checkauth { Link Here
1009
        login                => 1,
1009
        login                => 1,
1010
        INPUTS               => \@inputs,
1010
        INPUTS               => \@inputs,
1011
        casAuthentication    => C4::Context->preference("casAuthentication"),
1011
        casAuthentication    => C4::Context->preference("casAuthentication"),
1012
        SessionRestrictionByIP     => C4::Context->preference("SessionRestrictionByIP"),
1012
        suggestion           => C4::Context->preference("suggestion"),
1013
        suggestion           => C4::Context->preference("suggestion"),
1013
        virtualshelves       => C4::Context->preference("virtualshelves"),
1014
        virtualshelves       => C4::Context->preference("virtualshelves"),
1014
        LibraryName          => "" . C4::Context->preference("LibraryName"),
1015
        LibraryName          => "" . C4::Context->preference("LibraryName"),
Lines 1188-1194 sub check_api_auth { Link Here
1188
                $userid    = undef;
1189
                $userid    = undef;
1189
                $sessionID = undef;
1190
                $sessionID = undef;
1190
                return ("expired", undef, undef);
1191
                return ("expired", undef, undef);
1191
            } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
1192
            } elsif ( C4::Context->preference('SessionRestrictionByIP') && $ip ne $ENV{'REMOTE_ADDR'} ) {
1192
                # IP address changed
1193
                # IP address changed
1193
                $session->delete();
1194
                $session->delete();
1194
                C4::Context->_unset_userenv($sessionID);
1195
                C4::Context->_unset_userenv($sessionID);
Lines 1427-1433 sub check_cookie_auth { Link Here
1427
            $userid    = undef;
1428
            $userid    = undef;
1428
            $sessionID = undef;
1429
            $sessionID = undef;
1429
            return ("expired", undef);
1430
            return ("expired", undef);
1430
        } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
1431
        } elsif ( C4::Context->preference('SessionRestrictionByIP') && $ip ne $ENV{'REMOTE_ADDR'} ) {
1431
            # IP address changed
1432
            # IP address changed
1432
            $session->delete();
1433
            $session->delete();
1433
            C4::Context->_unset_userenv($sessionID);
1434
            C4::Context->_unset_userenv($sessionID);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-1 / +7 lines)
Lines 53-58 Administration: Link Here
53
                  yes: Require
53
                  yes: Require
54
                  no: "Don't require"
54
                  no: "Don't require"
55
            - 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).
55
            - 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).
56
        -
57
            - pref: SessionRestrictionByIP
58
              default: 0
59
              choices:
60
                  yes: Enable
61
                  no: "Disable"
62
            - Check for Change in Remote IP address for Session Security. Disable when remote ip address changes frequently.
56
        # PostgreSQL is supported by CGI::Session but not by Koha.
63
        # PostgreSQL is supported by CGI::Session but not by Koha.
57
        -
64
        -
58
            - Store login session information
65
            - Store login session information
59
- 

Return to bug 5511