Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

Commit

Permalink
2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroliu committed Nov 6, 2016
1 parent 4c1b3ad commit 7e0c8f9
Show file tree
Hide file tree
Showing 12 changed files with 1,268 additions and 189 deletions.
205 changes: 147 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
<img src="https://raw.githubusercontent.com/alejandroliu/pocketmine-plugins/master/Media/helper.alt-icon.png" style="width:64px;height:64px" width="64" height="64"/>

SimpleAuthHelper
================
# SimpleAuthHelper

* Summary: Simplifies the SimpleAuth login process
* Dependency Plugins: n/a
* PocketMine-MP version: 1.4 - API 1.10.0
* Summary: Simplifies the way people authenticate to servers
* Dependency Plugins: SimpleAuth
* PocketMine-MP version: 1.5 (API:1.12.0)
* DependencyPlugins: SimpleAuth
* OptionalPlugins: -
* Categories: General
* Plugin Access: Commands
* WebSite: [github](https://github.com/alejandroliu/pocketmine-plugins/tree/master/SimpleAuthHelper)

Overview
--------
## Overview

Very simple plugin that simplifies the login process... Instead of
<!-- php: $v_forum_thread = "http://forums.pocketmine.net/threads/simpleauthhelper.8074/"; -->
<!-- template: prologue.md -->

**DO NOT POST QUESTION/BUG-REPORTS/REQUESTS IN THE REVIEWS**

It is difficult to carry a conversation in the reviews. If you
have a question/bug-report/request please use the
[Thread](http://forums.pocketmine.net/threads/simpleauthhelper.8074/) for
that. You are more likely to get a response and help that way.

_NOTE:_

This documentation was last updated for version **2.0.1**.


You can also download this plugin from this [page](https://github.com/alejandroliu/pocketmine-plugins/releases/tag/SimpleAuthHelper-2.0.1).

<!-- template-end -->

A plugin that simplifies the login process... Instead of
asking for commands, users simply chat away...

### Register process
I also provides for a number of tweaks that can improve the usability of
[SimpleAuth](https://forums.pocketmine.net/plugins/simpleauth.4/).

#### Register process

Player connects for the first time. They are prompted to enter a
*NEW* password. They enter their password directly, without having to
Expand All @@ -27,64 +47,133 @@ enter */register*.
They are asked for the password again to confirm. They re-enter their
password (again without */register*).

### Login process
#### Login process

Player connects again. They are prompted to enter their login
password. They type their login password directly (without
*/login*). And they are in.

Documentation
-------------

As a bonus, it can start a player with initial inventory upon
registration. This is configured through the `nest-egg` setting.
## Documentation

### Commands

* *chpwd* _<old-pwd>_
Used by players to change their passwords.
* *resetpwd* _<player>_
Used by ops to reset a players password. This actually unregisters
the password.
* *chpwd* _&lt;old-pwd&gt;_
* Used by players to change their passwords.
* *resetpwd* _&lt;player&gt;_
* Used by ops to reset a players password. This actually unregisters
the password.
* *preregister* _&lt;player&gt;_ _&lt;passwd&gt;_
* Used by ops to pre-register players.
* *logout*
* De-authenticates a player.

### Permission Nodes

* simpleauthhelper.command.chpwd : Allow users to change passwords
* simpleauthhelper.command.logout : Allow users to logout
* simpleauthhelper.command.resetpwd : Allow ops to reset other's passwords
(Defaults to Op)
* simpleauthhelper.command.prereg : Allow ops to pre-register users
(Defaults to Op)


### Configuration

---
messages:
re-enter pwd: 'Please re-enter password to confirm:'
passwords dont match: |-
Passwords do not match.
Please try again!
Enter a new password:
register ok: You have been registered!
no spaces: |-
Password should not contain spaces
or tabs
not name: Password should not be your name
too many login: You have attempted to login too many times.
login timeout: Login timer expired!
nest-egg:
- "272:0:1"
- "17:0:16"
- "364:0:5"
- "266:0:10"
max-attempts: 5
login-timeout: 60
auto-ban: false
...

* The section `messages` can be used to configure displayed texts.
* `nest-egg` section contains list of items that will be given to the
player upon registration.
* `max-attempts` counts the number of tries to login.
* `login-timeout` will kick the player out if not authenticated in
that number of seconds.
* `auto-ban`: If set to true it will automatically ban the IP of a
player that does too many login attempts.

Changes
-------
Configuration is through the `config.yml` file.
The following sections are defined:

#### main


Configure the different features used by this plugin.

feature: true|false

If `true` the feature is enabled. if `false` the feature is disabled.
* max-attemps: kick player after this many login attempts. NOTE: This conflicts with SimpleAuth's blockAfterFail setting
* login-timeout: must authenticate within this number of seconds
* leet-mode: lets players use also /login and /register
* chat-protect: prevent player to display their password in chat
* hide-unauth: EXPERIMENTAL, hide unauthenticated players
* event-fixer: EXPERIMENTAL, cancels additional events for unauthenticated players
* hack-login-perms: EXPERIMENTAL, overrides login permisions to make sure players can login
* hack-register-perms: EXPERIMENTAL, overrides register permisions to make sure players can register
* db-monitor: EXPERIMENTAL, enable database server monitoring
* monitor-settings: Configure database monitor settings

#### monitor-settings

* canary-account: account to query this account is tested to check database proper operations
* check-interval: how to often to check database (seconds)


## Translations

This plugin will honour the server language configuration. The
languages currently available are:

* English
* Spanish

You can provide your own message file by creating a file called
`messages.ini` in the plugin config directory. Check
[github](https://github.com/alejandroliu/pocketmine-plugins/tree/master/SimpleAuthHelper/resources/messages)
for sample files.

## Player pre-registration

It is possible to implement a web based pre-registration system with this
plugin.

1. *rcon* must be enabled on the PocketMine server.
2. web server must be able to send *rcon* commands to PocketMine.
3. Enable the *whitelist* functionality in PocketMine.
4. Install *SimpleAuth* and *SimpleAuthHelper*.
5. **Optionally** install *PurePerms* and disable
`simpleauthhelper.command.chpwd` permission. You probably want
users to change passwords from the web site.
6. Whenever a user registers in web site, the web site script uses *rcon*
to send the follwoing:
- whitelist add _player_
- preregister _player_ _passwd_
7. Whenever a user changes password in web site, we use *rcon* with:
- resetpwd _player_
- preregister _player_ _passwd_

## Database Monitor

This module is responsible for monitoring the SimpleAuth data provider
to make sure that it is up and running and disable logins if it is not
available.

It kicks off a background task that will poll the SimpleAuth data provider
by trying to retrieve the data from the "canary-account". It is important
that you have configured and have working SimpleAuth provider the first
time you enable the database monitor. This is because the "canary-account"
needs to be created (if it doesn't exist already).

On a regular interval, the SimpleAuth
data provider is checked. If it is not running, all unauthenticated players
are kicked and any new joins are not allowed.

## Issues

* Event Fixer: Crafting canceling doesn't work

# Changes

* 2.0.1: language defaults
- make sure that languages default to English (reported by @minebuilder0110)
* 2.0.0: Major upgrade
- uses now a common translation library
- Removed little used feature: nest-egg
- leet-mode also works for /register.
- Removed auto-ban. It is now done in SimpleAuth.
- Added support for hiding unauthenticated players (Suggested by @CaptainKenji17)
- Added pre-register and logout command
- forces permissions to be set
- Added a task to monitor database server status
- Thanks @rvachvg for helping debug this.
* 1.2.3: Security improvements
- prevent user from chatting away their password
- add option so that players can also use "/login" to login.
Expand All @@ -93,7 +182,7 @@ Changes
* 1.2.1: CallbackTask deprecation
* Removed CallbackTask deprecation warnings
* 1.2.0: max-logins
* Suggestion from MCPEPIG
* Suggestion from @MCPEPIG
- kick user out after `max-attempts`.
- Added a chpwd command.
* Kick user out if not authenticated after `timeout` seconds.
Expand All @@ -103,8 +192,7 @@ Changes
* Messages can be configured.
* 1.0.0: First release

Copyright
---------
# Copyright

SimpleAuthHelper
Copyright (C) 2015 Alejandro Liu
Expand All @@ -122,3 +210,4 @@ Copyright

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

21 changes: 19 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
main: aliuly\helper\Main
api: 1.10.0
api: 1.12.0
load: POSTWORLD
depend: [SimpleAuth]

name: SimpleAuthHelper
description: Simplifies the way people authenticate to servers
version: 1.2.3
version: 2.0.1
author: aliuly

commands:
chpwd:
description: "Change password"
usage: "/chpwd <old_password>"
permission: simpleauthhelper.command.chpwd
aliases: [passwd]
resetpwd:
description: "Reset password"
usage: "/resetpwd <player>"
permission: simpleauthhelper.command.resetpwd
aliases: [resetpw]
preregister:
description: "pre-register player"
usage: "/preregister <player> <passwd>"
permission: simpleauthhelper.command.prereg
aliases: [prereg]
logout:
description: "logout player"
usage: "/logout"
permission: simpleauthhelper.command.logout

permissions:
simpleauthhelper.command.chpwd:
default: true
description: "Allow users to change passwords"
simpleauthhelper.command.logout:
default: true
description: "Allow users to logout"
simpleauthhelper.command.resetpwd:
default: op
description: "Allow ops to reset other's passwords"
simpleauthhelper.command.prereg:
default: op
description: "Allow ops to pre-register users"
51 changes: 51 additions & 0 deletions resources/messages/eng.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
; eng.ini
"%1%-mode"=""
"%1% already registered"=""
"%1% has just joined"=""
"%1% unauthenticated players were kicked"=""
"%1% unregistered"=""
"**CENSORED**"=""
"<nagme>"=""
"Adventure"=""
"Creative"=""
"DBM Error: %1%"=""
"Database connectivity restored!"=""
"Database is experiencing technical difficulties"=""
"Detected loss of database connectivity!"=""
"Disabling SimpleAuth"=""
"Enabling SimpleAuth"=""
"Fixing %1% for %2%"=""
"LOST DATABASE CONNECTION!"=""
"Restored database connection"=""
"SimpleAuthHelper has been disabled"=""
"SimpleAuth not found!"=""
"Spectator"=""
"Survival"=""
"This command only works in-game."=""
"Unable to find SimpleAuth"=""
"Unable to unregister %1%"=""
"You are no longer registered!"=""
"You can only do this in-game"=""
"You do not have permission to do that."=""
"auth error"="Authentication error. Try again later!"
"chat protected"="Do not send your password on the chat window"
"chpwd error"="Old password does not match"
"chpwd msg"="Enter your new password:"
"chpwd ok"="Password changed succesfully"
"error registering %1%"=""
"login first"=""
"login timeout"="Login timer expired!"
"logout completed"=""
"no spaces"="Password should not contain spaces or tabs"
"not name"="Password should not be your name"
"one unauthenticated player was kicked"=""
"passwords dont match"="Passwords do not match.\nPlease try again!\nEnter a new password:"
"re-enter pwd"="Please re-enter password to confirm:"
"register.error.password %1%"="Your password should be at least %1% characters"
"registered %1%"=""
"register first"="You must first be registered"
"register ok"="You have been registered!"
"registration error"="Registration error. Try again later!"
"snob login"="Actually, you don't really need to type /login"
"snob register"="Actually, you don't really need to type /register"
"too many logins"="You have attempted to login too many times."
Loading

0 comments on commit 7e0c8f9

Please sign in to comment.