saml enable - initial testing

This commit is contained in:
Josh North 2021-05-07 12:44:04 -04:00
parent 7e2c25e46f
commit b60af215ed
10 changed files with 531 additions and 344 deletions

View File

@ -20,17 +20,268 @@
*/
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_countries`;
CREATE TABLE `lsio_countries` (
`id` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Unique ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Country Name',
`continent` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Continent of Country',
`priority` int NOT NULL DEFAULT '9' COMMENT 'Priority Sort',
`ban` int NOT NULL DEFAULT '0' COMMENT 'Sanctioned Country'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci COMMENT='Country List';
INSERT INTO `lsio_countries` (`id`, `name`, `continent`, `priority`, `ban`) VALUES
('AD', 'Andorra', 'Europe', 9, 0),
('AE', 'United Arab Emirates', 'Asia', 9, 0),
('AF', 'Afghanistan', 'Asia', 9, 0),
('AG', 'Antigua and Barbuda', 'North America', 9, 0),
('AI', 'Anguilla', 'North America', 9, 0),
('AL', 'Albania', 'Europe', 9, 0),
('AM', 'Armenia', 'Asia', 9, 0),
('AN', 'Netherlands Antilles', 'North America', 9, 0),
('AO', 'Angola', 'Africa', 9, 0),
('AQ', 'Antarctica', 'Antarctica', 9, 0),
('AR', 'Argentina', 'South America', 9, 0),
('AS', 'American Samoa', 'Oceania', 9, 0),
('AT', 'Austria', 'Europe', 9, 0),
('AU', 'Australia', 'Oceania', 9, 0),
('AW', 'Aruba', 'North America', 9, 0),
('AX', 'land Islands', 'Europe', 9, 0),
('AZ', 'Azerbaijan', 'Asia', 9, 0),
('BA', 'Bosnia and Herzegovina', 'Europe', 9, 0),
('BB', 'Barbados', 'North America', 9, 0),
('BD', 'Bangladesh', 'Asia', 9, 0),
('BE', 'Belgium', 'Europe', 1, 0),
('BF', 'Burkina Faso', 'Africa', 9, 0),
('BG', 'Bulgaria', 'Europe', 9, 0),
('BH', 'Bahrain', 'Asia', 9, 0),
('BI', 'Burundi', 'Africa', 9, 0),
('BJ', 'Benin', 'Africa', 9, 0),
('BM', 'Bermuda', 'North America', 9, 0),
('BN', 'Brunei Darussalam', 'Asia', 9, 0),
('BO', 'Bolivia', 'South America', 9, 0),
('BR', 'Brazil', 'South America', 9, 0),
('BS', 'Bahamas', 'North America', 9, 0),
('BT', 'Bhutan', 'Asia', 9, 0),
('BV', 'Bouvet Island', 'Antarctica', 9, 0),
('BW', 'Botswana', 'Africa', 9, 0),
('BY', 'Belarus', 'Europe', 9, 0),
('BZ', 'Belize', 'North America', 9, 0),
('CA', 'Canada', 'North America', 1, 0),
('CC', 'Cocos (Keeling] Islands', 'Asia', 9, 0),
('CD', 'The Democratic Republic of The Congo', 'Africa', 9, 0),
('CF', 'Central African Republic', 'Africa', 9, 0),
('CG', 'Congo', 'Africa', 9, 0),
('CH', 'Switzerland', 'Europe', 9, 0),
('CI', 'Cote D`ivoire', 'Africa', 9, 0),
('CK', 'Cook Islands', 'Oceania', 9, 0),
('CL', 'Chile', 'South America', 9, 0),
('CM', 'Cameroon', 'Africa', 9, 0),
('CN', 'China', 'Asia', 1, 0),
('CO', 'Colombia', 'South America', 9, 0),
('CR', 'Costa Rica', 'North America', 9, 0),
('CU', 'Cuba', 'North America', 9, 1),
('CV', 'Cape Verde', 'Africa', 9, 0),
('CX', 'Christmas Island', 'Asia', 9, 0),
('CY', 'Cyprus', 'Asia', 9, 0),
('CZ', 'Czech Republic', 'Europe', 9, 0),
('DE', 'Germany', 'Europe', 1, 0),
('DJ', 'Djibouti', 'Africa', 9, 0),
('DK', 'Denmark', 'Europe', 9, 0),
('DM', 'Dominica', 'North America', 9, 0),
('DO', 'Dominican Republic', 'North America', 9, 0),
('DZ', 'Algeria', 'Africa', 9, 0),
('EC', 'Ecuador', 'South America', 9, 0),
('EE', 'Estonia', 'Europe', 9, 0),
('EG', 'Egypt', 'Africa', 9, 0),
('EH', 'Western Sahara', 'Africa', 9, 0),
('ER', 'Eritrea', 'Africa', 9, 0),
('ES', 'Spain', 'Europe', 1, 0),
('ET', 'Ethiopia', 'Africa', 9, 0),
('FI', 'Finland', 'Europe', 9, 0),
('FJ', 'Fiji', 'Oceania', 9, 0),
('FK', 'Falkland Islands (Malvinas]', 'South America', 9, 0),
('FM', 'Micronesia', 'Oceania', 9, 0),
('FO', 'Faroe Islands', 'Europe', 9, 0),
('FR', 'France', 'Europe', 1, 0),
('GA', 'Gabon', 'Africa', 9, 0),
('GB', 'United Kingdom', 'Europe', 1, 0),
('GD', 'Grenada', 'North America', 9, 0),
('GE', 'Georgia', 'Asia', 9, 0),
('GF', 'French Guiana', 'South America', 9, 0),
('GG', 'Guernsey', 'Europe', 9, 0),
('GH', 'Ghana', 'Africa', 9, 0),
('GI', 'Gibraltar', 'Europe', 9, 0),
('GL', 'Greenland', 'North America', 9, 0),
('GM', 'Gambia', 'Africa', 9, 0),
('GN', 'Guinea', 'Africa', 9, 0),
('GP', 'Guadeloupe', 'North America', 9, 0),
('GQ', 'Equatorial Guinea', 'Africa', 9, 0),
('GR', 'Greece', 'Europe', 9, 0),
('GS', 'South Georgia and The South Sandwich Islands', 'Antarctica', 9, 0),
('GT', 'Guatemala', 'North America', 9, 0),
('GU', 'Guam', 'Oceania', 9, 0),
('GW', 'Guinea-bissau', 'Africa', 9, 0),
('GY', 'Guyana', 'South America', 9, 0),
('HK', 'Hong Kong', 'Asia', 9, 0),
('HM', 'Heard Island and Mcdonald Islands', 'Antarctica', 9, 0),
('HN', 'Honduras', 'North America', 9, 0),
('HR', 'Croatia', 'Europe', 9, 0),
('HT', 'Haiti', 'North America', 9, 0),
('HU', 'Hungary', 'Europe', 9, 0),
('ID', 'Indonesia', 'Asia', 9, 0),
('IE', 'Ireland', 'Europe', 1, 0),
('IL', 'Israel', 'Asia', 9, 0),
('IM', 'Isle of Man', 'Europe', 9, 0),
('IN', 'India', 'Asia', 9, 0),
('IO', 'British Indian Ocean Territory', 'Asia', 9, 0),
('IQ', 'Iraq', 'Asia', 9, 0),
('IR', 'Iran', 'Asia', 9, 1),
('IS', 'Iceland', 'Europe', 9, 0),
('IT', 'Italy', 'Europe', 1, 0),
('JE', 'Jersey', 'Europe', 9, 0),
('JM', 'Jamaica', 'North America', 9, 0),
('JO', 'Jordan', 'Asia', 9, 0),
('JP', 'Japan', 'Asia', 9, 0),
('KE', 'Kenya', 'Africa', 9, 0),
('KG', 'Kyrgyzstan', 'Asia', 9, 0),
('KH', 'Cambodia', 'Asia', 9, 0),
('KI', 'Kiribati', 'Oceania', 9, 0),
('KM', 'Comoros', 'Africa', 9, 0),
('KN', 'Saint Kitts and Nevis', 'North America', 9, 0),
('KP', 'Democratic People`s Republic of Korea', 'Asia', 9, 1),
('KR', 'Republic of Korea', 'Asia', 1, 0),
('KW', 'Kuwait', 'Asia', 9, 0),
('KY', 'Cayman Islands', 'North America', 9, 0),
('KZ', 'Kazakhstan', 'Asia', 9, 0),
('LA', 'Lao People`s Democratic Republic', 'Asia', 9, 0),
('LB', 'Lebanon', 'Asia', 9, 0),
('LC', 'Saint Lucia', 'North America', 9, 0),
('LI', 'Liechtenstein', 'Europe', 9, 0),
('LK', 'Sri Lanka', 'Asia', 9, 0),
('LR', 'Liberia', 'Africa', 9, 0),
('LS', 'Lesotho', 'Africa', 9, 0),
('LT', 'Lithuania', 'Europe', 9, 0),
('LU', 'Luxembourg', 'Europe', 9, 0),
('LV', 'Latvia', 'Europe', 9, 0),
('LY', 'Libya', 'Africa', 9, 0),
('MA', 'Morocco', 'Africa', 9, 0),
('MC', 'Monaco', 'Europe', 9, 0),
('MD', 'Moldova', 'Europe', 9, 0),
('ME', 'Montenegro', 'Europe', 9, 0),
('MG', 'Madagascar', 'Africa', 9, 0),
('MH', 'Marshall Islands', 'Oceania', 9, 0),
('MK', 'Macedonia', 'Europe', 9, 0),
('ML', 'Mali', 'Africa', 9, 0),
('MM', 'Myanmar', 'Asia', 9, 0),
('MN', 'Mongolia', 'Asia', 9, 0),
('MO', 'Macao', 'Asia', 9, 0),
('MP', 'Northern Mariana Islands', 'Oceania', 9, 0),
('MQ', 'Martinique', 'North America', 9, 0),
('MR', 'Mauritania', 'Africa', 9, 0),
('MS', 'Montserrat', 'North America', 9, 0),
('MT', 'Malta', 'Europe', 9, 0),
('MU', 'Mauritius', 'Africa', 9, 0),
('MV', 'Maldives', 'Asia', 9, 0),
('MW', 'Malawi', 'Africa', 9, 0),
('MX', 'Mexico', 'North America', 9, 0),
('MY', 'Malaysia', 'Asia', 1, 0),
('MZ', 'Mozambique', 'Africa', 9, 0),
('NA', 'Namibia', 'Africa', 9, 0),
('NC', 'New Caledonia', 'Oceania', 9, 0),
('NE', 'Niger', 'Africa', 9, 0),
('NF', 'Norfolk Island', 'Oceania', 9, 0),
('NG', 'Nigeria', 'Africa', 9, 0),
('NI', 'Nicaragua', 'North America', 9, 0),
('NL', 'Netherlands', 'Europe', 9, 0),
('NO', 'Norway', 'Europe', 9, 0),
('NP', 'Nepal', 'Asia', 9, 0),
('NR', 'Nauru', 'Oceania', 9, 0),
('NU', 'Niue', 'Oceania', 9, 0),
('NZ', 'New Zealand', 'Oceania', 9, 0),
('OM', 'Oman', 'Asia', 9, 0),
('PA', 'Panama', 'North America', 9, 0),
('PE', 'Peru', 'South America', 9, 0),
('PF', 'French Polynesia', 'Oceania', 9, 0),
('PG', 'Papua New Guinea', 'Oceania', 9, 0),
('PH', 'Philippines', 'Asia', 9, 0),
('PK', 'Pakistan', 'Asia', 9, 0),
('PL', 'Poland', 'Europe', 9, 0),
('PM', 'Saint Pierre and Miquelon', 'North America', 9, 0),
('PN', 'Pitcairn', 'Oceania', 9, 0),
('PR', 'Puerto Rico', 'North America', 9, 0),
('PS', 'Palestinia', 'Asia', 9, 0),
('PT', 'Portugal', 'Europe', 9, 0),
('PW', 'Palau', 'Oceania', 9, 0),
('PY', 'Paraguay', 'South America', 9, 0),
('QA', 'Qatar', 'Asia', 9, 0),
('RE', 'Reunion', 'Africa', 9, 0),
('RO', 'Romania', 'Europe', 9, 0),
('RS', 'Serbia', 'Europe', 9, 0),
('RU', 'Russian Federation', 'Europe', 1, 0),
('RW', 'Rwanda', 'Africa', 9, 0),
('SA', 'Saudi Arabia', 'Asia', 9, 0),
('SB', 'Solomon Islands', 'Oceania', 9, 0),
('SC', 'Seychelles', 'Africa', 9, 0),
('SD', 'Sudan', 'Africa', 9, 0),
('SE', 'Sweden', 'Europe', 9, 0),
('SG', 'Singapore', 'Asia', 9, 0),
('SH', 'Saint Helena', 'Africa', 9, 0),
('SI', 'Slovenia', 'Europe', 9, 0),
('SJ', 'Svalbard and Jan Mayen', 'Europe', 9, 0),
('SK', 'Slovakia', 'Europe', 9, 0),
('SL', 'Sierra Leone', 'Africa', 9, 0),
('SM', 'San Marino', 'Europe', 9, 0),
('SN', 'Senegal', 'Africa', 9, 0),
('SO', 'Somalia', 'Africa', 9, 0),
('SR', 'Suriname', 'South America', 9, 0),
('ST', 'Sao Tome and Principe', 'Africa', 9, 0),
('SV', 'El Salvador', 'North America', 9, 0),
('SY', 'Syrian Arab Republic', 'Asia', 9, 1),
('SZ', 'Swaziland', 'Africa', 9, 0),
('TC', 'Turks and Caicos Islands', 'North America', 9, 0),
('TD', 'Chad', 'Africa', 9, 0),
('TF', 'French Southern Territories', 'Antarctica', 9, 0),
('TG', 'Togo', 'Africa', 9, 0),
('TH', 'Thailand', 'Asia', 9, 0),
('TJ', 'Tajikistan', 'Asia', 9, 0),
('TK', 'Tokelau', 'Oceania', 9, 0),
('TL', 'Timor-leste', 'Asia', 9, 0),
('TM', 'Turkmenistan', 'Asia', 9, 0),
('TN', 'Tunisia', 'Africa', 9, 0),
('TO', 'Tonga', 'Oceania', 9, 0),
('TR', 'Turkey', 'Asia', 1, 0),
('TT', 'Trinidad and Tobago', 'North America', 9, 0),
('TV', 'Tuvalu', 'Oceania', 9, 0),
('TW', 'Taiwan, Province of China', 'Asia', 9, 0),
('TZ', 'Tanzania, United Republic of', 'Africa', 9, 0),
('UA', 'Ukraine', 'Europe', 9, 0),
('UG', 'Uganda', 'Africa', 9, 0),
('UM', 'United States Minor Outlying Islands', 'Oceania', 9, 0),
('US', 'United States', 'North America', 1, 0),
('UY', 'Uruguay', 'South America', 9, 0),
('UZ', 'Uzbekistan', 'Asia', 9, 0),
('VA', 'Holy See (Vatican City State]', 'Europe', 9, 0),
('VC', 'Saint Vincent and The Grenadines', 'North America', 9, 0),
('VE', 'Venezuela', 'South America', 9, 0),
('VG', 'Virgin Islands, British', 'North America', 9, 0),
('VI', 'Virgin Islands, U.S.', 'North America', 9, 0),
('VN', 'Viet Nam', 'Asia', 9, 0),
('VU', 'Vanuatu', 'Oceania', 9, 0),
('WF', 'Wallis and Futuna', 'Oceania', 9, 0),
('WS', 'Samoa', 'Oceania', 9, 0),
('YE', 'Yemen', 'Asia', 9, 0),
('YT', 'Mayotte', 'Africa', 9, 0),
('ZA', 'South Africa', 'Africa', 9, 0),
('ZM', 'Zambia', 'Africa', 9, 0),
('ZW', 'Zimbabwe', 'Africa', 9, 0);
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_idtypes`;
CREATE TABLE `lsio_idtypes` (
`id` int(10) UNSIGNED NOT NULL COMMENT 'UNIQUE ID',
`name` char(8) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'LANG FILE CODE'
`id` int UNSIGNED NOT NULL COMMENT 'Unique ID',
`name` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Language File Code'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `lsio_idtypes` (`id`, `name`) VALUES
(3, 'PASSPORT'),
@ -39,280 +290,26 @@ INSERT INTO `lsio_idtypes` (`id`, `name`) VALUES
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_sites`;
CREATE TABLE `lsio_sites` (
`id` int(10) UNSIGNED NOT NULL COMMENT 'UNIQUE ID',
`name` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'LOCATION CODE',
`timezone` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'ISO TIMEZONE',
`region` varchar(8) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'US, CAN, EMEA'
`id` int UNSIGNED NOT NULL COMMENT 'Unique ID',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Location Code',
`timezone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'ISO Timezone',
`region` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Region Group'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `lsio_sites` (`id`, `name`, `timezone`, `region`) VALUES
(1, 'NOSITE', 'UTC', 'NO'),
(2, 'Default Site', 'America/New_York', 'US');
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_countries`;
CREATE TABLE `lsio_countries` (
`id` varchar(3) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`name` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`continent` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`priority` int UNSIGNED,
`ban` int UNSIGNED
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `lsio_countries` (`id`, `name`, `continent`, `priority`, `ban`) VALUES
('FR', 'France', 'Europe','1','0'),
('US', 'United States', 'North America','1','0'),
('CN', 'China', 'Asia','1','0'),
('ES', 'Spain', 'Europe','1','0'),
('IT', 'Italy', 'Europe','1','0'),
('TR', 'Turkey', 'Asia','1','0'),
('GB', 'United Kingdom', 'Europe','1','0'),
('DE', 'Germany', 'Europe','1','0'),
('RU', 'Russian Federation', 'Europe','1','0'),
('MY', 'Malaysia', 'Asia','1','0'),
('AF', 'Afghanistan', 'Asia','9','0'),
('AX', 'Åland Islands', 'Europe','9','0'),
('AL', 'Albania', 'Europe','9','0'),
('DZ', 'Algeria', 'Africa','9','0'),
('AS', 'American Samoa', 'Oceania','9','0'),
('AD', 'Andorra', 'Europe','9','0'),
('AO', 'Angola', 'Africa','9','0'),
('AI', 'Anguilla', 'North America','9','0'),
('AQ', 'Antarctica', 'Antarctica','9','0'),
('AG', 'Antigua and Barbuda', 'North America','9','0'),
('AR', 'Argentina', 'South America','9','0'),
('AM', 'Armenia', 'Asia','9','0'),
('AW', 'Aruba', 'North America','9','0'),
('AU', 'Australia', 'Oceania','9','0'),
('AT', 'Austria', 'Europe','9','0'),
('AZ', 'Azerbaijan', 'Asia','9','0'),
('BS', 'Bahamas', 'North America','9','0'),
('BH', 'Bahrain', 'Asia','9','0'),
('BD', 'Bangladesh', 'Asia','9','0'),
('BB', 'Barbados', 'North America','9','0'),
('BY', 'Belarus', 'Europe','9','0'),
('BE', 'Belgium', 'Europe','1','0'),
('BZ', 'Belize', 'North America','9','0'),
('BJ', 'Benin', 'Africa','9','0'),
('BM', 'Bermuda', 'North America','9','0'),
('BT', 'Bhutan', 'Asia','9','0'),
('BO', 'Bolivia', 'South America','9','0'),
('BA', 'Bosnia and Herzegovina', 'Europe','9','0'),
('BW', 'Botswana', 'Africa','9','0'),
('BV', 'Bouvet Island', 'Antarctica','9','0'),
('BR', 'Brazil', 'South America','9','0'),
('IO', 'British Indian Ocean Territory', 'Asia','9','0'),
('BN', 'Brunei Darussalam', 'Asia','9','0'),
('BG', 'Bulgaria', 'Europe','9','0'),
('BF', 'Burkina Faso', 'Africa','9','0'),
('BI', 'Burundi', 'Africa','9','0'),
('KH', 'Cambodia', 'Asia','9','0'),
('CM', 'Cameroon', 'Africa','9','0'),
('CA', 'Canada', 'North America','1','0'),
('CV', 'Cape Verde', 'Africa','9','0'),
('KY', 'Cayman Islands', 'North America','9','0'),
('CF', 'Central African Republic', 'Africa','9','0'),
('TD', 'Chad', 'Africa','9','0'),
('CL', 'Chile', 'South America','9','0'),
('CX', 'Christmas Island', 'Asia','9','0'),
('CC', 'Cocos (Keeling] Islands', 'Asia','9','0'),
('CO', 'Colombia', 'South America','9','0'),
('KM', 'Comoros', 'Africa','9','0'),
('CG', 'Congo', 'Africa','9','0'),
('CD', 'The Democratic Republic of The Congo', 'Africa','9','0'),
('CK', 'Cook Islands', 'Oceania','9','0'),
('CR', 'Costa Rica', 'North America','9','0'),
('CI', 'Cote D`ivoire', 'Africa','9','0'),
('HR', 'Croatia', 'Europe','9','0'),
('CU', 'Cuba', 'North America','9','0'),
('CY', 'Cyprus', 'Asia','9','0'),
('CZ', 'Czech Republic', 'Europe','9','0'),
('DK', 'Denmark', 'Europe','9','0'),
('DJ', 'Djibouti', 'Africa','9','0'),
('DM', 'Dominica', 'North America','9','0'),
('DO', 'Dominican Republic', 'North America','9','0'),
('EC', 'Ecuador', 'South America','9','0'),
('EG', 'Egypt', 'Africa','9','0'),
('SV', 'El Salvador', 'North America','9','0'),
('GQ', 'Equatorial Guinea', 'Africa','9','0'),
('ER', 'Eritrea', 'Africa','9','0'),
('EE', 'Estonia', 'Europe','9','0'),
('ET', 'Ethiopia', 'Africa','9','0'),
('FK', 'Falkland Islands (Malvinas]', 'South America','9','0'),
('FO', 'Faroe Islands', 'Europe','9','0'),
('FJ', 'Fiji', 'Oceania','9','0'),
('FI', 'Finland', 'Europe','9','0'),
('GF', 'French Guiana', 'South America','9','0'),
('PF', 'French Polynesia', 'Oceania','9','0'),
('TF', 'French Southern Territories', 'Antarctica','9','0'),
('GA', 'Gabon', 'Africa','9','0'),
('GM', 'Gambia', 'Africa','9','0'),
('GE', 'Georgia', 'Asia','9','0'),
('GH', 'Ghana', 'Africa','9','0'),
('GI', 'Gibraltar', 'Europe','9','0'),
('GR', 'Greece', 'Europe','9','0'),
('GL', 'Greenland', 'North America','9','0'),
('GD', 'Grenada', 'North America','9','0'),
('GP', 'Guadeloupe', 'North America','9','0'),
('GU', 'Guam', 'Oceania','9','0'),
('GT', 'Guatemala', 'North America','9','0'),
('GG', 'Guernsey', 'Europe','9','0'),
('GN', 'Guinea', 'Africa','9','0'),
('GW', 'Guinea-bissau', 'Africa','9','0'),
('GY', 'Guyana', 'South America','9','0'),
('HT', 'Haiti', 'North America','9','0'),
('HM', 'Heard Island and Mcdonald Islands', 'Antarctica','9','0'),
('VA', 'Holy See (Vatican City State]', 'Europe','9','0'),
('HN', 'Honduras', 'North America','9','0'),
('HK', 'Hong Kong', 'Asia','9','0'),
('HU', 'Hungary', 'Europe','9','0'),
('IS', 'Iceland', 'Europe','9','0'),
('IN', 'India', 'Asia','9','0'),
('ID', 'Indonesia', 'Asia','9','0'),
('IR', 'Iran', 'Asia','9','0'),
('IQ', 'Iraq', 'Asia','9','0'),
('IE', 'Ireland', 'Europe','1','0'),
('IM', 'Isle of Man', 'Europe','9','0'),
('IL', 'Israel', 'Asia','9','0'),
('JM', 'Jamaica', 'North America','9','0'),
('JP', 'Japan', 'Asia','9','0'),
('JE', 'Jersey', 'Europe','9','0'),
('JO', 'Jordan', 'Asia','9','0'),
('KZ', 'Kazakhstan', 'Asia','9','0'),
('KE', 'Kenya', 'Africa','9','0'),
('KI', 'Kiribati', 'Oceania','9','0'),
('KP', 'Democratic People`s Republic of Korea', 'Asia','9','0'),
('KR', 'Republic of Korea', 'Asia','1','0'),
('KW', 'Kuwait', 'Asia','9','0'),
('KG', 'Kyrgyzstan', 'Asia','9','0'),
('LA', 'Lao People`s Democratic Republic', 'Asia','9','0'),
('LV', 'Latvia', 'Europe','9','0'),
('LB', 'Lebanon', 'Asia','9','0'),
('LS', 'Lesotho', 'Africa','9','0'),
('LR', 'Liberia', 'Africa','9','0'),
('LY', 'Libya', 'Africa','9','0'),
('LI', 'Liechtenstein', 'Europe','9','0'),
('LT', 'Lithuania', 'Europe','9','0'),
('LU', 'Luxembourg', 'Europe','9','0'),
('MO', 'Macao', 'Asia','9','0'),
('MK', 'Macedonia', 'Europe','9','0'),
('MG', 'Madagascar', 'Africa','9','0'),
('MW', 'Malawi', 'Africa','9','0'),
('MV', 'Maldives', 'Asia','9','0'),
('ML', 'Mali', 'Africa','9','0'),
('MT', 'Malta', 'Europe','9','0'),
('MH', 'Marshall Islands', 'Oceania','9','0'),
('MQ', 'Martinique', 'North America','9','0'),
('MR', 'Mauritania', 'Africa','9','0'),
('MU', 'Mauritius', 'Africa','9','0'),
('YT', 'Mayotte', 'Africa','9','0'),
('MX', 'Mexico', 'North America','9','0'),
('FM', 'Micronesia', 'Oceania','9','0'),
('MD', 'Moldova', 'Europe','9','0'),
('MC', 'Monaco', 'Europe','9','0'),
('MN', 'Mongolia', 'Asia','9','0'),
('ME', 'Montenegro', 'Europe','9','0'),
('MS', 'Montserrat', 'North America','9','0'),
('MA', 'Morocco', 'Africa','9','0'),
('MZ', 'Mozambique', 'Africa','9','0'),
('MM', 'Myanmar', 'Asia','9','0'),
('NA', 'Namibia', 'Africa','9','0'),
('NR', 'Nauru', 'Oceania','9','0'),
('NP', 'Nepal', 'Asia','9','0'),
('NL', 'Netherlands', 'Europe','9','0'),
('AN', 'Netherlands Antilles', 'North America','9','0'),
('NC', 'New Caledonia', 'Oceania','9','0'),
('NZ', 'New Zealand', 'Oceania','9','0'),
('NI', 'Nicaragua', 'North America','9','0'),
('NE', 'Niger', 'Africa','9','0'),
('NG', 'Nigeria', 'Africa','9','0'),
('NU', 'Niue', 'Oceania','9','0'),
('NF', 'Norfolk Island', 'Oceania','9','0'),
('MP', 'Northern Mariana Islands', 'Oceania','9','0'),
('NO', 'Norway', 'Europe','9','0'),
('OM', 'Oman', 'Asia','9','0'),
('PK', 'Pakistan', 'Asia','9','0'),
('PW', 'Palau', 'Oceania','9','0'),
('PS', 'Palestinia', 'Asia','9','0'),
('PA', 'Panama', 'North America','9','0'),
('PG', 'Papua New Guinea', 'Oceania','9','0'),
('PY', 'Paraguay', 'South America','9','0'),
('PE', 'Peru', 'South America','9','0'),
('PH', 'Philippines', 'Asia','9','0'),
('PN', 'Pitcairn', 'Oceania','9','0'),
('PL', 'Poland', 'Europe','9','0'),
('PT', 'Portugal', 'Europe','9','0'),
('PR', 'Puerto Rico', 'North America','9','0'),
('QA', 'Qatar', 'Asia','9','0'),
('RE', 'Reunion', 'Africa','9','0'),
('RO', 'Romania', 'Europe','9','0'),
('RW', 'Rwanda', 'Africa','9','0'),
('SH', 'Saint Helena', 'Africa','9','0'),
('KN', 'Saint Kitts and Nevis', 'North America','9','0'),
('LC', 'Saint Lucia', 'North America','9','0'),
('PM', 'Saint Pierre and Miquelon', 'North America','9','0'),
('VC', 'Saint Vincent and The Grenadines', 'North America','9','0'),
('WS', 'Samoa', 'Oceania','9','0'),
('SM', 'San Marino', 'Europe','9','0'),
('ST', 'Sao Tome and Principe', 'Africa','9','0'),
('SA', 'Saudi Arabia', 'Asia','9','0'),
('SN', 'Senegal', 'Africa','9','0'),
('RS', 'Serbia', 'Europe','9','0'),
('SC', 'Seychelles', 'Africa','9','0'),
('SL', 'Sierra Leone', 'Africa','9','0'),
('SG', 'Singapore', 'Asia','9','0'),
('SK', 'Slovakia', 'Europe','9','0'),
('SI', 'Slovenia', 'Europe','9','0'),
('SB', 'Solomon Islands', 'Oceania','9','0'),
('SO', 'Somalia', 'Africa','9','0'),
('ZA', 'South Africa', 'Africa','9','0'),
('GS', 'South Georgia and The South Sandwich Islands', 'Antarctica','9','0'),
('LK', 'Sri Lanka', 'Asia','9','0'),
('SD', 'Sudan', 'Africa','9','0'),
('SR', 'Suriname', 'South America','9','0'),
('SJ', 'Svalbard and Jan Mayen', 'Europe','9','0'),
('SZ', 'Swaziland', 'Africa','9','0'),
('SE', 'Sweden', 'Europe','9','0'),
('CH', 'Switzerland', 'Europe','9','0'),
('SY', 'Syrian Arab Republic', 'Asia','9','0'),
('TW', 'Taiwan, Province of China', 'Asia','9','0'),
('TJ', 'Tajikistan', 'Asia','9','0'),
('TZ', 'Tanzania, United Republic of', 'Africa','9','0'),
('TH', 'Thailand', 'Asia','9','0'),
('TL', 'Timor-leste', 'Asia','9','0'),
('TG', 'Togo', 'Africa','9','0'),
('TK', 'Tokelau', 'Oceania','9','0'),
('TO', 'Tonga', 'Oceania','9','0'),
('TT', 'Trinidad and Tobago', 'North America','9','0'),
('TN', 'Tunisia', 'Africa','9','0'),
('TM', 'Turkmenistan', 'Asia','9','0'),
('TC', 'Turks and Caicos Islands', 'North America','9','0'),
('TV', 'Tuvalu', 'Oceania','9','0'),
('UG', 'Uganda', 'Africa','9','0'),
('UA', 'Ukraine', 'Europe','9','0'),
('AE', 'United Arab Emirates', 'Asia','9','0'),
('UM', 'United States Minor Outlying Islands', 'Oceania','9','0'),
('UY', 'Uruguay', 'South America','9','0'),
('UZ', 'Uzbekistan', 'Asia','9','0'),
('VU', 'Vanuatu', 'Oceania','9','0'),
('VE', 'Venezuela', 'South America','9','0'),
('VN', 'Viet Nam', 'Asia','9','0'),
('VG', 'Virgin Islands, British', 'North America','9','0'),
('VI', 'Virgin Islands, U.S.', 'North America','9','0'),
('WF', 'Wallis and Futuna', 'Oceania','9','0'),
('EH', 'Western Sahara', 'Africa','9','0'),
('YE', 'Yemen', 'Asia','9','0'),
('ZM', 'Zambia', 'Africa','9','0'),
('ZW', 'Zimbabwe', 'Africa', '9','0');
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_users`;
CREATE TABLE `lsio_users` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`password` varchar(60) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`email` varchar(100) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`created` datetime NOT NULL,
`firstname` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`lastname` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`usertype` int(10) UNSIGNED NOT NULL,
`timezone` varchar(20) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL
`id` int UNSIGNED NOT NULL COMMENT 'Unique ID',
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Unique Username',
`password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Password',
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Unique Email',
`created` datetime NOT NULL COMMENT 'Create Date',
`firstname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Given Name',
`lastname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Surname',
`usertype` int UNSIGNED NOT NULL COMMENT 'Type permissions',
`timezone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'ISO Timezone'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `lsio_users` (`id`, `username`, `password`, `email`, `created`, `firstname`, `lastname`, `usertype`, `timezone`) VALUES
(1, 'admin', '$2a$08$Y6l2CUoQgTQfQErQPEYZEuoZqDxkpAU34CoTTr7bc2oefzclUILJy', 'admin@domain.com', '2015-02-18 19:50:31', 'System', 'Administrator', 1, ''),
@ -321,8 +318,8 @@ INSERT INTO `lsio_users` (`id`, `username`, `password`, `email`, `created`, `fir
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_users_sites`;
CREATE TABLE `lsio_users_sites` (
`sites_id` int(10) UNSIGNED NOT NULL COMMENT 'SITE ID',
`users_id` int(10) UNSIGNED NOT NULL COMMENT 'USER ID'
`sites_id` int UNSIGNED NOT NULL COMMENT 'Site ID Link',
`users_id` int UNSIGNED NOT NULL COMMENT 'User ID Link'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci COMMENT='PERMISSIONS LINK TABLE';
INSERT INTO `lsio_users_sites` (`sites_id`, `users_id`) VALUES
(1, 1),
@ -334,8 +331,8 @@ INSERT INTO `lsio_users_sites` (`sites_id`, `users_id`) VALUES
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_usertypes`;
CREATE TABLE `lsio_usertypes` (
`id` int(10) UNSIGNED NOT NULL COMMENT 'UNIQUE ID',
`name` char(8) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'LANG FILE CODE'
`id` int UNSIGNED NOT NULL COMMENT 'Unique ID',
`name` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'User type name'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `lsio_usertypes` (`id`, `name`) VALUES
(1, 'ADMIN'),
@ -345,32 +342,32 @@ INSERT INTO `lsio_usertypes` (`id`, `name`) VALUES
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_visits`;
CREATE TABLE `lsio_visits` (
`id` int(10) UNSIGNED NOT NULL,
`firstname` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`lastname` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`company` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL,
`escort` varchar(50) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`intime` datetime NOT NULL,
`outtime` datetime DEFAULT NULL,
`signature` mediumblob,
`escort_signature` mediumblob,
`citizen` varchar(3) UNSIGNED DEFAULT NULL,
`id_type` int(10) UNSIGNED DEFAULT NULL,
`id_reference` varchar(30) UNSIGNED DEFAULT NULL,
`initials` varchar(5) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`badge` varchar(15) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`notes` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`site_id` int(10) UNSIGNED DEFAULT NULL,
`reason` int(10) UNSIGNED DEFAULT NULL,
`approved` tinyint(4) DEFAULT '1' COMMENT '0 void, 1 unapproved, 2 approved',
`carnum` varchar(20) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
`ssanum` varchar(20) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL
`id` int UNSIGNED NOT NULL COMMENT 'Unique ID',
`firstname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Given Name',
`lastname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Surname',
`company` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Company',
`escort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Escort Name',
`intime` datetime NOT NULL COMMENT 'Time In',
`outtime` datetime DEFAULT NULL COMMENT 'Time Out',
`signature` mediumblob COMMENT 'Signature Image',
`escort_signature` mediumblob COMMENT 'Escort Image',
`citizen` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Citizen ID',
`id_type` int UNSIGNED DEFAULT NULL COMMENT 'Type ID',
`id_reference` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'TIcket ID',
`initials` int DEFAULT NULL COMMENT 'Username of Receptionist',
`badge` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Badge Number',
`notes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Notes and Comments',
`site_id` int UNSIGNED DEFAULT NULL COMMENT 'Site ID Link',
`reason` int UNSIGNED DEFAULT NULL COMMENT 'Reason Code',
`approved` tinyint DEFAULT '1' COMMENT '0 void, 1 unapproved, 2 approved',
`carnum` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Tag Number',
`ssanum` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'Ticket Number'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
-- --------------------------------------------------------
DROP TABLE IF EXISTS `lsio_visittypes`;
CREATE TABLE `lsio_visittypes` (
`id` int(10) UNSIGNED NOT NULL COMMENT 'UNIQUE ID',
`name` char(8) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'LANG FILE CODE'
`id` int UNSIGNED NOT NULL COMMENT 'Unique ID',
`name` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT 'Visit Type Name'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
INSERT INTO `lsio_visittypes` (`id`, `name`) VALUES
(2, 'ADDEQPT'),
@ -384,6 +381,10 @@ INSERT INTO `lsio_visittypes` (`id`, `name`) VALUES
(6, 'TESTING'),
(5, 'TOUR');
-- --------------------------------------------------------
ALTER TABLE `lsio_countries`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id` (`id`),
ADD UNIQUE KEY `name` (`name`);
ALTER TABLE `lsio_idtypes`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id` (`id`),
@ -392,10 +393,6 @@ ALTER TABLE `lsio_sites`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id` (`id`),
ADD UNIQUE KEY `name` (`name`);
ALTER TABLE `lsio_countries`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id` (`id`),
ADD UNIQUE KEY `name` (`name`);
ALTER TABLE `lsio_users`
ADD PRIMARY KEY (`id`),
ADD KEY `users_ibfk_1` (`usertype`);
@ -410,7 +407,7 @@ ALTER TABLE `lsio_visits`
ADD PRIMARY KEY (`id`),
ADD KEY `site_id` (`site_id`),
ADD KEY `reason` (`reason`),
ADD KEY `id_reference` (`id_reference`),
ADD KEY `id_checked` (`id_reference`),
ADD KEY `citizen` (`citizen`),
ADD KEY `id_type` (`id_type`);
ALTER TABLE `lsio_visittypes`
@ -419,17 +416,17 @@ ALTER TABLE `lsio_visittypes`
ADD UNIQUE KEY `name` (`name`);
-- --------------------------------------------------------
ALTER TABLE `lsio_idtypes`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'UNIQUE ID', AUTO_INCREMENT=100;
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=100;
ALTER TABLE `lsio_sites`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'UNIQUE ID', AUTO_INCREMENT=100;
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=107;
ALTER TABLE `lsio_users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100;
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=104;
ALTER TABLE `lsio_usertypes`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'UNIQUE ID', AUTO_INCREMENT=100;
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=100;
ALTER TABLE `lsio_visits`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=100;
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=401;
ALTER TABLE `lsio_visittypes`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'UNIQUE ID', AUTO_INCREMENT=11;
MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Unique ID', AUTO_INCREMENT=11;
-- --------------------------------------------------------
ALTER TABLE `lsio_users`
ADD CONSTRAINT `lsio_users_ibfk_1` FOREIGN KEY (`usertype`) REFERENCES `lsio_usertypes` (`id`);
@ -440,3 +437,4 @@ ALTER TABLE `lsio_visits`
ADD CONSTRAINT `lsio_visits_ibfk_1` FOREIGN KEY (`id_type`) REFERENCES `lsio_idtypes` (`id`),
ADD CONSTRAINT `lsio_visits_ibfk_2` FOREIGN KEY (`reason`) REFERENCES `lsio_visittypes` (`id`),
ADD CONSTRAINT `lsio_visits_ibfk_3` FOREIGN KEY (`site_id`) REFERENCES `lsio_sites` (`id`);
COMMIT;

View File

@ -33,5 +33,3 @@ spl_autoload_register( function( $class ) {
});
//simplesaml
//require_once('../simplesamlphp/lib/_autoload.php');

View File

@ -23,11 +23,40 @@
//session_save_path('.tmp'); // TEMP
//session_start(); // START
require_once __DIR__ . '/../autoload.php'; // AUTOLOAD
use App\LobbySIO\Config\Registry;
$Users = new \App\LobbySIO\Database\Users();
if (Registry::AUTHMETHOD == 'SAML') {
//simplesaml
require_once('../simplesamlphp/lib/_autoload.php');
$auth = new \SimpleSAML\Auth\Simple(Registry::AUTHIDP);
//$auth->requireAuth();
$auth->isAuthenticated();
if (!$auth->isAuthenticated()) {
$attributes = 'none';
} else {
$attributes = $auth->getAttributes();
$saml_user_email = $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0];
$saml_user_info = $Users->getUserInfoByEmail($saml_user_email, "1", "0");
$saml_user_id = $saml_user_info["0"]["users_id"];
}
$session = \SimpleSAML\Session::getSessionFromRequest();
$session->cleanup();
}
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
$Users = new \App\LobbySIO\Database\Users();
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
} elseif (!isset($_SESSION['user_id'])) {
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
$session_user = $Users->getUserInfo($sessuserid, "1", "0"); }
if (isset($session_user)) { // GET UID OR SET TO KIOSK
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
@ -42,7 +71,7 @@
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang); // SETUP TRANSLATOR
$transLang = $Translate->userLanguage();
ob_start(); // OUTPUT BUFFER
$session_status = $StaticFunctions->getSessionStatus(); // SET A STATUS
$session_status = $StaticFunctions->getUserSessionStatus(); // SET A STATUS
$defaulttimezone = $StaticFunctions->getDefaultTZ();
date_default_timezone_set('UTC'); // DEFAULT TO UTC
date_default_timezone_set($defaulttimezone); // UPDATE TO DEFAULT APP SETTING
@ -51,10 +80,7 @@
$timeplus->setTimezone(new DateTimeZone("$timezone"));
$timenow = $timeplus->format('Y-m-d H:i:s');
//simplesaml
//$as = new \SimpleSAML\Auth\Simple('default-sp');
//$as->requireAuth();
//$attributes = $as->getAttributes();
?>
<!doctype html>
<html lang="<?php echo $app_disp_lang; ?>">
@ -137,7 +163,11 @@
</ul>
<ul class="navbar-nav mr-sm-2">
<li class="nav-item"><a class="nav-link<?php $sname=$SiteInfo->getSite($siteid, "0", "0", "0")[0]["sites_name"]; if($sname=="NOSITE") { echo " btn btn-sm btn-outline-warning"; } else { echo " btn btn-sm btn-outline-secondary"; }; ?>" href="#" data-toggle="modal" data-target="#sitetimeModal"><i class="fas fa-map-marker-alt"></i> <?php if ($sname=="NOSITE") {echo $transLang['NOSITE'];} else { echo $sname; } ?></a></li>
<?php if (Registry::AUTHMETHOD == 'SAML') { ?>
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-danger" href="https://lobbysio.point808.com/simplesaml/module.php/core/as_logout.php?AuthId=default-sp&ReturnTo=https%3A%2F%2Flobbysio.point808.com%2F"><span class="badge badge-light"><?php echo $session_user["0"]["users_username"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
<?php } else { ?>
<li class="nav-item<?php if ($app_current_pagename==$transLang['LOGOUT']): echo " active"; endif; ?>"><a class="nav-link btn btn-sm btn-outline-danger" href="logout.php"><span class="badge badge-light"><?php echo $session_user["0"]["users_username"];?></span> <i class="fas fa-ban"></i> <?php echo $transLang['LOGOUT']; ?></a></li>
<?php } ?>
<?php endif; ?>
<form action="changelang.php" method="post" name="changelang" class="changelang">
<div class="input-group mb-3">

View File

@ -23,11 +23,40 @@
session_save_path('.tmp'); // TEMP
session_start(); // START
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
use App\LobbySIO\Config\Registry;
$Users = new \App\LobbySIO\Database\Users();
if (Registry::AUTHMETHOD == 'SAML') {
//simplesaml
require_once('../simplesamlphp/lib/_autoload.php');
$auth = new \SimpleSAML\Auth\Simple(Registry::AUTHIDP);
//$auth->requireAuth();
$auth->isAuthenticated();
if (!$auth->isAuthenticated()) {
$attributes = 'none';
} else {
$attributes = $auth->getAttributes();
$saml_user_email = $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0];
$saml_user_info = $Users->getUserInfoByEmail($saml_user_email, "1", "0");
$saml_user_id = $saml_user_info["0"]["users_id"];
}
$session = \SimpleSAML\Session::getSessionFromRequest();
$session->cleanup();
}
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
$Users = new \App\LobbySIO\Database\Users();
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
} elseif (!isset($_SESSION['user_id'])) {
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
$session_user = $Users->getUserInfo($sessuserid, "1", "0"); }
if (isset($session_user)) { // GET UID OR SET TO KIOSK
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
@ -48,7 +77,7 @@
$app_current_pagename = $transLang['HOME']; // PAGE SETUP
$app_current_pageicon = '<i class="fas fa-home"></i> ';
require_once("inc/header.inc.php");
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
?>
<!-- GUEST CONTENT START -->
@ -92,8 +121,8 @@
} else {
?>
<!-- USER CONTENT START -->
<?php
$post_outtime = filter_input(INPUT_POST, 'outtime');
if (!empty($_POST['endvisit'])) {
if (!empty($_POST['outtime'])) {
$newdate = new DateTime($_POST['outtime'], new DateTimeZone($timezone));

View File

@ -23,11 +23,40 @@
session_save_path('.tmp'); // TEMP
session_start(); // START
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
use App\LobbySIO\Config\Registry;
$Users = new \App\LobbySIO\Database\Users();
if (Registry::AUTHMETHOD == 'SAML') {
//simplesaml
require_once('../simplesamlphp/lib/_autoload.php');
$auth = new \SimpleSAML\Auth\Simple(Registry::AUTHIDP);
//$auth->requireAuth();
$auth->isAuthenticated();
if (!$auth->isAuthenticated()) {
$attributes = 'none';
} else {
$attributes = $auth->getAttributes();
$saml_user_email = $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0];
$saml_user_info = $Users->getUserInfoByEmail($saml_user_email, "1", "0");
$saml_user_id = $saml_user_info["0"]["users_id"];
}
$session = \SimpleSAML\Session::getSessionFromRequest();
$session->cleanup();
}
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
$Users = new \App\LobbySIO\Database\Users();
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
} elseif (!isset($_SESSION['user_id'])) {
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
$session_user = $Users->getUserInfo($sessuserid, "1", "0"); }
if (isset($session_user)) { // GET UID OR SET TO KIOSK
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
@ -44,7 +73,7 @@
$app_current_pagename = $transLang['ACCOUNT']; // PAGE SETUP
$app_current_pageicon = '<i class="fas fa-user-circle"></i> ';
require_once("inc/header.inc.php");
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
echo $StaticFunctions->killSession(); // ELSE DIE
} else { ?>
<!-- CONTENT START -->
@ -90,12 +119,13 @@
</div>
<div class="form-group row">
<label for="firstname" class="col-sm-2 col-form-label"><?php echo $transLang['FIRSTNAME']; ?></label>
<div class="col-sm-2"><input class="form-control" type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" /></div>
<div class="col-sm-2"><input class="form-control" type="text" name="firstname" id="firstname" maxlength="50" value="<?php echo $session_user["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/></div>
<label for="lastname" class="col-sm-2 col-form-label"><?php echo $transLang['LASTNAME']; ?></label>
<div class="col-sm-2"><input class="form-control" type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" /></div>
<div class="col-sm-2"><input class="form-control" type="text" name="lastname" id="lastname" maxlength="50" value="<?php echo $session_user["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/></div>
<label for="email" class="col-sm-2 col-form-label"><?php echo $transLang['EMAIL']; ?></label>
<div class="col-sm-2"><input class="form-control" type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" /></div>
<div class="col-sm-2"><input class="form-control" type="text" name="email" id="email" maxlength="100" value="<?php echo $session_user["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } ?>/></div>
</div>
<?php if (Registry::AUTHMETHOD == 'INTERNAL') { ?>
<div class="form-group row">
<label for="password" class="col-sm-2 col-form-label"><?php echo $transLang['NEW'] . " " . $transLang['PASSWORD']; ?></label>
<div class="col-sm-2"><input class="form-control" type="password" name="password" id="password" /></div>
@ -103,6 +133,7 @@
<div class="col-sm-2"><input class="form-control" type="password" name="newpassword2" id="newpassword2" /></div>
<div class="col-sm-4"><button type="submit" name="saveprofile" id="saveprofile" class="form-control btn btn-block btn-primary"><?php echo $transLang['SAVE']; ?></button></div>
</div>
<?php } ?>
</fieldset>
</form>
</div>

View File

@ -23,11 +23,40 @@
session_save_path('.tmp'); // TEMP
session_start(); // START
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
use App\LobbySIO\Config\Registry;
$Users = new \App\LobbySIO\Database\Users();
if (Registry::AUTHMETHOD == 'SAML') {
//simplesaml
require_once('../simplesamlphp/lib/_autoload.php');
$auth = new \SimpleSAML\Auth\Simple(Registry::AUTHIDP);
//$auth->requireAuth();
$auth->isAuthenticated();
if (!$auth->isAuthenticated()) {
$attributes = 'none';
} else {
$attributes = $auth->getAttributes();
$saml_user_email = $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0];
$saml_user_info = $Users->getUserInfoByEmail($saml_user_email, "1", "0");
$saml_user_id = $saml_user_info["0"]["users_id"];
}
$session = \SimpleSAML\Session::getSessionFromRequest();
$session->cleanup();
}
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
$Users = new \App\LobbySIO\Database\Users();
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
} elseif (!isset($_SESSION['user_id'])) {
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
$session_user = $Users->getUserInfo($sessuserid, "1", "0"); }
if (isset($session_user)) { // GET UID OR SET TO KIOSK
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
@ -47,7 +76,7 @@
$app_current_pagename = $transLang['REPORTS']; // PAGE SETUP
$app_current_pageicon = '<i class="fas fa-chart-pie"></i> ';
require_once("inc/header.inc.php");
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
echo $StaticFunctions->killSession(); // ELSE DIE
} else { ?>
<!-- CONTENT START -->

View File

@ -39,5 +39,7 @@ class Registry { const
DEFAULTLANGUAGE = 'en', // Default language - make sure a translation file exists
ROWSPERPAGE = '10', // Rows per page on tables (does not include reports)
MINPASS = '8', // Minimum password length
DEFAULTTZ = 'America/New_York' // DEFAULT TIME ZONE
DEFAULTTZ = 'America/New_York', // DEFAULT TIME ZONE
AUTHMETHOD = 'INTERNAL', // Auth users using INTERNAL or SAML
AUTHIDP = 'default-sp' // Identity Provider if using SAML
;}

View File

@ -26,6 +26,30 @@ use App\LobbySIO\Config\Registry;
* @author josh.north
*/
class Users {
// Get user info as array by user id. Pass % for all.
public function getUserInfoByEmail($useremail, $rowsperpage, $offset) {
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
$query = "
SELECT
" . Registry::DB_PRFX . "users.id as users_id,
" . Registry::DB_PRFX . "users.username as users_username,
" . Registry::DB_PRFX . "users.email as users_email,
" . Registry::DB_PRFX . "users.created as users_created,
" . Registry::DB_PRFX . "users.firstname as users_firstname,
" . Registry::DB_PRFX . "users.lastname as users_lastname,
" . Registry::DB_PRFX . "users.usertype as users_usertypeid,
" . Registry::DB_PRFX . "usertypes.name as users_usertype,
" . Registry::DB_PRFX . "users.password as users_password
FROM " . Registry::DB_PRFX . "users
INNER JOIN " . Registry::DB_PRFX . "usertypes ON " . Registry::DB_PRFX . "users.usertype = " . Registry::DB_PRFX . "usertypes.id
WHERE " . Registry::DB_PRFX . "users.email LIKE \"$useremail\"
ORDER BY " . Registry::DB_PRFX . "users.lastname ASC" . $cond_rowsperpage . $cond_offset;
$database = new \App\LobbySIO\Database\Connect();
$rows = $database->getQuery($query);
return $rows;
}
// Get user info as array by user id. Pass % for all.
public function getUserInfo($userid, $rowsperpage, $offset) {
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };

View File

@ -19,6 +19,7 @@
namespace App\LobbySIO\Misc;
use App\LobbySIO\Config\Registry;
use SimpleSAML\Auth\Simple;
/**
* Miscellaneous junk probably not even deserving of a class but whatever
@ -94,12 +95,28 @@ class StaticFunctions {
}
public function getSessionStatus () {
if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . $_SERVER['HTTP_USER_AGENT'])) {
if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . filter_input(INPUT_SERVER, 'HTTP_USER_AGENT'))) {
return false;
} else {
return true;
}
}
public function getUserSessionStatus () {
if (Registry::AUTHMETHOD === "INTERNAL") {
if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . filter_input(INPUT_SERVER, 'HTTP_USER_AGENT'))) {
return false;
} else {
return true;
}
} elseif (Registry::AUTHMETHOD === "SAML") {
$auth = new \SimpleSAML\Auth\Simple(Registry::AUTHIDP);
if (!$auth->isAuthenticated()) {
return false;
} else {
return true;
}
}
}
}
}

View File

@ -23,11 +23,40 @@
session_save_path('.tmp'); // TEMP
session_start(); // START
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
use App\LobbySIO\Config\Registry;
$Users = new \App\LobbySIO\Database\Users();
if (Registry::AUTHMETHOD == 'SAML') {
//simplesaml
require_once('../simplesamlphp/lib/_autoload.php');
$auth = new \SimpleSAML\Auth\Simple(Registry::AUTHIDP);
//$auth->requireAuth();
$auth->isAuthenticated();
if (!$auth->isAuthenticated()) {
$attributes = 'none';
} else {
$attributes = $auth->getAttributes();
$saml_user_email = $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0];
$saml_user_info = $Users->getUserInfoByEmail($saml_user_email, "1", "0");
$saml_user_id = $saml_user_info["0"]["users_id"];
}
$session = \SimpleSAML\Session::getSessionFromRequest();
$session->cleanup();
}
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
$Users = new \App\LobbySIO\Database\Users();
if (isset($_SESSION['user_id'])) { // LOGGED IN? GET USER OBJECT
$session_user = $Users->getUserInfo($_SESSION['user_id'], "1", "0"); }
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
} elseif (!isset($_SESSION['user_id'])) {
if (isset($saml_user_id)) {
$sessuserid=$saml_user_id;
} else {
$sessuserid=$_SESSION['user_id'];
}
$session_user = $Users->getUserInfo($sessuserid, "1", "0"); }
if (isset($session_user)) { // GET UID OR SET TO KIOSK
$uid = $session_user["0"]["users_id"];} else { $uid = "2"; }
$app_disp_lang = filter_input(INPUT_COOKIE, 'app_disp_lang'); // SETUP LANGUAGE
@ -44,7 +73,7 @@
$app_current_pagename = $transLang['ADMINISTRATION']; // PAGE SETUP
$app_current_pageicon = '<i class="fas fa-list"></i> ';
require_once("inc/header.inc.php");
if ($StaticFunctions->getSessionStatus() == false) { // CHECK STATUS
if ($StaticFunctions->getUserSessionStatus() == false) { // CHECK STATUS
echo $StaticFunctions->killSession(); // ELSE DIE
} else { ?>
<!-- CONTENT START -->
@ -72,13 +101,13 @@
<div class="input-group-prepend">
<span class="input-group-text" id="firstname"><?php echo $transLang['FIRSTNAME']; ?></span>
</div>
<input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo $edituser["0"]["users_firstname"]; ?>" required />
<input type="text" class="form-control" id="firstname" name="firstname" value="<?php echo $edituser["0"]["users_firstname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
<div class="col input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="lastname"><?php echo $transLang['LASTNAME']; ?></span>
</div>
<input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo $edituser["0"]["users_lastname"]; ?>" required />
<input type="text" class="form-control" id="lastname" name="lastname" value="<?php echo $edituser["0"]["users_lastname"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
<div class="form-row">
@ -86,13 +115,13 @@
<div class="input-group-prepend">
<span class="input-group-text" id="username"><?php echo $transLang['USERNAME']; ?></span>
</div>
<input type="text" class="form-control" id="username" name="username" value="<?php echo $edituser["0"]["users_username"]; ?>" required />
<input type="text" class="form-control" id="username" name="username" value="<?php echo $edituser["0"]["users_username"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
<div class="col input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="email"><?php echo $transLang['EMAIL']; ?></span>
</div>
<input type="text" class="form-control" id="email" name="email" value="<?php echo $edituser["0"]["users_email"]; ?>" />
<input type="text" class="form-control" id="email" name="email" value="<?php echo $edituser["0"]["users_email"]; ?>" <?php if (Registry::AUTHMETHOD == 'SAML') { echo "readonly "; } else { echo "required "; } ?>/>
</div>
</div>
<div class="form-row">