X-Git-Url: https://git-public.kairo.at/?p=authserver.git;a=blobdiff_plain;f=authsystem.inc.php;h=62c6a80fd965c0f7369507cba2824b3ccaff3f28;hp=65c349e2c2427c86a0f8c05e72ba7bf876533f35;hb=d46a42f1c9fcf2191b42f9df10ae6dd876e6f10b;hpb=89975cb9153f7678a6ebec740a11daf260e6dc30;ds=sidebyside diff --git a/authsystem.inc.php b/authsystem.inc.php index 65c349e..62c6a80 100644 --- a/authsystem.inc.php +++ b/authsystem.inc.php @@ -1,4 +1,8 @@ 10); require_once('../kairo/include/cbsm/util/document.php-class'); // Class for sending emails require_once('../kairo/include/classes/email.php-class'); +// Class for sending emails +require_once(__DIR__.'/authutils.php-class'); bindtextdomain('kairo_auth', 'en'); // XXX: Should negotiate locale. bind_textdomain_codeset('kairo_auth', 'utf-8'); @@ -20,8 +26,26 @@ bind_textdomain_codeset('kairo_auth', 'utf-8'); $db = new PDO($dbdata['dsn'], $dbdata['username'], $dbdata['password']); /* Creating the DB tables: -CREATE TABLE `auth_sessions` ( `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT , `sesskey` VARCHAR(150) NOT NULL DEFAULT '' , `user` MEDIUMINT UNSIGNED NULL DEFAULT NULL , `logged_in` BOOLEAN NOT NULL DEFAULT FALSE , `time_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , `time_expire` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , PRIMARY KEY (`id`), INDEX (`sesskey`), INDEX (`time_expire`)); -CREATE TABLE `auth_users` ( `id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT , `email` VARCHAR(255) NOT NULL , `pwdhash` VARCHAR(255) NOT NULL , `status` ENUM('unverified','ok') NOT NULL DEFAULT 'unverified' , `verify_hash` VARCHAR(150) NULL DEFAULT NULL , PRIMARY KEY (`id`), UNIQUE (`email`)); +CREATE TABLE `auth_sessions` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT , + `sesskey` VARCHAR(150) NOT NULL DEFAULT '' , + `user` MEDIUMINT UNSIGNED NULL DEFAULT NULL , + `logged_in` BOOLEAN NOT NULL DEFAULT FALSE , + `time_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , + `time_expire` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , + PRIMARY KEY (`id`), + INDEX (`sesskey`), + INDEX (`time_expire`) +); +CREATE TABLE `auth_users` ( + `id` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT , + `email` VARCHAR(255) NOT NULL , + `pwdhash` VARCHAR(255) NOT NULL , + `status` ENUM('unverified','ok') NOT NULL DEFAULT 'unverified' , + `verify_hash` VARCHAR(150) NULL DEFAULT NULL , + PRIMARY KEY (`id`), + UNIQUE (`email`) +); */ // include our OAuth2 Server object