Skip to content
Snippets Groups Projects
UseCase.rst 15.98 KiB

Use Case

To install the following use cases, please:

  • Create the page and tt-content records.
  • Copy the JSON form code to a new empty form (open Form in JSON mode).

Self Registration

Concept:

  • The T3 FE User record will be created on the fly in the last step, when the user set's the password.
  • Form Registration
    • Input: last name, first name, email.
    • Create record in table Person, if no name or email sibling is found. Else give a hint to do a password reset.
    • Set a new Person.auth token.
    • Set Person.authExpired = NOW() + INTERVAL 1 DAY.
    • Send an email to the given email address with a password reset link (incl. the token) which is time limited.
    • Further steps: See Set password.
  • Form Request password reset link
    • This is optional, but useful to offer the opportunity to reset the own password.
    • Input: email address.
    • Send an email to the given email address with a password reset link (incl. a token) which is time limited.
      • Only send email if the email address is known!
      • If email is not found, the user should not be noticed. This prohibits misusing the form to validate email adresses.
      • Set a new Person.auth token.
      • Set Person.authExpired = NOW() + INTERVAL 1 DAY.
  • Form Set password
    • The user types in the new password.
    • On save:
      • If the FE account does not exist, it will be created.
      • Set the FE user password.
      • Clear Person.authExpired.

Table: Person

CREATE TABLE `Person` (
  `id` int(11) UNSIGNED NOT NULL,
  `lastName` varchar(64) NOT NULL DEFAULT '',
  `firstName` varchar(64) NOT NULL DEFAULT '',
  `email` varchar(128) NOT NULL,
  `account` varchar(128) NOT NULL,
  `auth`  varchar(32) NOT NULL DEFAULT '',
  `authExpire` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 PACK_KEYS=1;

ALTER TABLE `Person` ADD PRIMARY KEY (`id`);
ALTER TABLE `Person` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

or:

ALTER TABLE `Person` ADD `auth` VARCHAR(32) NOT NULL DEFAULT '' AFTER `account`, ADD `authExpire` DATETIME DEFAULT NULL AFTER `auth`;

Registration

Page: Registration

  • Page Alias: registration

QFQ content record:

#
# {{action:SE}}: thanksRegistration
#


form={{SELECT IF('{{action:SE}}' = '','registration','') }}

20.sql = SELECT "<p>Thank you for your registration.</p><p>An email with further instructions has been sent to you.</p>"
                , "<p>You should receive the mail during the next 5 minutes. If not, please check your JUNK folder.</p>"

            FROM (SELECT '') AS fake
            WHERE '{{action:SE}}' = 'thanksRegistration'
              AND '{{form:SE}}'=''