[REQ] Simple plugin to call a .php file (very simple)

Discussion in 'Archived: Plugin Requests' started by Fronix, Apr 27, 2012.

  1. old post got deleted, dunno if because I missed this form or if there already is a plugin (i did search)​
    Plugin category: Admin

    Suggested name: McCall (dunno lol^^)

    A bit about me: I run Minecraft Hell a survival server.

    What I want: I need a plugin, a very simple one, that can call a .php file with the necessary parameters (http://mysite.com/myfile.php?whatever=lol). I need this plugin because I want to upgrade my XenForo users secondary groups but doing that via SQL is (according to XenForo) not recomended since you need to rebuild user caches and the secondary_groups is stored in a comma list so it makes that tricker as well.​
    It does not have to be all fancy and epic just a small two command plugin.
    Ideas for commands:
    /mccall promote <User> <Rank> (has to be numeric)​
    /mccall demote <User> <Rank> (has to be numeric)​

    Ideas for permissions:
    I only want the Console and OPs to be able to use these commands.​

    When I'd like it by: As fast as possible.

    Similar plugin requests: I don't think there is.

    Devs who might be interested in this: @TnT @codename_B (have no idea :p)​
     
  2. Offline

    thernztrom

    I second this. :)
     
  3. Offline

    Ne0nx3r0

    What might prove useful to more users would be something that makes the request based on items defined in a YML file, something like:
    Code:
    promote:
        url: http://somesite.net/page.php
        type: get
        params: [name,rank]
        data:
            token: private_token
    
    Then (for any player with "plugin.promote" permission / any OP) it could translate:
    /call promote Ne0nx3r0 VIP

    into this http request:
    http://somesite.net/page.php?name=Ne0nx3r0&rank=VIP&token=private_token

    The token is a kludge version of security, but that needs to be addressed someplace. For kicks the request might also just include the playerName and IP of whoever sent the request.

    I'm going to work on making this as a plugin for releasing, but if someone else wants to fullfill Fronix's specific request in the meantime, I wont try to stand in your way :).
     
  4. Offline

    nathanaelps

    As ne0nx3r0 suggests, there are a madpassel of security issues to be addressed. If you're willing to take those on yourself, I have a nasty little plugin for you:

    https://docs.google.com/open?id=0ByFi6ReIbRPdY2toeTE4VWR1cVk

    Then again, if you're exposing PHP files to the interweb in such a way that Just Any Web User can interact with them, you might need to thoroughly rethink your hosting strategy... not just your taste in plugins.

    p.s. This doesn't just promote/demote, it only calls a PHP file. Like I said, you deal with security.

    -nathanaelps

    on bukkitdev:

    http://dev.bukkit.org/server-mods/mccurl/

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

    Ne0nx3r0

    A word of warning about this approach: the URL is being called synchronously, meaning while the page is loading, your server will halt all operations until it finishes. Even if the page loads quickly, your players will probably start noticing some lag spikes if you use the command too often. (I could be mistaken)

    I'll have something released in a few days (unless some unseen kink holds me up), but if your server is small, the page loads fast, and you aren't calling web pages too often you probably wont notice an issue with this plugin. For larger servers though, or if your web site occasionally takes a few moments to load/is unavailable, I would be wary about using this in production.
     
  6. Offline

    nathanaelps

    Thanks for the thought. It should now start its own thread when getting the URL:

    https://docs.google.com/open?id=0ByFi6ReIbRPdUmJicm5Bc3k3V0k
     
    ne0nx3r0 likes this.
  7. Offline

    Ne0nx3r0

  8. Offline

    nathanaelps

  9. Offline

    nathanaelps

    thernztrom likes this.

Share This Page