Update doc for new locatio plugin (#2325)

This commit is contained in:
Maxime Besson 2021-09-06 16:16:23 +02:00
parent 3700295d92
commit ad67800b72

View File

@ -6,32 +6,50 @@ New Location Warning Plugin
Presentation
------------
This plugin allows LL::NG to send a warning message to the user's email
address when their account connects via a new IP address.
This plugin allows LL::NG to send a warning message to the user's email
address when their account connects from a new location.
Following steps are performed:
By default, the location is the IP address. Meaning that any connection from a
different IP address will send a warning. If this is not what you want, you can
change the way location is computed (see below).
#. User logs in from a new location
#. The IP address is compared to those in the connection history
#. If it's a new IP, a warning email is sent to the user's email address
Following steps are performed when the user logs in
#. Extract the location from session info (by default, the IP address is used)
#. Compare the current location to the previous locations saved in history
#. If it is a new location, send an email to warn the user
#. On the next login, the location will no longer be considered as new
The very first time a user logs in (empty login history), no email is sent.
Configuration
-------------
Just enable it in the Manager (section ``General Parameters`` > ``Advanced parameters`` > ``Security`` > ``New location warning``:
- **Activation**: Enable this plugin *(default: disabled)*
- **Session attribute containing location**: Indicate the session attribute you are using to store the location. You can use `ipAddr`, or a custom macro.
- **Session attribute to display**: By default, the raw value of the location session attribute is displayed in the warning email. If you want to use a different session attribute in the warning email, you can specify it here.
- **Maximum number of locations to consider**: By default, all previous value of the location are checked
- **Session mail attribute**: Session key containing mail address *(default: mail)*
- **Warning mail subject**: Subject of the email containing the warning
- **Warning mail content**: Content of the email containing the warning
.. note::
.. warning::
If you use a macro instead of ``ipAddr`` as the location value, be sure to add the name of this macro to
Following variables are available in:
General Parameters » Plugins » Login History » Session data to store
\* Warning email body => ``$newLocation``, ``$newLocationDate``, ``$newLocationUserAgent``
Otherwise, the value of the macro will not be remembered across logins
Email body variables
~~~~~~~~~~~~~~~~~~~~
Following variables are available in the Warning email body:
* ``$location``: the location value, from **Session attribute to display**
* ``$date``: the date of login
* ``$ua``: the full user agent string
.. |image0| image:: /documentation/beta.png
:width: 100px