CREATE TABLE IF NOT EXISTS `#__kip_settings` (
  `name` varchar(30) NOT NULL,
  `value` text NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY  (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('site.filtering_mode', '2', 'Frontend IP filtering mode\r\n0 - disabled\r\n1 - whitelist\r\n2 - blacklist');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('admin.filtering_mode', '0', 'Backend IP filtering mode\r\n0 - disabled\r\n1 - whitelist\r\n2 - blacklist');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('users.filtering_mode', '1', 'User IP filtering mode\r\n0 - disabled\r\n1 - whitelist');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('site.filtering_action', '2', 'Frontend filter action\r\n1 - terminate app\r\n2 - redirect to mainpage\r\n3 - show offline template\r\nother - redirect location');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('admin.filtering_action', '2', 'Administrator filter action\r\n1 - terminate app\r\n2 - redirect to  login page\r\nother - redirect location');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('site.filtering_warning', '1', 'Show/hide frontend filtering warning\r\n0 - hide warning\r\n1 - show warning');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('admin.filtering_warning', '1', 'Show/hide backend filtering warning\r\n0 - hide warning\r\n1 - show warning');
REPLACE INTO `#__kip_settings` (`name`, `value`, `description`) VALUES ('users.filtering_warning', '1', 'Show/hide users filtering warning\r\n0 - hide warning\r\n1 - show warning');


CREATE TABLE IF NOT EXISTS `#__kip_filters` (
  `id` int(11) NOT NULL auto_increment,
  `iprange_txt` varchar(31) NOT NULL,
  `iplong_from` int(10) unsigned NOT NULL,
  `iplong_to` int(10) unsigned NOT NULL,
  `description` text NOT NULL,
  `client_id` tinyint(3) default NULL,
  `userid` int(11) NOT NULL,
  `published` tinyint(3) default NULL,
  `checked_out` int(11) NOT NULL,
  `checked_out_time` datetime NOT NULL,
  `created` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `modified` datetime NOT NULL,
  `modified_by` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `application` (`client_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;