mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-09 16:09:15 +00:00
Overhauls discord verification system (#53289)
This completely replaces the previous verification system, for one that will interoperate with a discord redbot instance that uses the cogs located at you github.com/optimumtact/orangescogs This cuts out several steps in the system, but it also leaves alone the existing notify system (which just uses a file list of discord ids) as a record of who to notify SQL changes required for the new database system Version 5.10, 7 August 2020, by oranges Changes how the discord verification process works. Adds the discord_links table, and migrates discord id entries from player table to the discord links table in a once off operation and then removes the discord id on the player table The user connects to any tg server, and uses the "Verify Discord Account" verb, this generates a six word one time use token, with a 4 hour time validity period (defined as 4 hours from the timestamp value) in the discord links table. This one time token, and the ckey of the user are stored in discord_links At this point the entire DM side is done, this is all it does
This commit is contained in:
@@ -1,15 +1,42 @@
|
||||
Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255.
|
||||
|
||||
The latest database version is 5.9; The query to update the schema revision table is:
|
||||
The latest database version is 5.10; The query to update the schema revision table is:
|
||||
|
||||
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 9);
|
||||
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 10);
|
||||
or
|
||||
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 9);
|
||||
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 10);
|
||||
|
||||
In any query remember to add a prefix to the table names if you use one.
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.10, 7 August 2020, by oranges
|
||||
|
||||
Changes how the discord verification process works.
|
||||
Adds the discord_links table, and migrates discord id entries from player table to the discord links table in a once off operation and then removes the discord id
|
||||
on the player table
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
DROP TABLE IF EXISTS `discord_links`;
|
||||
CREATE TABLE `discord_links` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
`discord_id` BIGINT(20) DEFAULT NULL,
|
||||
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`one_time_token` VARCHAR(100) NOT NULL,
|
||||
`valid` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO `discord_links` (`ckey`, `discord_id`, `one_time_token`, `valid`) SELECT `ckey`, `discord_id`, CONCAT("presync_from_player_table_", `ckey`), TRUE FROM `player` WHERE discord_id IS NOT NULL;
|
||||
|
||||
ALTER TABLE `player` DROP COLUMN `discord_id`;
|
||||
|
||||
COMMIT;
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.9, 19 April 2020, by Jordie0608
|
||||
Updates and improvements to poll handling.
|
||||
Added the `deleted` column to tables 'poll_option', 'poll_textreply' and 'poll_vote' and the columns `created_datetime`, `subtitle`, `allow_revoting` and `deleted` to 'poll_question'.
|
||||
|
||||
@@ -322,7 +322,6 @@ CREATE TABLE `player` (
|
||||
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
|
||||
`accountjoindate` DATE DEFAULT NULL,
|
||||
`flags` smallint(5) unsigned DEFAULT '0' NOT NULL,
|
||||
`discord_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`ckey`),
|
||||
KEY `idx_player_cid_ckey` (`computerid`,`ckey`),
|
||||
KEY `idx_player_ip_ckey` (`ip`,`ckey`)
|
||||
@@ -574,6 +573,20 @@ END
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
--
|
||||
-- Table structure for table `discord_links`
|
||||
--
|
||||
DROP TABLE IF EXISTS `discord_links`;
|
||||
CREATE TABLE `discord_links` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
`discord_id` BIGINT(20) DEFAULT NULL,
|
||||
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`one_time_token` VARCHAR(100) NOT NULL,
|
||||
`valid` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
|
||||
@@ -322,7 +322,6 @@ CREATE TABLE `SS13_player` (
|
||||
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
|
||||
`accountjoindate` DATE DEFAULT NULL,
|
||||
`flags` smallint(5) unsigned DEFAULT '0' NOT NULL,
|
||||
`discord_id` BIGINT(20) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`ckey`),
|
||||
KEY `idx_player_cid_ckey` (`computerid`,`ckey`),
|
||||
KEY `idx_player_ip_ckey` (`ip`,`ckey`)
|
||||
@@ -574,6 +573,20 @@ END
|
||||
$$
|
||||
DELIMITER ;
|
||||
|
||||
--
|
||||
-- Table structure for table `discord_links`
|
||||
--
|
||||
DROP TABLE IF EXISTS `SS13_discord_links`;
|
||||
CREATE TABLE `SS13_discord_links` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
`discord_id` BIGINT(20) DEFAULT NULL,
|
||||
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`one_time_token` VARCHAR(100) NOT NULL,
|
||||
`valid` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
|
||||
Reference in New Issue
Block a user