[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. Offline

    MrJelle

    If it's not too much to ask, screenshot of the interface?

    Oh, and you may want to use .zip instead of .rar, more commonly accepted.
     
  3. Offline

    Ambedrake

    You sir deserve 1 internetz.

    Ok so I come up with two simple errors. The first is there is no string checking to escape special characters in worlds IE TheDragon'sDen will cause a SQL syntax error due to the ' in the name. The last is in the multiworld permissions it sends off a "Null" error reffering to line 51 of sqlPermissionsPermissionsEditor.java.

    These should be fairly simple fix's, for the first error you need to have it check a string for code that needs escaped and escape it properly. This will keep from SQL injection attacks as well when it comes to the web side of it. The second one just seems to be a little bug in the code somewhere that can be weeded out.

    Otherwise this is a very very awsome idea for a plugin, one I actually have been looking for for ages now.

    Thanks for all the work,
    Ambe

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

    PatrickFreed

    I caan't see why anyone would want to use more SQL, but that's my opinion. ;p
     
  5. Offline

    DerKB

    Nice one, will give it a try if i get the time to put it on the server.

    And about this
    Well, you seem to not know how much more a real SQL server can do, that stupid flat file storing or a db for every damn plugin stored in the filesystem is the most stupid overall.
    If i can handel more stuff in MySQL, fine, i do it, it is much more usefull then the way most plugins store there data.
    AND i can combine this one with an auth plugin and other plugins that use sql and i can combine it with a webpage.
    Well you can do a lot if you have a nice database set up and not risk a high load of the game server.
    So the most that do not like to use an SQL database, simple do not know how much such a system offers.
    But if you do not like to use a SQL database, stick with the current option and not use one, i like to have a clean setup were nearly all relevant data is stored at ONE place and not at 20 different ones.

    So thx for this plugin.
    Regards
    derkb
     
  6. Offline

    PatrickFreed

    Didn't mean to offend you, I just think that the simpler, the better. SQL databases usually work, but sometimes there can be issues for people who don't use them that often/using them for the first time.
     
  7. Offline

    Greylocke

    "why would anyone want to fly? They'd miss all this lovely pedalling!"

    I cannot wait to give this a spin! Thanks for putting it together!
     
    Haplo likes this.
  8. Offline

    GmK

    @SvenBrnn

    Wonderful stuff! As soon as the small bugs are weeded out, I'll give it a go!

    Without having checked:
    - Does it support multiworld setups where each world has a different permissions file and isnt a copy of one another?
    - Does it handle all Numbers usernames properly? (by adding a '' around them)

    Thanks!
     
  9. Offline

    SvenBrnn

    I will fix this Errors when i am Back at home. The Webpage uses the mysql escape function that PHP5 offers. That should work for anti SQL Injection.

    1. It has Multiworld Support and cannot only Copy the Permissions
    2. I think so, i am using the Configuration class offered by Bukkit to read/write the configs.


    1. Yea, its very simpel :p screenDesign.png

    2. rar is much better then zip. I dont like the zip format for some reasons.
     
  10. Offline

    Phinary

    Make this work with groupmanager?
     
  11. Offline

    Killie01

    can you also acces this DB with a mysql connector of .NET ?
     
  12. Offline

    John Kapsis

    Hey!!
    This is great!!
    Do you think i can patch in to the SQL and make a section for that in my gui? (info for the gui in my signature)
    i'm using vb.net and haven't used SQL yet... ( i know lol right?)


    EDIT:
    Hahaha you beat me to the second!!!
     
  13. ZIP can be opened with default windows and linux and it's faster, not as efficient as RAR for compression but it's more... lite than RAR :}

    And from what I'm seeing, you don't really like lite =) that web script is crowded with stuff that aren't really needed, such as cache... for an admin panel that would be opened by 1-2 people at a time, that's really not needed.
    You need to focus on making it more usable, like auto-completing inputs/checkboxes on editing stuff :p

    Well, nice plugin, looking forward to your improvements :}


    @John Kapsis and @Killie01 I think you can connect just fine to mySQL if your programming language used supports it.
     
  14. Offline

    John Kapsis

    yeah i figured, i just have to learn to use sql databases in vb.net...
    not easy, but do-able!
     
  15. Offline

    Ambedrake

    If you can get this working smoothly I am thinking I will make a phpBB 3 modification as to force people to register for the boards with their in game name in order to start building (which is simple enough to modify to allow certain things to registered users via permission groups). Let me know if you need more testing done with other versions, my test server will always be open to giving this one a stress test if you catch my drift.
     
  16. Offline

    KingPin

    is this working for anyone (the web part) atm? for me its trying to use my system login as mysql login for some odd reason instead of the credentials supplied in the config.php

     
  17. Offline

    gamingvortex

    This looks AMAZING! I cant wait to try it... After porting from hey0 this is the one thing i wanted more than anything and because my java code is no good i gave up waiting WOOOP! Made my day :)

    Why would you use .net when linux is alot better! GOSH! xD

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

    John Kapsis

    cause i don't care what is better kid...
     
  19. Offline

    gamingvortex

    *what... its a system not a person
     
  20. Offline

    John Kapsis

    corrected it! thanks!

    BTW do you know what vb.net is and what linux is?

    let me help you,
    vb.net is programming language for the windows operating system. (like java)
    linux is an operating system. (like windows and OSX)

    Also vb.net can have toolsets (provided by mono develpment team and is not free) that allow the exporting of .net applications to not only windows but linux and OSX alike!

    So you see you original comment was compering to irrelevant things.

    Since you helped me with my mistake i wanted to help you with yours :)
     
  21. Offline

    Zone

    I keep getting this,
    Code:
    2011-05-07 19:02:08 [INFO] [sqlPermissons] Reading Permission file: world
    2011-05-07 19:02:08 [INFO] java.lang.String cannot be cast to java.lang.Boolean
    2011-05-07 19:02:08 [SEVERE] null
    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
        at SvenBrnn.sqlPermissions.sqlPermissionsPermisionEditor.checkAndAddGroup(sqlPermissionsPermisionEditor.java:89)
        at SvenBrnn.sqlPermissions.sqlPermissionsPermisionEditor.loadPermissionsToDatabase(sqlPermissionsPermisionEditor.java:48)
        at SvenBrnn.sqlPermissions.sqlPermissionsWorker.run(sqlPermissionsWorker.java:64)
    config:
    configVersion: '0.1'
    i:
    have:
    set:
    the:
    mysql:
    data: True < woops I should have seen that 't'
    mysql:
    port: '3306'
    host: mysqlhost
    password: ******
    user: *******
    database: 2320165624337874
     
  22. Java is throwing an exception whilst trying to parse "True" as a boolean. Valid entries here are "true" and "false". It's case sensitive.

    AKA:- change it to "true".
     
  23. Offline

    Zone

    I should have seen that. I changed the 'T' to t. Sadly, I still have the same error.
     
  24. Offline

    untergrundbiber

    That would interest me too
     
  25. Offline

    alex4108

    Downloading right now and going to integrate into my user control panel I already made.

    Thanks!

    The system is trying to use my user (www@localhost) instead of the defined user I have in config.php

    Also, is there not a database export anywhere? Because from what I understand

    - The web panel doesn't auto-insert the proper table(s)?
    - The .jar doesn't auto-insert the proper table(s)?

    WTF?!
    Documentation for this would be very helpful.
     
  26. Offline

    SvenBrnn

    For the Databases look at https://github.com/SvenBrnn/sqlPerm...SvenBrnn/sqlPermissions/sqlPermissionsDB.java starting line 93. There are the Strings for Creating the DB. I can make a Doku later.

    As you see at the Line "Loading World" you can see the error is not in your main config file.
    The error is somewhere in your "world.yml" of your Permissions configs.

    At the moment a GroupManager portation is not planned. Maybe later. I would have to look how the Groupmanager Configs work befor.

    @all
    I will make a update to fix the bugs i know today.
     
  27. Offline

    Ambedrake

    FYI to those having non SQL syntax errors. Run through your Permissions files, if there is a part that has a 'null' for its value (IE "permissions: null") delete the 'null' part and leave it blank. I do not know why this fixes some of the issues but meh its an easy fix.

    Now just to wait for this mad genius to work out a fix for odd characters in a map name that need escaped for SQL syntax =P

    Just saw the source updates your rock!

    0.2 Update started up, no errors \0/ Now to give it a stress test ^_^
     
  28. Offline

    SvenBrnn

    Updated to 0.2.
    Added right excaping of the Strings going into MySQL.

    Can you give me an exemple for this permission: null?
    So i could fix this Issue in the next version (maybe today ^^)

    MFG Sven
     
  29. Offline

    Ambedrake

    Ok, in the Permissions files three things can happen for an empty value. here are the examples :

    Code:
     Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
        [B]    inheritance: null[/B]
            permissions:
            - dynamicmarket.access
            - dynamicmarket.buy
            - dynamicmarket.sell
            - iConomy.payment
            - Spells.commands.cast
            - Spells.commands.spells
            - Spells.cast.spawn
            - Spells.cast.frost
            - varietree.random
            - localshops.buysell
            - warpz0r.warp
            - warpz0r.worldwarp
            - warpz0r.list
    
    Code:
     Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
         [B]   inheritance: ''[/B]
            permissions:
            - dynamicmarket.access
            - dynamicmarket.buy
            - dynamicmarket.sell
            - iConomy.payment
            - Spells.commands.cast
            - Spells.commands.spells
            - Spells.cast.spawn
            - Spells.cast.frost
            - varietree.random
            - localshops.buysell
            - warpz0r.warp
            - warpz0r.worldwarp
            - warpz0r.list
    
    Code:
     Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: true
          [B]  inheritance:[/B]
            permissions:
            - dynamicmarket.access
            - dynamicmarket.buy
            - dynamicmarket.sell
            - iConomy.payment
            - Spells.commands.cast
            - Spells.commands.spells
            - Spells.cast.spawn
            - Spells.cast.frost
            - varietree.random
            - localshops.buysell
            - warpz0r.warp
            - warpz0r.worldwarp
            - warpz0r.list
    
    If we look at the inheritance as the example, it can take either NULL, and empty set of ' ', or nothing.
    My main files used null, out of the above comment you had to someone else about checking their permissions files I decided taking a look there for my problem as well wouldn't be a bad idea. I noticed that I was using nulls and thought what harm could it do to try a different convention so i erased them, and though it makes not sense to me doing so stopped the issue all together.
     
  30. Offline

    SvenBrnn

    That shouldnt be the Problem because it was Already catched befor.
    What i found:
    Code:
            permissions: null
    
    This maked some Problems (caused a Null Pointer exeption because the function returned null instad of an ArrayList.)
    I have fixed this and updated to 0.2b.

    Greetings Sven
     

Share This Page