From 40666f4a5a88babce377f3353d08b7ce2491404e Mon Sep 17 00:00:00 2001 From: George Veranis Date: Fri, 18 Mar 2022 20:05:59 +0100 Subject: [PATCH] Bug 11180: IP branch attribute should accept CIDR notation and add multiple ip This patch adds the ability to set more than ip to IP setting of a branch and also CIDR notation can recognised also. Test plan: 1) Change systempreference AutoLocation to "Yes" 2) Go to the library settings ( Administration -> Libraries ) and you can add only one ip at format xxx.xxx.xxx.xxx or xxx.xxx.* 3) Apply patch 4) Go to the library settings and you can enter to IP setting those ip(s) you want seperate by space in any format like xxx.xxx.xxx.xxx or xxx.xxx.xxx.0/24 or xxx.xxx.xxx.* or only one also on the same formats. 3) Logout 4) Try to login from an ip that not belong on the set of ip that you enter before and now CIDR notation can regognized also and also you can have more than one ip for restriction. --- installer/data/mysql/atomicupdate/bug_11180.perl | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_11180.perl diff --git a/installer/data/mysql/atomicupdate/bug_11180.perl b/installer/data/mysql/atomicupdate/bug_11180.perl new file mode 100644 index 0000000000..7f07159f58 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_11180.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE `branches` MODIFY `branchip` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the IP address(s) for your library or branch'" ); + + NewVersion( $DBversion, 11180, "expand branches.branchip to allow for multiple ip ranges"); +} -- 2.30.2