The z4m_loginhistory module extends the ZnetDK 4 Mobile starter application by adding the following features:
- Stores in the application's MySQL database, the history of successful and failed user connections to the application.
- Provides a view that displays in a list the history of user connections to the application.
- Purge the entire history or only those corresponding to a given period and status.
This module is published under the version 3 of GPL General Public Licence.
This module contains the view z4m_loginhistory
to declare within the
menu.php
of the
application in order to visualize the history of user logins.
User login history is stored in database within the zdk_user_login_history
SQL
table created automatically on module execution.
- ZnetDK 4 Mobile version 2.0 or higher,
- A MySQL database is configured to store the application data,
- Authentication is enabled
(
CFG_AUTHENT_REQUIRED
isTRUE
in the App'sconfig.php
).
This module is translated in French, English and Spanish languages.
To translate this module in another language or change the standard
translations:
- Copy in the clipboard the PHP constants declared within the
locale_en.php
script of the module, - Paste them from the clipboard within the
locale.php
script of your application, - Finally, translate each text associated with these PHP constants into your own language.
- Add a new subdirectory named
z4m_loginhistory
within the./engine/modules/
subdirectory of your ZnetDK 4 Mobile starter App, - Copy module's code in the new
./engine/modules/z4m_loginhistory/
subdirectory, or from your IDE, pull the code from this module's GitHub repository, - Edit the App's
menu.php
located in the./applications/default/app/
subfolder and add a new menu item definition for the viewz4m_loginhistory
. For example:
\MenuManager::addMenuItem('_authorizations', 'z4m_loginhistory', MOD_Z4M_LOGINHISTORY_MENU_LABEL, 'fa-history');
Once the Login history menu item is added to the application, you can restrict
its access via a user profile.
For example:
- Create a user profile named
Admin
from the Authorizations | Profiles menu, - Select for this new profile, the Login history menu item,
- Finally for each allowed user, add them the
Admin
profile from the Authorizations | Users menu.
The zdk_user_login_history
SQL table is created automatically by the module
when login history is read or stored for the first time.
If the MySQL user declared through the
CFG_SQL_APPL_USR
PHP constant does not have CREATE
privilege, the module can't create the
required SQL table.
In this case, you can create the zdk_user_login_history
SQL table by importing
in MySQL or phpMyAdmin the script
z4m_loginhistory.sql
provided by the module.
See CHANGELOG.md file.
Your contribution to the ZnetDK 4 Mobile project is welcome. Please refer to the CONTRIBUTING.md file.