Ext: sg_account

License: GNU GPL, Version 2

Repository: https://gitlab.sgalinski.de/typo3/sg_account

Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_account

TYPO3 version: >=9.5

About

This extension provides various frontend user functionalities for a TYPO3 installation.

Features:

  • Frontend User registration
  • Double Opt-in registration
  • Frontend User account overview
  • Frontend User profile editing
  • Avatar image upload
  • Gravatar integration
  • Frontend avatar image crop
  • Multiple email addresses with double opt-in validation
  • Frontend user login (with any email address saved for each user)
  • Facebook account login
  • Google account login
  • Auto login after Registration
  • Password recovery
  • Password policy options (available in the extension configuration)
  • Random password generation with respect to the defined policies (for FE and BE users)
  • FE 'Login As' feature for BE admin or editor
  • Backend Module for FE user management
  • Model Extensibility (with custom extension)

Integration

  • The TypoScript configuration ("SgAccount - Configuration") has to be included into your TypoScript template.

  • Add a new configuration for each site root with the FrontendUser backend module and adapt all settings of it. All the options are explained after the creation of the new configuration

  • Now you should create a new cron job within the scheduler backend module. This will check the consistence of the user data and prevent errors.

    • Class: Extbase CommandController Task
    • Type: Recurring
    • Frequency: Once a day
    • CommandController Command: SgConsistence CheckConsistence: checkConsistenceForDomainModel
  • After saving, you need to add arguments to the cron job. They will appear in the bottom.

    • domainNamespace: SGalinski\SgAccount\Domain\
    • domainModel: FrontendUser

Backend Module

The Backend module is found in the WEB section under the name Frontend Users

You can create a new frontend user by clicking on the New Website User button.

Edit
Disable/Enable
Delete
Show further information
Show history
Create a new user on this page
.... Expand/Collapse the options menu
Login with this user

Automated Email Messages

The extension uses sg_mail to configure email templates for the following email messages:

register_admin - sent to the specified Administrator address(es) after a new user registration.
register_user - sent to the registered user's address after registration or after email confirmation
                if 'enableEmailConfirmation' is set.
confirm_user - sent to the registered user's address after registration if 'enableEmailConfirmation' is set.
               It contains the email confirmation link.
confirm_email - sent if 'enableEmailConfirmation' is set, to an unconfirmed email address after a login atempt or
                if the user edits his email addresses. It contains the email confirmation link.
notify_admin - sent to the Administrator if a user record is pending removal for inactivity.
notify_user - sent to a user if his/her account is pending removal for inactivity.
deactivate_admin - sent to the Administrator if a user record was removed for inactivity.
deactivate_user - sent to a user if his/her account was removed for inactivity.

For more information about registering and configuring email templates please refer to the sg_mail documentation.

Rendering a profile image

sg_account comes with a viewhelper, that enables you to display a frontend users profile image inside a fluid template.

It takes the following arguments:

  • userUid: the uid of the user
  • width: the width of the image
  • height: the height of the image
  • defaultImageUri: path to a fallback/default image if no user profile image is set

Example usage:

{namespace sgAccount=SGalinski\sgAccount\ViewHelpers}
<sgAccount:getProfileImage userUid="100" width="20" height="20" />

Redirect to a page after login

If you set a link to a protected page, the user will be redirected to the login form if not currently logged in. By providing a URL via the redirect parameter, you can control the page the user will be redirected to after a successful login. It might be possible to adjust the redirect priority in order for the query parameter to work!

See the following examples where you want to redirect to `https://foobar.com/protected```.

From a link

Link to the login page with the escaped redirect URL as a querystring param.

Hint: if you generate the link via JavaScript, use the decodeURIComponent() function to escape the URL in the query string.

<a href="https://foobar.com/login?redirect=https%3A//foobar.com/protected">Login</a>

From inside the login form

See the following examples where you want to redirect to `https://foobar.com/protected```.

From a link

Link to the login page with the escaped redirect URL as a querystring param.

Hint: if you generate the link via JavaScript, use the decodeURIComponent() function to escape the URL in the query string.

<a href="https://foobar.com/login?redirect=https%3A//foobar.com/protected">Login</a>

From inside the login form

Include the following hidden input (or set the value if it's already included).

Note that the value has to contain the pathname and not the full URI.

<input type="hidden" name="redirect" value="/protected">

Editorial documentation for the sg_account extension

We have created a documentation for our sg_account TYPO3 extension that can be used by editors in their daily work with the backend module and the account plugins.