| 1 |
New Location Warning Plugin |
| 2 |
=========================== |
| 3 |
|
| 4 |
Presentation |
| 5 |
------------ |
| 6 |
|
| 7 |
This plugin allows LL::NG to send a warning message to the user's email |
| 8 |
address when their account connects from a new location. |
| 9 |
|
| 10 |
By default, the location is the IP address. Meaning that any connection from a |
| 11 |
different IP address will send a warning. If this is not what you want, you can |
| 12 |
change the way location is computed (see below). |
| 13 |
|
| 14 |
Following steps are performed when the user logs in |
| 15 |
|
| 16 |
#. Extract the location from session info (by default, the IP address is used) |
| 17 |
#. Compare the current location to the previous locations saved in history |
| 18 |
#. If it is a new location, send an email to warn the user |
| 19 |
#. On the next login, the location will no longer be considered as new |
| 20 |
|
| 21 |
The very first time a user logs in (empty login history), no email is sent. |
| 22 |
|
| 23 |
Configuration |
| 24 |
------------- |
| 25 |
|
| 26 |
Just enable it in the Manager (section ``General Parameters`` > ``Advanced parameters`` > ``Security`` > ``New location warning``: |
| 27 |
|
| 28 |
- **Activation**: Enable this plugin *(default: disabled)* |
| 29 |
- **Session attribute containing location**: Indicate the session attribute you are using to store the location. You can use `ipAddr`, or a custom macro. |
| 30 |
- **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. |
| 31 |
- **Maximum number of locations to consider**: By default, all previous value of the location are checked |
| 32 |
- **Session mail attribute**: Session key containing mail address *(default: mail)* |
| 33 |
- **Warning mail subject**: Subject of the email containing the warning |
| 34 |
- **Warning mail content**: Content of the email containing the warning |
| 35 |
|
| 36 |
.. warning:: |
| 37 |
If you use a macro instead of ``ipAddr`` as the location value, be sure to add the name of this macro to |
| 38 |
|
| 39 |
General Parameters » Plugins » Login History » Session data to store |
| 40 |
|
| 41 |
Otherwise, the value of the macro will not be remembered across logins |
| 42 |
|
| 43 |
Email body variables |
| 44 |
~~~~~~~~~~~~~~~~~~~~ |
| 45 |
|
| 46 |
Following variables are available in the Warning email body: |
| 47 |
|
| 48 |
* ``$location``: the location value, from **Session attribute to display** |
| 49 |
* ``$date``: the date of login |
| 50 |
* ``$ua``: the full user agent string |
| 51 |
|
| 52 |
.. |image0| image:: /documentation/beta.png |
| 53 |
:width: 100px |