-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b90ab77
Showing
11 changed files
with
1,289 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Roundcube Plugin Lastlogin | ||
============================ | ||
|
||
Roundcube plugin to save and show user login information (user login history). | ||
|
||
When a user logs in into Roundcube, this plugin: | ||
|
||
1. shows the last user login information in a small box for N configurable seconds; | ||
2. saves the information to a database table for history purposes. | ||
|
||
If using the geolocation plugin and you have configured your organization internal networks, that information will be shown. For more information, see the geolocation plugin configuration. | ||
|
||
This plugin provides a section in settings for the user to configure the number of seconds to show the information on login. | ||
|
||
Stable versions of Lastlogin are available from the [Roundcube plugin repository][rcplugrepo] or the [releases section][releases] of the GitHub repository. | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
- [Roundcube Plugin Geolocation][geolocation] if the config option `lastlogin_geolocation` is `true` (default). | ||
|
||
|
||
Installation with composer | ||
---------------------------------------- | ||
|
||
Add the plugin to your `composer.json` file: | ||
|
||
"require": { | ||
(...) | ||
"dsoares/lastlogin": "~0.1" | ||
} | ||
|
||
And run `$ composer update [--your-options]`. | ||
|
||
Manual Installation | ||
---------------------------------------- | ||
|
||
Place this directory under your Rouncdube `plugins/` folder, copy `config.inc.php.dist` to `config.inc.php` and modify it as necessary. | ||
Then, you need to import the database script: | ||
|
||
mysql -your_mysql_connection_options your_roundcube_database_name < SQL/mysql.initial.sql | ||
|
||
NOTE: The plugin ships only with a MySQL/MariaDB script `SQL/mysql.initial.sql`; you are welcome to contribute with other database drivers. | ||
|
||
Don't forget to enable the lastlogin plugin within the main Roundcube configuration file `config/config.inc.php`. | ||
|
||
|
||
Configuration | ||
---------------------------------------- | ||
|
||
- **$config['lastlogin_timeout']** - number of seconds to show the user login info at login; default is `10`. | ||
|
||
- **$config['lastlogin_lastrecords']** - number of history entries to show in the settings section; default is `10`. | ||
|
||
- **$config['lastlogin_geolocation']** - use the geolocation plugin; default is `true`. | ||
|
||
See the `config.inc.php.dist` for more information. | ||
|
||
License | ||
---------------------------------------- | ||
|
||
This plugin is released under the [GNU General Public License Version 3+][gpl]. | ||
|
||
Contact | ||
---------------------------------------- | ||
|
||
Comments and suggestions are welcome! | ||
|
||
Email: [Diana Soares][dsoares] | ||
|
||
[rcplugrepo]: http://plugins.roundcube.net/packages/dsoares/lastlogin | ||
[releases]: http://github.com/JohnDoh/Roundcube-Plugin-Lastlogin/releases | ||
[geolocation]: http://plugins.roundcube.net/packages/dsoares/geolocation | ||
[gpl]: http://www.gnu.org/licenses/gpl.html | ||
[dsoares]: mailto:[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- | ||
-- Plugin last_login: initial MYSQL database structure | ||
-- | ||
|
||
/*!40014 SET FOREIGN_KEY_CHECKS=0 */; | ||
|
||
|
||
-- Table structure for table `userlogins` | ||
|
||
CREATE TABLE IF NOT EXISTS `userlogins` ( | ||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
`user_id` int(10) unsigned NOT NULL DEFAULT 0, | ||
`username` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
`session_id` varchar(128) NOT NULL DEFAULT '', | ||
`ip` varchar(20) NOT NULL DEFAULT '', | ||
`real_ip` varchar(20) NOT NULL DEFAULT '', | ||
`hostname` varchar(255) NOT NULL DEFAULT '', | ||
`geoloc` varchar(255) NOT NULL DEFAULT '', | ||
PRIMARY KEY (`id`), | ||
INDEX `user_id` (`user_id`) | ||
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; | ||
|
||
|
||
/*!40014 SET FOREIGN_KEY_CHECKS=1 */; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "dsoares/lastlogin", | ||
"type": "roundcube-plugin", | ||
"description": "Roundcube plugin to save and show user login information and login history.", | ||
"keywords": ["mail","login","history"], | ||
"homepage": "https://github.com/dsoares/Roundcube-Plugin-Lastlogin", | ||
"license": "GPL-3.0+", | ||
"authors": [ | ||
{ | ||
"name": "Diana Soares", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/dsoares" | ||
} | ||
], | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "https://plugins.roundcube.net" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.2.1", | ||
"roundcube/plugin-installer": "~0.1.3", | ||
"dsoares/geolocation": "~0.1" | ||
}, | ||
"extra": { | ||
"roundcube": { | ||
"min-version": "1.0", | ||
"sql-dir": "SQL" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
/** | ||
* Lastlogin configuration file. | ||
*/ | ||
|
||
// Default number of seconds to show the lastlogin info at login. | ||
$config['lastlogin_timeout'] = 10; | ||
|
||
// Number of entries to show in user login history. | ||
$config['lastlogin_lastrecords'] = 10; | ||
|
||
// Use geolocation plugin. | ||
$config['lastlogin_geolocation'] = true; |
Oops, something went wrong.