[INACTIVE][ADMN] sqlPermissions v0.5b - Change your Permissions via SQL [740]

Discussion in 'Inactive/Unsupported Plugins' started by SvenBrnn, May 6, 2011.

  1. Offline

    SvenBrnn

    sqlPermissions - Change your Permissions via SQL:
    Version: v0.5b

    Projekt not needed Anymore. Permission 3.x has its own SQL permission system.
    So i stop developing this Plugin!


    The Plugin is for Administrating the Groups/Users of Nijikokun and TheYeti Permissions Plugin via MySQL. You can use the Webpage comes with the Plugin or Develop your own Pages using the Database the Plugin brings with.
    The Webpage the plugin brings with uses the Smarty Engine for Templates and a very simpel Black/White template.

    Features:
    • Loads the Permissions file into the DB if it is newer then the DB entrys
    • Writes the DB entrys into the Permission files if they are newer
    • Checks the DB and Files every 5 minutes for changes
    • Web Page uses the Smarty Template engine
    What the Plugin needs:
    Download
    Source Code

    ATTANTION: If you are using permissionPlus. When you change something in DB and after this within 5 minutes via permissionPlus your changes could be lost. I cant do anything against this!

    ATTANTION2: If you use the Website on an Linux System you have to set the cache and template_c directory rights to 777


    Planned:
    • "Nicer" looking webpage ;)
    • "real" sql Permission system as optional (so that no permissions is needed)
    • suggest something (no GroupManager ATM not^^)
    Changelog:

    Changelog (open)

    Version 0.5b
    • Fixed Webpage and Suffix
    Version 0.5
    • Some more Fixes
    Version 0.4
    • Make it Work with permissionPlus
    Version 0.3
    • Fixed an error when Parsing realy big files
    Version 0.2e
    • Changed mysql_real_escape_string to mysql_escape_string to remove PHP errors when Connection has no Password
    Version 0.2d

    • Some more Bugfixes
    Version 0.2c

    • Fixed Bug when World has a quote in its name
    Version 0.2b

    • Fixed Bug when Permissions of Group = null
    Version 0.2

    • Corrected string excaping when Reading the permission configs
    • Removed one Debug on Webpage
    Version 0.1

    • First Release
    Thanks to Nijikokun and TheYeti for the Permissions Plugin
     
    Ambedrake likes this.
  2. Ahh good to know, so for the YAML file you look at last file write on filesystem level I suppose? Should be working in that case, don't have that disabled. It just doesn't seem to detect the change at all.

    ===

    Also a suggestion for the SQL schema. Add UNIQUE keys to those that should have it: group name in group table, user name in user table, permission name in permission table.
     
  3. Offline

    John Kapsis

    i think a tutorial for sql noobs is a must.
    anyone can do it???
     
  4. That does not belong in this thread, MySQL is awesome for many many plugins, go learn it ^
     
  5. Offline

    John Kapsis

    if you care to help please provide a link, if not then taking directions is not my "thing".
     
  6. Offline

    Nick Hooper

    I am getting this same issue when updating single permission nodes for players, the nodes are written into the database, the lastDBChange is not.
     
  7. Offline

    John Kapsis

    From what i can figure out there is no DB created in the MySQL server at all!
    The error again just in case.
    If anyone can help please do, i'm looking into this all night and can't figure it out!
     
  8. Offline

    Zone

    Code:
    config:
        configVersion: '0.2'
        i:
            have:
                set:
                    the:
                        mysql:
                            data: true
     
  9. Offline

    DylanP

    Add a permissions system for users to it, so...I can add a user called "Bob" and Bob is only allowed to add users to groups.

    :D

    also, lrn2code

    Thanks for your plugin messing up all of my permissions by making EVERYONE a builder.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  10. You specify the existing "DB name" in the "config", the plugin does not need to create it. Also, not taking "advice" from people is a "bad quality", specific questions regarding the plugin can go in this thread, but learning basic SQL, is something Google can help you with, without creating noise here.

    I am sure you made a backup of your Permissions YAML? And can you be more descriptive of the issue?



    Well that is how it should be. When the plugin imports the flatfile YAML into the DB, it does not need to update that entry. Only if a change is made in the DB, that needs copying to the flatfile, then you need to update that entry.

    Anyway, seems yours actually changes the DB when you change something in the flatfile then? As mine sadly does not :(
     
  11. Offline

    SvenBrnn

    Seems that the connection is not enablished correctly at your server because the nullPointerExeption comes from the con variable. I will look over this again later.

    As i wrote in the readmy, MineCraft is a beta and so my Plugin is a beta too. You use it at your own risk. I am not responsible for such things. You shouldnt use such Plugins without doing a backup befor.
    Hm... writing into the file worked fine for me.
    Doesnt it Update user or group permission? Just to know where i have to search.
    Or doesnt it Read from File correctly?

    EDIT: Can it be that you Removed all Permission Nodes to that Permission: '' or Permission: null?
    If yes that i think i found the Problem^^

    Greeting Sven
     
  12. Offline

    Nathan C

    Ok, I have this installed and it even has created the MySQL tables. I have also configured the web folders config file, with the proper MySQL information.

    Problem is, that when I go to http://website.com/permissions/login.php -- it does not do anything. Just a blank page.

    Do you know what the correct URL or directory I am supposed to visit?
     
  13. Offline

    SvenBrnn

    Does your template_c and cache direcktory have 777 rights? That are the Directorys the Templateengine needs to render the Tempate.
     
  14. Offline

    Nathan C

    Ha!

    That did the trick, thank you.
     
  15. Offline

    SvenBrnn

    think i forgot this issue because i am testing on a windows system :oops:

    I will add this Information to readme and the Top Post next Version^^

    Updatet to v0.5. Some more bugfixes like the issue that if Permission where null the file was not loaded and Worlds copiing others not wrote in DB.

    For all that have the Problem that prevents from Deleting some users:
    Goto includes/content/players.php
    Search for (line 47):
    PHP:
        $db->query("DELETE FROM perm_users WHERE id='" $pID "'");
    Add bevor:
    PHP:
        $db->query("DELETE FROM perm_user_to_perm WHERE usrID='" $pID "'");
    I will add this fix to my next Version.

    Greetings Sven

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  16. Offline

    angro

    Thanks, it works! :rolleyes: :D
     
  17. Offline

    Ambedrake

    Hi Sven, I created a registration page for my system recently. Was rather easy once I figured out some of the DB structures numbering system. I am now working on a more dynamic one to compliment this for people to use I hope to be done by this weekend and hope it will help ^_^

    Now just to figure out how to tackle this admin page >.< this thing really needs a tune up lol.
     
  18. Offline

    Syntaxlb

    I have an error,
    the plugin replace "suffix" with "sufix" in permissions file :s
     
  19. Offline

    SvenBrnn

    ups ^^ that shoulnt be
    Try to fix this later

    Webpage and Suffix issue fixed

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  20. Offline

    Zone

    Ouch, I had the IT at Brohoster look over my Permissons file. The ended going though two people before it was sent to the top. Here is what they had to say:
    Staff 05/10/2011 08:35
    Hello #####,
    sqlpermissions is a poorly written plugin and is still fairly new, tell the author to make a better plugin. You shouldn't really need to use it anyways.
    Thank you,
    Joshua ####
    Community Manager
    Tech Support


    How would you rate this reply? Poor < Excellent
    Come on that is laughable advice. Umm I would like a simple remote way to edit the permissons file.(not ftp or ssh)

    What tables do I remove from MySQL?
     
  21. Offline

    Killie01

    ok, well, c# is an awesome windows programming language, GO learn it ^
     
  22. Offline

    ekeup

    please stop using .rar
    it's not linux friendly .zip would be better
     
  23. Offline

    Nick Hooper

    The database table 'perm_users_to_perm' isn't being updated at all, so any permission changes to specific players arn't being saved from the web pages.
     
  24. Offline

    Syntaxlb

    I want upgrade sqlPermissions, and now when i start my server i have this error :

    [SEVERE] at SvenBrnn.sqlPermissions.sqlPermissionsPermisionEditor.checkAndAddGroup(sqlPermissionsPermisionEditor.java:133)
     
  25. Offline

    SvenBrnn

    I will check this.
    Oh there was a bug un Webpage. If you dont want to wait for the next update.
    Change "inludes/content/player.php" line 152
    PHP:
        $tpl $s->fetch(TEMPLATE_DIR DS TEMPLATE DS CONTENT_DIR DS 'group_perm.tpl');
    to
    PHP:
        $tpl $s->fetch(TEMPLATE_DIR DS TEMPLATE DS CONTENT_DIR DS 'player_perm.tpl');
    and all should be fine.
    This happens if u use copy & paste to often :oops:

    I would need a Compleet error message.
    Strange, i am using .rar on my Linux root too :p
    Just search for unrar
     
  26. Offline

    Syntaxlb

    Oups sorry !

    The complete error message :

    Code:
    2011-05-11 09:20:44 [INFO] [sqlPermissons] Reading Permission file: worldof
    2011-05-11 09:20:46 [SEVERE] Exception in thread "Thread-21"
    2011-05-11 09:20:46 [SEVERE] java.lang.StackOverflowError
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.Util.handleNewInstance(Util.java:427)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.ResultSetImpl.getInstance(ResultSetImpl.java:381)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.MysqlIO.buildResultSetWithRows(MysqlIO.java:2630)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:486)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2608)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1784)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2198)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2570)
    2011-05-11 09:20:46 [SEVERE]     at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1474)
    2011-05-11 09:20:46 [SEVERE]     at SvenBrnn.sqlPermissions.sqlPermissionsDB.executeQuery(sqlPermissionsDB.java:72)
    2011-05-11 09:20:46 [SEVERE]     at SvenBrnn.sqlPermissions.sqlPermissionsPermisionEditor.checkAndAddGroup(sqlPermissionsPermisionEditor.java:92)
    2011-05-11 09:20:46 [SEVERE]     at SvenBrnn.sqlPermissions.sqlPermissionsPermisionEditor.checkAndAddGroup(sqlPermissionsPermisionEditor.java:133)
    2011-05-11 09:20:46 [SEVERE]     at SvenBrnn.sqlPermissions.sqlPermissionsPermisionEditor.checkAndAddGroup(sqlPermissionsPermisionEditor.java:133)
     
  27. Offline

    SvenBrnn

    Can you send me your config. Java causes a Stackoverflow but i have no idee why this happens. If you could send me your config via private conversation it could help.
    It looks like something is Causing an infinite loop.
     
  28. Offline

    tom v

    Hi,

    Yesterday I forked this plugin to see if I can make it work with mssql.
    With only a few adjustments I think it's working (mostly SQL-commands), need to test this night ...

    But is there any reason you are using the com.mysql.jdbc.Connection instead of the java.sql.Connection ?

    Else I can change my part so it will see in the config what to do instead of a plugin pure for mssql and one for mysql, that way it can also merge more easily.
     
  29. Offline

    SvenBrnn

    I think you can use java.sql.connection too. Just push your code when you are finished. I think i will have to add a config for the DB Driver to make both variants work.

    For some other issues i wrote TheYeti a Message for a request to work together. This would make things a lot of easyer.

    Greeting Sven

    EDIT: Changed imports to: java.sql.* for you
     
  30. Offline

    tom v

    Yea, already added a few configs for mssql, but I'll change my work so it will do both mssql as mysql and push it
     
  31. Offline

    SvenBrnn

    Check my new Git commits. Added some configuration for the SQL Driver. You can use it for your work.
     

Share This Page