From b2e4a5a6bed87b6b832ff0ed1d9b9cf26fc0ac58 Mon Sep 17 00:00:00 2001
From: Katrin Fischer <Katrin.Fischer.83@web.de>
Date: Sat, 27 Dec 2014 13:44:45 +0100
Subject: [PATCH] Bug 5511: QA follow up - several fixes

- Move database update entry to correct spot
- Fix version number in database update
- Fix capitalization in sys pref description
- Fix sequence in sysprefs.sql
---
 installer/data/mysql/sysprefs.sql                        |  4 ++--
 installer/data/mysql/updatedatabase.pl                   | 16 +++++++++-------
 .../prog/en/modules/admin/preferences/admin.pref         |  2 +-
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index f6efb5a..7fd1d92 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -372,6 +372,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'),
 ('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'),
 ('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'),
+('SessionRestrictionByIP','1','Check for Change in Remote IP address for Session Security . Disable when remote ip address changes frequently.','','YesNo'),
 ('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
 ('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
 ('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'),
@@ -472,6 +473,5 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
 ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
 ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
-('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
-('SessionRestrictionByIP','1','Check for Change in Remote IP address for Session Security . Disable when remote ip address changes frequently.','','YesNo');
+('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
 ;
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 454f691..43417cc 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -9576,13 +9576,7 @@ if ( CheckVersion($DBversion) ) {
 $DBversion = "3.18.00.000";
 if ( CheckVersion($DBversion) ) {
     print "Upgrade to $DBversion done (3.18.0 release)\n";
-}
-
-$DBversion = "3.18.00.001";
-if ( CheckVersion($DBversion) ) {
-    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SessionRestrictionByIP','1','Check for Change in  Remote IP address for Session Security. Disable when remote ip address changes frequently.','','YesNo')");
-    print "Upgrade to $DBversion done (Bug 5511 - SessionRestrictionByIP)";
-    SetVersion ($DBversion);
+    SetVersion($DBversion);
 }
 
 $DBversion = "3.19.00.000";
@@ -9614,6 +9608,14 @@ if ( CheckVersion($DBversion) ) {
     SetVersion ($DBversion);
 }
 
+
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SessionRestrictionByIP','1','Check for Change in  Remote IP address for Session Security. Disable when remote ip address changes frequently.','','YesNo')");
+    print "Upgrade to $DBversion done (Bug 5511 - SessionRestrictionByIP)";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
index 6147ef7..e1d54a6 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
@@ -69,7 +69,7 @@ Administration:
               choices:
                   yes: Enable
                   no: "Disable"
-            - Check for Change in Remote IP address for Session Security. Disable when remote ip address changes frequently.
+            - check for change in remote IP address for session security. Disable only when remote IP address changes frequently.
         # PostgreSQL is supported by CGI::Session but not by Koha.
         -
             - Store login session information
-- 
1.9.1