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
- Download and copy the plugin jar to your plugins folder
- Start your server, this will build the default config file
- Stop your server, Update all config settings to your liking.
- Start your server again, and you should be good to go.
Upgrading From A Previous Version
- 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
- 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
Everytime I update it, I get new errors because other things like my "signature" does not have a default value even though this has nothing to do with it. I cannot change the value and my forums crash if anything is edited.
@Aefio Be careful this will drop your current users table, so back it up first if you need it.
Sorry no quotes:
DROP TABLE IF EXISTS `users`; CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(16) NOT NULL DEFAULT '', `password` varchar(42) DEFAULT NULL, PRIMARY KEY (`id`) );
MySQL said: Documentation
Drop your current table and run this:
"CREATE TABLE IF NOT EXISTS `time_played` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`username` VARCHAR(16) NOT NULL ,`password` VARCHAR(42) NULL )"
04.10 16:14:08 [Server] INFO [DBPassword] java.sql.SQLException: Field 'uid' doesn't have a default value
I fixed the last one, now this is appearing...
EDIT: Every time I fix something, I get a new error. The NEW error is 04.10 16:29:46 [Server] INFO com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
I have already gotten this before.
@Aefio
Your missing the ID field in your database table, if you know how to add fields to your table just add a field `id` and make it int - auto increment - and primary key
if you need a sql import script to alter the table I can right you one too.
Log. No errors enabling.
Getting this after typing (in game) /dbp set password
@Aefio
Try the new version .4 and see if this fixes your issue. If not open a ticket and send me your logs and ill see if I can fix it.
What Bukkit version are you running and which permission system are you using?
"Error. You do not have permission." I have permission... For everything. I added each node plus the * to my rank and it is still nit working. Too bad as this plugin looked EPIC :P
@Tombikos
Im a little confused by your question, this plugin doesnt stop people from logging into the server. It allows users to set passwords in a database, it is permission based so if your permissions are world based you should be able to restrict users by the world they are in.
Hi, could do this per-world? For example i have big server and one world is for everybody but another is under pass. :)