Download the PHP package fof/terms without Composer

On this page you can find all versions of the php package fof/terms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package terms

Terms by FriendsOfFlarum

MIT license Latest Stable Version Total Downloads

This extension allows you to define a list of terms the user must agree to before using the forum.

It was made with the new General Data Protection Regulation in mind but please consult with your legal team to see whether it fits your requirements.

Installation

Updating

Updating from Flagrow

This extension replaces Flagrow Terms.

To upgrade from the old extension to the new one:

Composer should let you know that flagrow/terms has been automatically removed.

Configuration

You can define a list of "policies" the users must agree to. A policy has a name and url.

You can define an "update message" that will be shown to users who have not yet agreed to the latest version of the policy or not agreed to the policy at all (this includes users registered before the policy extension was enabled).

You can define an "updated at" time that will ask all users who accepted prior to that date to accept again.

If users don't accept the terms, they can't register. Additionally, if they already have an account, they can login but their account is locked until they accept the latest version of the terms (similar to how the suspend extension blocks users).

You can customize who can skip the modal without accepting the new terms immediately via the permissions tab (by default admins only). You might want to give this permission to bot accounts for example as they will also be blocked from the API if there's a terms update.

Admins can see the date at which a user accepted the terms by going to their profile page and selecting the terms button in the dropdown menu. You can customize who can see those dates in the permissions.

For developers

You can easily add a custom field in PolicyEdit component to integrate fof/terms with other extensions. In fof-terms-policies, there is a column, additionalInfo dedicated to save your custom data into fof/terms database. Data is stored inside one, global JSON object, allowing multiple extensions to save their data.

You can save any value, as long as it is a primitive or a valid JSON object.

To add your field to additionalInfo, you must follow these steps: 1) Choose a custom key value, it is recommended to select Your extension's name to avoid naming conflicts. 2) Prepare a component, which You would want to insert into PolicyEdit 3) Extend PolicyEdit.prototype's fields method, and add Your component, wrapped inside ExtensionData component:

As shown above, ExtensionData component takes three props: 1) keyattr - specified key, usually Your extension's name, 2) policy - reference to policy object, 3) setDirty - reference to function that allows saving the policy, if any change is made

Your component should also take three props: 1) keyattr - same as in above 2) policy - same as above 3) updateAttribute - reference to ExtensionData's method that manages saving Your data into database ( it is a bit different than PolicyEdit's updateAttribute method )

Your component could look something like this:

This example shows a way to save data only as string format: key: <string>, however if You want to use data in a more sophisticated format, there are some rules that should be followed. Let's say You want to save a JSON object instead of simple string, in a such form: {"boolval": <boolean>, "stringval": <string>}.

Here is an example how to obtain such behaviour:

Note that oninput handler is a bit more complicated - in order to save some subvalue, you need to fetch the whole JSON object, assign its subvalue, and then call this.updateAttribute method.

As mentioned above, it is possible to store every value imaginable, as long as it is a primitive, or valid JSON object.

Data Export

In case you want to export the data (for your GDPR logs for example), a JSON and CSV export is available.

The link can be found in the Policy edit form of the admin panel.

If you want to automate the export, the available options are documented on the wiki.

Links

An extension by FriendsOfFlarum


All versions of terms with dependencies

PHP Build Version
Package Version
Requires flarum/core Version ^1.8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fof/terms contains the following files

Loading the files please wait ....