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

(-)a/C4/Auth.pm (-2 / +3 lines)
Lines 947-952 sub checkauth { Link Here
947
    login        => 1,
947
    login        => 1,
948
        INPUTS               => \@inputs,
948
        INPUTS               => \@inputs,
949
        casAuthentication    => C4::Context->preference("casAuthentication"),
949
        casAuthentication    => C4::Context->preference("casAuthentication"),
950
	remoteipcheck        => C4::Context->preference("remoteipcheck"),
950
        suggestion           => C4::Context->preference("suggestion"),
951
        suggestion           => C4::Context->preference("suggestion"),
951
        virtualshelves       => C4::Context->preference("virtualshelves"),
952
        virtualshelves       => C4::Context->preference("virtualshelves"),
952
        LibraryName          => C4::Context->preference("LibraryName"),
953
        LibraryName          => C4::Context->preference("LibraryName"),
Lines 1098-1104 sub check_api_auth { Link Here
1098
                $userid    = undef;
1099
                $userid    = undef;
1099
                $sessionID = undef;
1100
                $sessionID = undef;
1100
                return ("expired", undef, undef);
1101
                return ("expired", undef, undef);
1101
            } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
1102
            } elsif ( C4::Context->preference('remoteipcheck') && $ip ne $ENV{'REMOTE_ADDR'} ) {
1102
                # IP address changed
1103
                # IP address changed
1103
                $session->delete();
1104
                $session->delete();
1104
                C4::Context->_unset_userenv($sessionID);
1105
                C4::Context->_unset_userenv($sessionID);
Lines 1324-1330 sub check_cookie_auth { Link Here
1324
            $userid    = undef;
1325
            $userid    = undef;
1325
            $sessionID = undef;
1326
            $sessionID = undef;
1326
            return ("expired", undef);
1327
            return ("expired", undef);
1327
        } elsif ( $ip ne $ENV{'REMOTE_ADDR'} ) {
1328
        } elsif ( C4::Context->preference('remoteipcheck') && $ip ne $ENV{'REMOTE_ADDR'} ) {
1328
            # IP address changed
1329
            # IP address changed
1329
            $session->delete();
1330
            $session->delete();
1330
            C4::Context->_unset_userenv($sessionID);
1331
            C4::Context->_unset_userenv($sessionID);
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+1 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('remoteipcheck','0','Check for Change in Remote IP address for Session Security . Disable when remote ip address changes frequently.','','YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 4251-4256 $DBversion = '3.03.00.044'; Link Here
4251
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4251
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4252
    $dbh->do("ALTER TABLE `aqbasketgroups` ADD `freedeliveryplace` TEXT NULL AFTER `deliveryplace`;");
4252
    $dbh->do("ALTER TABLE `aqbasketgroups` ADD `freedeliveryplace` TEXT NULL AFTER `deliveryplace`;");
4253
    print "Upgrade to $DBversion done (adding freedeliveryplace to basketgroups)\n";
4253
    print "Upgrade to $DBversion done (adding freedeliveryplace to basketgroups)\n";
4254
	SetVersion ($DBversion);    
4254
}
4255
}
4255
4256
4256
$DBversion = '3.03.00.045';
4257
$DBversion = '3.03.00.045';
Lines 4370-4375 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4370
    SetVersion($DBversion);
4371
    SetVersion($DBversion);
4371
}
4372
}
4372
4373
4374
$DBversion = '3.05.00.XXX';
4375
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4376
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('remoteipcheck','0','Check for Change in  Remote IP address for Session Security. Disable when remote ip address changes frequently.','','YesNo')");
4377
    print "Upgrade to $DBversion done adding syspref Check for Change in  Remote IP address for Session Security. Disable when remote ip address changes frequently.";
4378
    SetVersion ($DBversion);
4379
}
4380
4381
4382
4373
=head1 FUNCTIONS
4383
=head1 FUNCTIONS
4374
4384
4375
=head2 DropAllForeignKeys($table)
4385
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-2 / +8 lines)
Lines 41-47 Administration: Link Here
41
                  no: "Don't allow"
41
                  no: "Don't allow"
42
            - staff and patrons to create and view saved lists of books.
42
            - staff and patrons to create and view saved lists of books.
43
    Login options:
43
    Login options:
44
        -
44
	-
45
            - pref: remoteipcheck
46
              default: 0
47
              choices:
48
                  yes: Enable
49
                  no: "Disable"
50
            - Check for Change in Remote IP address for Session Security. Disable when remote ip address changes frequently.
51
      	-
45
            - pref: insecure
52
            - pref: insecure
46
              default: 0
53
              default: 0
47
              choices:
54
              choices:
48
- 

Return to bug 5511