
CREATE  TABLE `ohrm_secauth_login_attempt` (
  `ip` VARCHAR(72) NOT NULL ,
  `username` VARCHAR(40) NOT NULL ,
  `last_attempt_time` DATETIME NOT NULL ,
  `no_of_attempts` SMALLINT UNSIGNED NOT NULL DEFAULT 1 ,
  PRIMARY KEY (`ip`, `username`) )
ENGINE = InnoDB;


-- adding menu items

INSERT INTO `ohrm_module` (`name`, `status`) VALUES ('securityAuthentication', 1);  

SET @module_id := (SELECT LAST_INSERT_ID());  
  
INSERT INTO ohrm_screen (`name`, `module_id`, `action_url`) VALUES  
('Authentication Configuration', @module_id, 'securityAuthenticationConfigure'); 

SET @authentication_configuration_screen_id := (SELECT LAST_INSERT_ID());

SET @admin_menu_id := (SELECT `id` FROM ohrm_menu_item WHERE `menu_title` = 'User Management' AND `level` = 2);   
  
INSERT INTO ohrm_menu_item (`menu_title`, `screen_id`, `parent_id`, `level`, `order_hint`, `url_extras`, `status`) VALUES  
('Authentication Configuration', @authentication_configuration_screen_id, @admin_menu_id, 3, 1000, '', 1);  
  
SET @admin_role_id := (SELECT `id` FROM ohrm_user_role WHERE `name` = 'Admin');  

INSERT INTO ohrm_user_role_screen (user_role_id, screen_id, can_read, can_create, can_update, can_delete) VALUES  
(@admin_role_id, @authentication_configuration_screen_id, 1, 1, 1, 1);  