From 24e4c03268aa627947f73703f4c283b9b8087d5e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 24 Aug 2015 23:29:48 +0800 Subject: Bug 1197699 - always store the ip address in the logincookies table (schema only) --- Bugzilla/Install/DB.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Bugzilla/Install/DB.pm') diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index ce148d62d..5b8cc3992 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -745,6 +745,8 @@ sub update_table_definitions { $dbh->bz_add_column('user_api_keys', 'last_used_ip', {TYPE => 'varchar(40)'}); + _add_restrict_ipaddr(); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -3865,6 +3867,15 @@ sub _fix_disable_mail { Bugzilla->dbh->do("UPDATE profiles SET disable_mail = 1 WHERE is_enabled = 0"); } +sub _add_restrict_ipaddr { + my $dbh = Bugzilla->dbh; + return if $dbh->bz_column_info('logincookies', 'restrict_ipaddr'); + + $dbh->bz_add_column('logincookies', 'restrict_ipaddr', + {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 0}); + $dbh->do("UPDATE logincookies SET restrict_ipaddr = 1 WHERE ipaddr IS NOT NULL"); +} + 1; __END__ -- cgit v1.2.3-24-g4f1b