Version 1 (modified by Robin Jones, 12 years ago)

Base Document including attempt at SQL

Main contributors: Robin Jones, last modified: 2008-09-26

My First Stab at a framework for Terms of service support:


-- New Table to store Terms Of service information

CREATE TABLE TermsOfService (
     TOS_id text NOT NULL,                        -- ID
     name text NOT NULL,                          -- Friendly Name Of Terms Of Service (seen in admin interface)
     url text,                                    -- URL of Terms Of Service
     Version integer DEFAULT 1,                   -- Version Number (will alert user if terms updated)

-- New Table to store weather the user has accepted the Terms Of service  
-- (supports the ability to goto different Nodes with different TOS)

CREATE TABLE TOS_Accepted_Users (
     user_id                                      -- User Id
     TOS_Accepted boolean DEFAULT false,          -- Gives the ability to manually reset Users TOS Status
     TOS_id text NOT NULL,                        -- the TOS that the user agreed to (there maybe many)
     Version integer NOT NULL,                    -- TOS Version Number (stored when user agreed to TOS)

ALTER TABLE networks ( 
     Default_TOS text,                            -- If set will default all new nodes to this TOS
     Node_can_change_TOS boolean DEFAULT true,    --If false will use above on all network nodes

ALTER TABLE nodes ( 
     TOS_id text,                                 -- If set users logging onto node will have to agree to set TOS

when the users login is processed, the the following SQL query will be performed

(needs work but i need to remember how i am going to acheive this) SELECT * FROM TOS_Accepted_Users WHERE user_id = CurrentUser? LIMIT BY 1