X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;f=authsystem.inc.php;h=2c98f6dd46ccf1d8f53a0ad023801b1b0c3ee841;hb=558e9862bdf09a65cb41c76569cdb3f4021fa356;hp=62c6a80fd965c0f7369507cba2824b3ccaff3f28;hpb=d46a42f1c9fcf2191b42f9df10ae6dd876e6f10b;p=authserver.git diff --git a/authsystem.inc.php b/authsystem.inc.php index 62c6a80..2c98f6d 100644 --- a/authsystem.inc.php +++ b/authsystem.inc.php @@ -9,8 +9,8 @@ ini_set('display_errors', 1); error_reporting(E_ALL); // Read DB settings $dbdata = json_decode(file_get_contents('/etc/kairo/auth_db.json'), true); if (!is_array($dbdata)) { trigger_error('DB configuration not found', E_USER_ERROR); } - -$pwd_options = array('cost' => 10); +$settings = json_decode(file_get_contents('/etc/kairo/auth_settings.json'), true); +if (!is_array($settings)) { trigger_error('Auth settings not found', E_USER_ERROR); } // Extended DOM document class require_once('../kairo/include/cbsm/util/document.php-class'); @@ -24,6 +24,8 @@ bind_textdomain_codeset('kairo_auth', 'utf-8'); // Connect to our MySQL DB $db = new PDO($dbdata['dsn'], $dbdata['username'], $dbdata['password']); +// Instantiate auth utils. +$utils = new AuthUtils($settings, $db); /* Creating the DB tables: CREATE TABLE `auth_sessions` ( @@ -46,6 +48,15 @@ CREATE TABLE `auth_users` ( PRIMARY KEY (`id`), UNIQUE (`email`) ); +CREATE TABLE `auth_log` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT , + `code` VARCHAR(100) NOT NULL , + `info` TEXT NULL DEFAULT NULL , + `ip_addr` VARCHAR(50) NULL DEFAULT NULL , + `time_logged` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , + PRIMARY KEY (`id`), + INDEX (`time_logged`) +); */ // include our OAuth2 Server object