[ADMIN] Promotions v0.3 - Web based user management

Discussion in 'Bukkit Tools' started by jlogsdon, Jan 28, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    jlogsdon

    Promotions - Web base user management
    Version: v0.3

    As far as I can tell there is no easy way to handle promotions through groups you define in the Permissions plugin. This aims to change that! It's a simple web-based script that gives your users the ability to request a promotion through a form. Once they have requested a promotion you (and anyone else you give access) will have the option to approve or decline a request, at which point the config.yml file for Permissions will be updated (if approved).

    This plugin works with Nijikokun's Permissions plugin only!

    Installation details are in the README provided with the source.

    Features:
    • Users can request promotions
    • Automatically determine which group a user should be promoted to (via configuration)
    • Decline a promotion request if they are at the highest tier allowed by the configuration
    Download: https://github.com/downloads/jlogsdon/bukkit-perms/bukkit-perms-0.3.tar.gz
    Source Code: https://github.com/jlogsdon/bukkit-perms

    Plans:
    • Group Management, including permission settings
    • Full user management
    Changelog:
    Version 0.3
    • Switched over to sfYaml for more consistent Yaml parsing.
    • Minor fixes
    Version 0.2
    • Fixed a bug in the YAML writer that involved special characters in values.
    Version 0.1
    • Initial release!
    --- merged: Jan 29, 2011 1:55 AM ---
    Version 0.2 released. Fixes a bug in the YAML output that broke parsing by the Permissions plugin.
     
  2. Offline

    Nijikokun

  3. Offline

    McAndze

    Great job, though I haven't tried it yet! Already found a use for it ^^
     
  4. Offline

    GmK

    Sounds great - thanks!

    I havent yet looked around, but how well secured is it against injections and whatever?

    Also, does it work with the re-formatted Permissions config.yml file that Essentials creates when you use the /mod command?
    --- merged: Jan 29, 2011 12:56 PM ---
    Indeed, seems to not work properly :/

    My permissions file looks like this (excerpt)

    PHP:
    Admins:
        default: 
    false
        info
    : {prefix'[&3Admin&f]&4 'suffix'&4'buildtrue}
        
    inheritance: [Controllers]
        
    permissions: ['*']

    users:
      
    GmK:
        
    groupAdmins
        permissions
    :
             
    prefix''
             
    suffix'&4Hot'
      
    The_Phantom:
        
    groupAdmins
        permissions
    : []
      
    Deadl0ck:
        
    groupMiners
        permissions
    : []
    Stacktraces: http://pastebin.com/ifcwuFZf
     
  5. Offline

    jlogsdon

    It uses prepared statements for any access to the sqlite database. As far as ensuring the usernames themselves are not going to cause issues that's left up to the admin(s) on the approval screen at this point.

    It should spit back out the exact same YAML file plus whatever needs to be changed for the approval. As for those errors:

    1. My yaml parser is apparently incomplete. I'll work on it tomorrow so it can parse your file.
    2. Either make the data/ directory writable by your webserver or copy the data/base.db file to data/site.db. Forgot this part in the readme.
     
  6. Offline

    shadrxninga

    Can this be used with a web server that is on a different box to the minecraft server. This looks great!
     
  7. Offline

    JWhy

    Sounds great, but I'm gettin this PHP-error, when trying to launch the index.php after setting up the config.php:
    Code:
    Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /var/www/vhosts/******/mc/include/ClassLoader.php on line 6
    
    Fatal error: Class 'Promotion' not found in /var/www/vhosts/******/mc/config.php on line 7
     
  8. Offline

    jlogsdon

    No, it needs direct access to the Permissions/config.yml file currently.

    Ah, that is a PHP 5.3 only constant. I'll remove it so it will work with earlier versions.
    --- merged: Jan 31, 2011 4:51 PM ---
    I've switched Yaml parsers, your permissions file should work correctly now.
     
  9. Offline

    GmK

    Thank you for working on this still!

    Unfortunately the reader still seems to have troubles :/ Tbh - if you dont want to edit it yet again I could fully understand. Especially since bukkit will soon have a proper permissions system that uses *yet* another way.

    But fyi, this is the error:

    Code:
    Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to parse file "/home/smp/mcadmin/plugins/Permissions/config.yml": Malformed inline YAML string [essentials.spawn, lwc.protect, mywarp.warp.basic.warp, mywarp.warp.basic.list,' in /home/smp/smpweb/apply/include/sfYaml.php:100 Stack trace: #0 /home/smp/smpweb/apply/include/Config.php(12): sfYaml::load('/home/smp/mcadm...') #1 /home/smp/smpweb/apply/users.php(16): Config::load() #2 {main} thrown in /home/smp/smpweb/apply/include/sfYaml.php on line 100 
    And this is how the line looks like in my config.yml:

    PHP:
    groups:
      
    Guests:
        default: 
    true
        info
    : {prefix'[Guest] 'suffix''buildtrue}
        
    inheritance: []
        
    permissions: [essentials.spawnlwc.protectmywarp.warp.basic.warpmywarp.warp.basic.list,
          
    mywarp.warp.sign.warpmyhome.home.basic.*, essentials.afkessentials.msg,
          
    essentials.kitessentials.kit.starteressentials.mailessentials.mail.send,
          
    essentials.getposessentials.list, myhome.home.soc.othersvote.vote]
      
    Crafters:
        default: 
    false
        info
    : {prefix'[&3Crafter&f]&7 'suffix'&7'buildtrue}
        
    inheritance: [Guests]
        
    permissions: [/locatemywarp.warp.basic.*, mywarp.warp.soc.private, myhome.home.soc.*,
          
    essentials.depth]
    Cheers!
     
  10. Offline

    Seidr

    As a quick note - if anyone is having trouble with the admin login, you may want to check this StackOverflow question: http://stackoverflow.com/questions/3663520/php-auth-user-not-set

    Apparently PHP has a hard time using the Auth mod when under CGI/FCGI mode. Change your Apache webserver to use Mod-PHP on the vhost this runs on.
     
  11. This is promoting my users to Default, which is quite annoying, as they have to ask for a promotion twice :p.

    Fixed... Just moved my Member group above Default.
     
  12. Sounds good to me. Just gotta test it out. This will make this side of server management alot easier hopefully.

    Thanks for sharing.

    [​IMG]
     
  13. Offline

    jlogsdon

    Hmm... not sure why it thinks its malformed... I was hoping the Symfony parser would suck less than mine but apparently not :p

    Since the permissions system should be here soon I think I'm going to hold off on any updates until it's finished; sorry it's not working correctly for you.
    --- merged: Feb 1, 2011 6:09 PM ---
    Yeah, I noticed that the other day. A simple fix is to add the "Default" group to your Promotion::$skipGroups in config.php.
     
  14. Ah, thanks. Didn't know there was a skipGroups option, it's not in the config-dist that came with this :p.
     
  15. Offline

    jlogsdon

    I lied, it's actually Promotion::$noPromote. The name is misleading, but anything in that array will be ignored when reading your group list. So if you ignore "Default" the next one in your list will be the first group for new users.
     
  16. Offline

    EvilSeph

  17. Offline

    jlogsdon

    What am I missing? I've looked over the guidelines a few times and I thought I had everything covered.
     
  18. Offline

    AbsolutePolak

    When a person first asks for a promotion, its fine it goes to the first rank, but if they ask again, they ask if it could go to the highest rank there is. Can you help me with this?
     
  19. Offline

    EvilSeph

    I fixed it, thanks for checking though :)
     
  20. Offline

    scar413

    hi, i use this tool and its awesome, but could you make it compatible with groupmanager? i tryed it, but i failed at the yaml parser
     
Thread Status:
Not open for further replies.

Share This Page