[INACTIVE] [ADMN] Albus v4.0 Final - Use forum grouping to control whitelist via MySQL [953]

Discussion in 'Inactive/Unsupported Plugins' started by Ant59, Feb 1, 2011.

  1. Offline

    Ant59

    Want to rank players with GroupManager/Permissions using your forum system instead? Use Warrant!

    [​IMG]

    [DistrictMine] Albus v4.0
    Whitelisting via forum grouping

    Albus is a whitelist plugin that allows admins to whitelist their servers, by grouping members in their forum. The Bukkit server will ask the forum's database - whenever someone logs in - whether their username in the forum has a group id that is allowed to join the server.

    This is especially good for subscription servers, where SMF subscriptions are used. It will completely automate the whitelist function for your minecraft server.

    Download JAR: http://dl.dropbox.com/u/29840218/Albus.jar
    Download MySQL Connector: http://dl.dropbox.com/u/29840218/mysql.jar
    View Source: https://github.com/Ant59/Albus

    Installation
    1. Place Albus.jar in your plugins directory
    2. Place mysql.jar (the mysql java connector) into the root of your bukkit server, in the same folder as craftbukkit.jar
    [SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5][SIZE=5]Configuration[/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE]


    All configuration settings can be found in the auto-generated properties file, found in plugins/Albus/Albus.properties​

    Properties and explanations

    kick-message - Message to display to players not on whitelist when they try to login​
    kick-message-registered - Message to display to players not in a whitelisted but registered on the forum. Making this blank will turn off this functionality, saving memory by not memorising all registered forum members.​
    mysql-host - The MySQL server IP or URL​
    mysql-port - Port of MySQL server (3306 by default)​
    mysql-db - Database to find member data​
    mysql-table - The table used for member data​
    mysql-user - Name of MySQL User​
    mysql-pass - Password for MySQL user​
    username-field - The field that your forum engine stores the user's minecraft player name​
    group-field - The field that your forum engine stores the group ids of users​
    allowed-group-ids - The group ids to which a user must belong to be allowed in​
    reload-period - Not yet used. In a future version, you may change the period of time between auto database checks from 5 minutes to any length.​

    I took my own time to make this plugin and distribute it and would really appreciate a small donation if you find it useful :) Thank you!

    [​IMG]
     
    nogoodwithnames, WolwX and Niemand like this.
  2. Offline

    dark navi

    This is actually pretty awesome. You should make one for MyBB :p
     
  3. Offline

    Juze

    Same for phpBB forums, please!
     
  4. Offline

    dark navi

    Actually, I think it would be easier if you just had a property that looked for a values in table/column, like a custom profile field and a user-group.
     
  5. Offline

    Ant59

    Yeah, I might expand on it. I ought to allow custom table/column settings.
     
  6. Offline

    Darchiv

    I've just downloaded this plugin and done everything in order:
    1. Get 'mysql-connector-java-bin.jar'.
    2. Put plugin in 'plugin' directory.
    3. Start, stop server.
    4. Edit properties file to functioning DB data.
    5. Start server and:
    Code:
    [INFO] [SMHWhite] v1.0 - Running database connection...
    [WARNING] [SMHWhite] v1.0 - MySQL connection failed: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    [WARNING] [SMHWhite] v1.0 - The following statement failed: select member_name from members where id_group IN(1,2,3)
    [WARNING] [SMHWhite] v1.0 - Statement failed: java.lang.NullPointerException
    [WARNING] [SMHWhite] v1.0 - Failed to load whitelist
    6. I've checked that MySQL query and it worked for me.

    Can you help me? :(

    @EDIT
    I've downloaded many versions of Connector/J, but all of them give the error above.
    What name have this file to have?
     
  7. I hope that you get a chance to implement with other forum software. If you need a IPS to test on, I have you covered with a site that is in development so it doesn't matter if things go a little stray.
     
  8. Offline

    Ant59

    Sorry for the inactivity guys. I'm at work currently, but as soon as I get in, I'll be updating this, adding more custom support, more forum support, and I'll be making it easier to implement the MySQL functionality. Seems it's been broken by Bukkit being updated recently.
     
  9. Offline

    Darchiv

    Huh, I'm waiting for PunBB implementation of that plugin (database structure - http://punbb.informer.com/docs/dev.html).
    If you can do this (and have time for it) I'll be very happy. I can't start my server without that [​IMG]
     
  10. Offline

    Eroing

    Will this work with SQLite?
     
  11. Offline

    Ant59

    Why would that be advantageous Eroing? The plugin is designed to allow whitelisting according to forum grouping.
    Please explain why it would need SQLite functionality, and I'd be happy to add it :)

    UPDATE!
    I have updated the plugin to allow for custom setups, and expansion beyond SMF only. I have also changed the name to Albus, in case you're wondering where SMFWhite has gone.

    Enjoy!
     
  12. Offline

    Tasoli

    2 questions:

    1) does the expanded version of config support, say, phpbb3?

    2) is this for servers where the server is the webhost only, or could i run this on my home server and then call into a database on my webhost that I pay for hosting from?

    3) sqlite? (lol :p)
     
  13. Offline

    Ant59

    Yes, it supports phpBB3, and I will write an example config for it.

    It is designed to talk to MySQL databases on other servers aswell as locally, since this is how I run my server. I have minecraft running alone, and Albus can communicate with my webspace database fine.

    Lol, I still don't understand why on Earth that would be beneficial, since forums generally all run on MySQL.
     
  14. Offline

    Darchiv

    Ant59, see this:
    Code:
    rs = sql.trySelect("SELECT " + propConfig.getProperty(PROP_USERNAME_FIELD) + " from " + propConfig.getProperty(PROP_MYSQL_USERS_TABLE) + " WHERE " + propConfig.getProperty(PROP_USERNAME_FIELD) + " IN(" + propConfig.getProperty(PROP_ALLOWED_GROUP_IDS) + ")");
    This propConfig.getProperty(PROP_USERNAME_FIELD) after WHERE don't have to be PROP_GROUP_FIELD?
    Maybe I'm wrong, but I can't check it cause I don't know how compile-or-something-like-that this code.
     
  15. Offline

    Kane

    Kind of sucks I got Xenfor forums :p Will never get this feature I guess lol
     
  16. Offline

    Ant59

    I had fixed this in my most recent export Darchiv, but had not committed it to the git repo. It is fixed now :)

    Lol Kane, sorry about that. Does XenForo not work by the same sort of system?

    UPDATED!
    I have fixed EVERYTHING and cleared up all the unnecessary code I left behind. This current release works perfect and I am currently using it on districtmine.net

    I have edited the OP to add all the details of properties. If anyone would like to write examples for any other db engines, then I would really welcome that! Also, if you need any help setting it up, you can catch me in the bukkit IRC channel :)

    Hope this proves useful!
     
  17. Offline

    Seze

    I tried using this plugin, but its not working. In game, I can run /Albus list and it shows everyone that should be on the whitelist, but the server won't kick anyone who is not on that list, it is letting everyone in. I tried this with craftbukkit builds 323 and 326. Looking at some of the code in AlbusListener.java, it looks like it should log whether the user was allowed to connect or not. I see no such listings on console or in any of the logs. Its like the listener isn't working at all.

    Code:
    2011-02-14 23:32:20 [INFO] [Albus] v2.0 - Trying to load whitelist and settings...
    2011-02-14 23:32:20 [INFO] [Albus] v2.0 - Enabled!
    2011-02-14 23:32:20 [INFO] Done! For help, type "help" or "?"
    2011-02-14 23:32:20 [INFO] [Albus] v2.0 - Running database connection...
    2011-02-14 23:32:21 [INFO] [Albus] v2.0 - Whitelist Loaded
    2011-02-14 23:32:39 [INFO] username [/123.123.123.123:12345] logged in with entity id 102
    
    Any thoughts?
     
  18. Offline

    Phantom Index

    Be nice if this worked for xenforo.
     
  19. Offline

    Ant59

    Sorry about that Seze, fixed that now. I mixed up a variable. Re-download and it checks on login fine as far as I can tell from testing.
     
  20. Offline

    Darchiv

    Thank you very much Ant59!
    It's the best plugin for external authorization that I know.
    PS Check your PayPal account [​IMG]
     
  21. Offline

    dfdgsdfg

    I have error sth like below

    Of course I have field that is named name, group that is contained value 1 or 2 .

    What should I do?

    bukkitcraft 326 with mysql 5.5.8

    1. Get 'mysql.jar' from your download link.
    2. Put plugin in 'plugin' directory.
    3. Start, stop server.
    4. Edit properties file to functioning DB data.
    5. Start server and:

     
  22. Offline

    wilsonc91

    Would love to see support for other forum software - thanks and great work.
     
  23. Offline

    Ant59

    Thank you Darchiv! I'm very glad this has proven useful to you. :)
    --- merged: Feb 15, 2011 8:31 PM ---
    dfdgsdfg, it would appear you have entered the wrong details for your table. This has caused an error in the sql syntax, since it appears it cannot find the field "group".
     
  24. Offline

    dark navi

    Don't know if I am looking at this wrong, but my users minecraft names and user groups are stored in 2 different tables. Is there a way to check that?
     
  25. Offline

    dfdgsdfg

    I have the "group" field.

    What should i do?

    Also can I use "y" or "n" value in "allowed-group-ids"?
     
  26. Offline

    Ant59

    Dfdgsdfg, can you send me a copy of an example user's row in your database too please, since I can then work out what fields you'd need :)
     
  27. Offline

    dark navi

    Please add an option for multiple tables :(
     
  28. Offline

    dfdgsdfg

    Here is my forum table.


    and..

    :)
     
  29. Offline

    Ant59

    Dark Navi, I'm not sure about that. Can you send me a more complete example of your database structure please?

    dfdgsdfg, your situation seems to be the same as Dark Navi.

    It's midnight here right now, so I can't think straight, but I will get back to you both with a solution in the morning :) I know how to achieve it with table joining, but I'm not in a state to write it out tonight. Give me 10 hours, I'll get it done for you both :)
     
  30. Offline

    dark navi

    Essentially, everything is in the same DB, but they info is stored in two different tables. The way MyBB is set up, profile fields are stored in something like mybb_profileFields and user profiles (including info and which group a user is in) is stored in a table called mybb_userProfiles. Is there some where where you can pull the user ID's groups and use that to check the fields in other tables?
     

Share This Page