# Configure Terms of Use

If you want to change or extend the default settings of the Terms of Use, e.g. to make it mandatory for users to accept the Terms of Use before they can log in, you can customize the 4App's file init.json. The default settings look like this:

{
  "files": [
    "4allportal-agb/cmweb-agb.js"
  ],
  "environment": {
    "4allportal-agb.login_agb.check_agb_on_login": false,
    "4allportal-agb.login_agb.show_agb_link": true,
    "4allportal-agb.login_agb.info_links": [],
    "4allportal-agb.agb_as_iframe": false,
    "4allportal-agb.agb_iframe_url": "./termsOfUse.{$language}.html",
    "4allportal-agb.info_popups": {}
  }
}
  1. Create the following path in your custom folder: \application\html.
  2. In it, create file init.json.
  3. Here you need to list all environment variables you want to change.

Changing the init.json

A custom init.json merges automatically with the default init.json:

  • Boolean values will overwrite the defaults.
  • Arrays (square brackets) will be added to the default. They can not overwrite each other.

# Check Terms of Use on Login

By default, the Terms of Use are not mandatory for users to accept, but are provided for their information only. If you want users to accept your Terms of Use before being able to log in to the 4ALLPORTAL, you can set variable "4allportal-agb.login_agb.check_agb_on_login" to "true":

{
  "environment": {
    "4allportal-agb.login_agb.check_agb_on_login": true
  }
}

Please note: This also applies to eTicket users.

# Database Field agb_confirmed

This 4App adds a new database field agb_confirmed (type: boolean) for module "User". If you have configured your Terms of Use to be accepted before first login, this database field will be filled for each user. If a user has not yet accepted the Terms of Use, they need to accept them before they can log in.

Please note: This field is not displayed in the GUI by default. If required, you can add it e.g. to the metadata renderer of module "User" via an object renderer change. Admins could then manually reset a user's acceptance if they updated the Terms of Use.

Example:

<changes extend="default">
 <change xpath="//field_renderer_list" type="add">
	<field_renderer>
          <type>OnOff</type>
          <label>L-USER-AGB_CONFIRMED</label>
          <field>
            <name>agb_confirmed</name>
          </field>
    </field_renderer>
  </change>
</changes>

Result in the GUI:

By default, the link "Terms of Use" is displayed on the login screen. You can disable it, if you require the Terms of Use only in a user's profile, for example:

{
  "environment": {
    "4allportal-agb.login_agb.show_agb_link": false
  }
}

By default, only link "Terms of Use" is displayed on the login screen. You can add more links with information, if required. For example, an imprint, information about how to use the 4ALLPORTAL, or requirements for self registrations.
For each link, make sure to also add variable "4allportal-agb.info_popups" with the required labels to the init.json (more details).

{
  "environment": {
    "4allportal-agb.login_agb.info_links": [
  "imprint"
  ],
    "4allportal-agb.info_popups": {
      "imprint": {
        "linkLabel": "L-MY-COMPANY-IMPRINT_LINK",
        "titleLabel": "L-COMPANY-IMPRINT_POPUP-TITLE",
        "iframeUrl": "./imprint.{$language}.html"
      }
    }
  }
}

# Terms of Use in an iframe

By default, the content that opens in a pop-up after clicking "Terms of Use" is a label key translation stored in a properties file (more details). If you want to display HTML contents here, you need to allow the Terms of Use as an iframe and give the corresponding URL or relative URL:

{
  "environment": {
    "4allportal-agb.agb_as_iframe": true,
    "4allportal-agb.agb_iframe_url": "./example.html"
  }
}

Security Settings

If you work with iframes, make sure to configure your CSP settings accordingly in admin snap-in General system configurations/System settings/Security, field "Content Security Policy" (security configuration documentation (opens new window)).

# Info Pop-ups

The variable "4allportal-agb.info_popups" is needed to define the labels of the custom links added via "4allportal-agb.login_agb.info_links". For each custom link you need to add two label keys (the link itself and the title of the popup window) as well as the target URL:

{
"environment": {
  "4allportal-agb.info_popups": {
    "imprint": {
      "linkLabel": "L-MY-COMPANY-IMPRINT_LINK",
      "titleLabel": "L-COMPANY-IMPRINT_POPUP-TITLE",
      "iframeUrl": "./imprint.{$language}.html"
      }
    }
  }
}

Please note: All custom label keys you define here need to be translated, e.g. via admin snap-in General System configurations/System settings/Translation Studio.

# Example Configuration

This example init.json configures the following settings:

  • The Terms of Use are checked on login and (in case of a first login) have to be confirmed by the user.
  • The Terms of Use are displayed in an iframe (which then loads a language-specific HTML file to display instead of just the default label).
  • In addition to the Terms of Use link, the two custom links "Imprint" and "Another link" are displayed.
{
  "environment": {
    "4allportal-agb.login_agb.check_agb_on_login": true,
    "4allportal-agb.agb_as_iframe": true,
    "4allportal-agb.agb_iframe_url": "./termsOfUse.{$language}.html",
    "4allportal-agb.login_agb.info_links": [
      "imprint", "another"
    ],
    "4allportal-agb.info_popups": {
      "imprint": {
        "linkLabel": "L-MY-COMPANY-IMPRINT_LINK",
        "titleLabel": "L-COMPANY-IMPRINT_POPUP-TITLE",
        "iframeUrl": "./imprint.{$language}.html"
      },
      "another": {
        "linkLabel": "L-MY-COMPANY-ANOTHER_LINK",
        "titleLabel": "L-COMPANY-ANOTHER_POPUP-TITLE",
        "iframeUrl": "https://another-link.com/example.html"
      }  
    }
  }
}


result on the login screen, after click on "Imprint

Request missing documentation