DBPassword

DBPassword v0.7 by Chausser

Description:

This plugin is meant to allow players on your server to setup a password and have it save to a MySQL database. This is my first ever java project as well as my first Bukkit Plugin. This plugin was largly inspired by Noneofyourbusiness and his Password plugin.

How I use this plugin: On my server (mcserver.nkings.com) all users that join the server are added to the users database with a random password. They have to set their password in game using this plugin before they can access the members section to the website.

The password function works like this: hash(salt+password);

For example if you are using the MD5 hash and a salt of "MyS@LT" and its given a password of "password" the funtion would be: MD5(MyS@LTpassword) = 364a711788b4dff21173f96181e13019

If you do not want to use a salt for your passwords you just want to hash them you can just set the salt in the config file to: ""

Features

  • Fully Configurable Database connection info including:
    • Host Address
    • Host Port
    • Database Name
    • Database Table Name
    • Database Username
    • Database Password
  • Ability to customize the column names for the table:
    • id
    • username
    • password
    • salt
  • As well as support for both many encryption types:
    • MD5
    • SHA-1
    • SHA-256
    • SHA-384
    • SHA-512
  • All with an optional security salt(dynamically generated or pre defined)

Installation

  1. Download and copy the plugin jar to your plugins folder
  2. Start your server, this will build the default config file
  3. Stop your server, Update all config settings to your liking.
  4. Start your server again, and you should be good to go.

Upgrading From A Previous Version

  1. You will need to back up your config file and let the plugin generate a new one. The latest version has almost a complete reworking of the config file
  2. Once the plugin has generated the new config file and you have updated the settings you should be good to go again.

Permission

Optionally only allow users with a certain permission node to set/update their passwords

  • dbp.*
  • dbp.set
  • dbp.update
  • dbp.reload

Commands

  • /dbp set <password> - set your password
  • /dbp update <password> - updates your password
  • /dbp reload - reloads the configuration without the need to restart the server.

Known Issues

  • Setting the column names in the config after the database table has been generated will not update the database table automatically. If you want to use this option you will need to update the table manually.

Change Log

  • v0.8 - Added the ability to customize the column names of the table.
  • v0.7 - Added a lot of new features including, dynamic salt generating, the ability to save that salt to a defined field in the database. Tested for 1.2.3-R0.1 and 1.1-R6/7
  • v0.6 - Updated for CB1.1-R4 - Added more hash types, cleaned up the sql statements, switch permissions to superperms only
  • v0.5 - Updated for RB 1317 - Some major command restructuring. Hopefully fixed issue where passwords were not getting hashed correctly.
  • v0.4 - Updated for RB 1240 - Added support for SuperPerms
  • v0.3 - Changed the default config values so that they dont use the single and double quotes.
  • v0.2 - Fixed the port issue. Added better permission support. Restructured the command a little bit. Added a reload command so you don't have to reboot the server to change settings
  • v0.1 - Initial Release

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Quaziz Quaziz Jan 09, 2014 at 22:56 UTC - 0 likes

    Would it be possible to get access to the source code?

    Last edited Jan 09, 2014 by Quaziz
  • Avatar of SDpyro SDpyro Mar 05, 2013 at 21:53 UTC - 0 likes

    @elimination17: Go

    Also, I have the need to add a group column to the DB. This seems to work fine for people who already have passwords using the update feature but setting a new pw and we get the following error on the console:

    2013-03-04 18:13:00 [INFO] UserName issued server command: /dbp set XXXXXXXXXX 2013-03-04 18:13:00 [INFO] [DBPassword] {debug} Hash: SHA-1 2013-03-04 18:13:00 [INFO] [DBPassword] java.sql.SQLException: Field 'group' doesn't have a default value

    I was thinking if you added some fields to the config file that you could just stuff with nulls (or even allow us to pre-populate data)

    Something similar to:

    custom_columns_for_table:
      id:       'id'
      username: 'username'
      password: 'password'
      salt:     'salt'
      group:    ''
    

    Just an idea.

  • Avatar of elimination17 elimination17 Mar 05, 2013 at 00:48 UTC - 0 likes

    @SDpyro: Go

    Thanks for the update, I havent built or tested this plugin against the latest builds in quite some time. Its possible how plugin reload used to work has changed. I will take a look at this and post an update when i have some time.

  • Avatar of SDpyro SDpyro Mar 04, 2013 at 23:52 UTC - 0 likes

    "/dbp reload" is not actually doing anything a full restart is needed to re-read the config.yml OR if you have PluginReloader.jar loaded you can do "/plugin reload DBPassword"

    Thought I would let you know. Thank you for this plugin. This a VERY important plugin to me, and am VERY grateful for your time.

    Last edited Mar 05, 2013 by SDpyro
  • Avatar of Zerdux Zerdux Nov 13, 2012 at 09:00 UTC - 0 likes

    Is it possible the DBPassword-Plugin integrate in an other table witch already exist? e.g: Table: id uid aid email warnings status

    And now the plugin add the own structure it looks so: id uid aid email warnings status username password salt

    I already tried this but in the console of putty only this error: java.sql.SQLException: Field 'uid' doesn't have a default value

  • Avatar of Bl0c Bl0c Nov 10, 2012 at 12:10 UTC - 0 likes

    Viiiid same question, can it work with wordpress? That would be awesome !!!

  • Avatar of elimination17 elimination17 Oct 07, 2012 at 19:25 UTC - 0 likes

    @ScottCameron: Go

    Can you post your config without your db connection info? Is the use dynamic salt options set to true?

  • Avatar of ScottCameron ScottCameron Oct 07, 2012 at 17:38 UTC - 0 likes

    When I remove the salt it doesn't encrypt it to just 'MD5'. It's adding something in it.

  • Avatar of timesheep timesheep Oct 03, 2012 at 20:15 UTC - 0 likes

    @elimination17: Go

    I solved the issue on my own using a 5-lined long MySQL query, but I'm sure that feature would come in handy for other users like me. I for instance use it to add the password to the MCMMO users to prevent the id-problem.

  • Avatar of elimination17 elimination17 Sep 25, 2012 at 19:20 UTC - 0 likes

    @timesheep: Go

    Just uploaded the new version with those config options. Let me know if you have any other questions or feature requests.

Facts

Date created
Sep 14, 2011
Categories
Last update
Sep 25, 2012
Development stage
Release
Language
  • enUS
License
GNU General Public License version 3 (GPLv3)
Curse link
DBPassword
Downloads
13,869
Recent files

Authors