Inactive [ADMN/WEB/SEC] Warrant 4 - Fast Forum Group Bridge [1.1-R6/1.2.2-R0.1]

Discussion in 'Inactive/Unsupported Plugins' started by Ant59, May 21, 2011.

  1. Offline

    Ant59

    • adfly link removed
    [​IMG]

    Warrant effectively allows you to control your users' permission ranks in-game through your forum/community system! I have designed this to work with Permissions 3 and SMF, however it is customisable to work with nearly any forum system using MySQL. All column names are customisable and information can be changed in the config.yml file.
    Warrant is perfect for subscription servers, where SMF subscriptions are used for example. It can grant VIP grouping as soon as the player logs in after taking out the subscription on the forum, or simply being moved rank on the forum.

    So far, I've had feedback of successful syncing with SMF, phpBB, XenForo, vBulletin, ccBoard and a few others I can't remember the names of :)

    Supports the following permissions plugins: PermissionsEx, bPermissions.
    Has Warrant been of any use to you?
    For now, this is my only source of income at university.
    Every donation is VERY much appreciated :D
    [​IMG]
    Version 4.0.3
    Version 3.2
    Just grab the JAR there, and drop it in your plugins folder! Simples ;)
    Let me know if there are any other features you want and if there are any bugs to squash!
    Currently, you will still need to create your own configuration file for Warrant to work from. Inside your plugins folder, create a folder called "Warrant", and inside there create a file called "config.yml". Here are example config.yml files for you to work from and customise as you wish. If anyone creates example files for any other forum system, I'd love to post them up here too!

    SMF (open)
    Code:
    forum:
        # Want to use information from a custom profile field instead of the user's forum username?
        multitable: false
        # Want to use a comma seperated list of additional groups to assign your member?
        use-additional-groups: true
        # If we're using phpBB3 or a forum system like it, then it's a pain in the arse to find a user's group! Are we using phpBB3?
        use-group-table: false
        # If you'd like, Warrant can look at if the member's "banned-field" is true or false and keep 'em out if it's true
        use-boolean-ban: false
        # Bung in the info on where to look for the member data
        usertable:
            # Name of the member data table
            name: smf_members
            # Field to find the group id to match those set in the "groups" section of this file
            group-field: id_group
            # If we're not using multitable mode, then which field should we look for the member's minecraft username in?
            username-field: member_name
            # And if "use-additional-groups" is enabled... where is the comma seperated list of additional groups?
            additional-groups-field: additional_groups
            # Has a player been banned? If "use-boolean-ban" is true, this field will be used to determine if the user can come in or not. OVERRIDES WHITELIST!
            banned-field:
            # If "use-additional-groups" is on, then we're going to need a way to link this user to their extra profile fields
            key-field: id_member
        # This part ONLY counts if you've used 'multitable'. Make sure to match the key-fields up!
        profiletable:
            # Name of the custom profile fields table
            name: smf_custom_fields
            # If we're going to match up the custom fields to the user's member data, then we're going to need this to match the "key-field" in the other table for each member
            key-field: id_member
            # Since we're in multitable mode, we can have a look in this table for their minecraft name instead. Clever isn't it?
            minecraft-name-field:
        # This ONLY applies if you want to use a phpBB3 style group table
        grouptable:
            name: phpbb_user_group
            key-field: user_id
            group-field: group_id
     
    # Stick your database info here
    database:
        host: 'districtmine.net'
        port: '3306'
        db: 'database'
        user: 'username'
        pass: 'password'
    # Which worlds on your server should Warrant affect the permissions for?
    worlds:
        - world
    # What you gonna tell peeps that aren't whitelisted? (PS, telling them to go and register on the forum would be a good idea. Telling them to #"@! off, would not)
    kick-message: 'Sorry, you are not permitted to login to the server at your current rank'
    # What you gonna tell peeps that are banned by your forum? (Telling these guys to #"@! off may actually be a good idea lol)
    banned-message: 'Sorry, you are not permitted to login to the server as you are banned'
    # Tell players that they've been assigned ranks when they login, or just do it silently in the background?
    notify-group-on-login: true
    # Keep out those who aren't in any group stated below (false), or shall we let them in and assign them to their default permissions group (true)?
    whitelist-default: true
    # Stick all the mappings here for any groups you wish tp be auto-ranked
    # Make sure to surround the number in single quotes (''), else it may just self-destruct and noone wants that
    # If "whitelisted" is false, then you may ommit the rank, as there will be no need to assign a rank to disallowed players
    # You must give a default group that can be assigned to those players that have been demoted from a higher rank to prevent them from keeping permissions they no longer have access to
    default-group: Member
    groups:
        # Here, normal registered members can go ahead and just join in as normal members
        '0':
            rank: Member
            whitelisted: true
        # Admins are instantly granted all there rights as found in the Permissions configuration
        '1':
            rank: Admins
            whitelisted: true
        # Let's say this group is banned for example. We can forget about the rank because they don't deserve one :)
        '2':
            whitelisted: false
    

    phpBB3 (open)
    Code:
    forum:
        # Want to use information from a custom profile field instead of the user's forum username?
        multitable: false
        # Want to use a comma seperated list of additional groups to assign your member?
        use-additional-groups: false
        # If we're using phpBB3 or a forum system like it, then it's a pain in the arse to find a user's group! Are we using phpBB3?
        use-group-table: true
        # If you'd like, Warrant can look at if the member's "banned-field" is true or false and keep 'em out if it's true
        use-boolean-ban: false
        # Bung in the info on where to look for the member data
        usertable:
            # Name of the member data table
            name: phpbb_users
            # Field to find the group id to match those set in the "groups" section of this file. This can be left blank if you are using the group-table
            group-field:
            # If we're not using multitable mode, then which field should we look for the member's minecraft username in?
            username-field: username
            # And if "use-additional-groups" is enabled... where is the comma seperated list of additional groups?
            additional-groups-field:
            # Has a player been banned? If "use-boolean-ban" is true, this field will be used to determine if the user can come in or not. OVERRIDES WHITELIST!
            banned-field:
            # If "use-additional-groups" is on, then we're going to need a way to link this user to their extra profile fields
            key-field: user_id
        # This part ONLY counts if you've used 'multitable'. Make sure to match the key-fields up!
        profiletable:
            # Name of the custom profile fields table
            name: smf_custom_fields
            # If we're going to match up the custom fields to the user's member data, then we're going to need this to match the "key-field" in the other table for each member
            key-field: id_member
            # Since we're in multitable mode, we can have a look in this table for their minecraft name instead. Clever isn't it?
            minecraft-name-field:
        # This ONLY applies if you want to use a phpBB3 style group table
        grouptable:
            name: phpbb_user_group
            key-field: user_id
            group-field: group_id
    # Stick your database info here
    database:
        host: 'localhost'
        port: '3306'
        db: 'minecraft'
        user: 'root'
        pass: 'xxxx'
    # Which worlds on your server should Warrant affect the permissions for?
    worlds:
        - world
    # What you gonna tell peeps that aren't whitelisted? (PS, telling them to go and register on the forum would be a good idea. Telling them to #"@! off, would not)
    kick-message: 'Sorry, you are not permitted to login to the server at your current rank'
    # What you gonna tell peeps that are banned by your forum? (Telling these guys to #"@! off may actually be a good idea lol)
    banned-message: 'Sorry, you are not permitted to login to the server as you are banned'
    # Tell players that they've been assigned ranks when they login, or just do it silently in the background?
    notify-group-on-login: true
    # Keep out those who aren't in any group stated below (false), or shall we let them in and assign them to the default permissions group (true)?
    whitelist-default: true
    # Stick all the mappings here for any groups you wish tp be auto-ranked
    # Make sure to surround the number in single quotes (''), else it may just self-destruct and noone wants that
    # If "whitelisted" is false, then you may ommit the rank, as there will be no need to assign a rank to disallowed players
    # You must give a default group that can be assigned to those players that have been demoted from a higher rank to prevent them from keeping permissions they no longer have access to
    default-group: Member
    groups:
        '1':
            rank: Guest
            whitelisted: true
        '5':
            rank: Owner
            whitelisted: true
        '11':
            rank: Moderator
            whitelisted: true
        '13':
            rank: Constructer
            whitelisted: true
        '14':
            rank: Builder
            whitelisted: true
        '17':
            rank: Admin
            whitelisted: true
    

    XenForo (open)
    Code:
    forum:
        # Want to use information from a custom profile field instead of the user's forum username?
        multitable: false
        # Want to use a comma seperated list of additional groups to assign your member?
        use-additional-groups: false
        # If we're using phpBB3 or a forum system like it, then it's a pain in the arse to find a user's group! Are we using phpBB3?
        use-group-table: false
        # If you'd like, Warrant can look at if the member's "banned-field" is true or false and keep 'em out if it's true
        use-boolean-ban: false
        # Bung in the info on where to look for the member data
        usertable:
            # Name of the member data table
            name: xf_user
            # Field to find the group id to match those set in the "groups" section of this file
            group-field: user_group_id
            # If we're not using multitable mode, then which field should we look for the member's minecraft username in?
            username-field: username
            # And if "use-additional-groups" is enabled... where is the comma seperated list of additional groups?
            additional-groups-field:
            # Has a player been banned? If "use-boolean-ban" is true, this field will be used to determine if the user can come in or not. OVERRIDES WHITELIST!
            banned-field: is_banned
            # If "use-additional-groups" is on, then we're going to need a way to link this user to their extra profile fields
            key-field:
        # This part ONLY counts if you've used 'multitable'. Make sure to match the key-fields up!
        profiletable:
            # Name of the custom profile fields table
            name:
            # If we're going to match up the custom fields to the user's member data, then we're going to need this to match the "key-field" in the other table for each member
            key-field:
            # Since we're in multitable mode, we can have a look in this table for their minecraft name instead. Clever isn't it?
            minecraft-name-field:
        # This ONLY applies if you want to use a phpBB3 style group table
        grouptable:
            name:
            key-field:
            group-field:
     
    # Stick your database info here
    database:
        host: '*HOST*'
        port: '3306'
        db: '*DATABSE*'
        user: '*USERNAME*'
        pass: '*PASSWORD*'
    # Which worlds on your server should Warrant affect the permissions for?
    worlds:
        - world
    # What you gonna tell peeps that aren't whitelisted? (PS, telling them to go and register on the forum would be a good idea. Telling them to #"@! off, would not)
    kick-message: 'Maintenance going on. Connect later.'
    # What you gonna tell peeps that are banned by your forum? (Telling these guys to #"@! off may actually be a good idea lol)
    banned-message: 'Sorry, you are not permitted to login to the server as you are banned'
    # Tell players that they've been assigned ranks when they login, or just do it silently in the background?
    notify-group-on-login: true
    # Keep out those who aren't in any group stated below (false), or shall we let them in and assign them to their default permissions group (true)?
    whitelist-default: true
    # Stick all the mappings here for any groups you wish tp be auto-ranked
    # Make sure to surround the number in single quotes (''), else it may just self-destruct and noone wants that
    # If "whitelisted" is false, then you may ommit the rank, as there will be no need to assign a rank to disallowed players
    # You must give a default group that can be assigned to those players that have been demoted from a higher rank to prevent them from keeping permissions they no longer have access to
    default-group: guest
    groups:
        # Here, normal registered members can go ahead and just join in as normal members
        '1':
            whitelisted: false
        '2':
            whitelisted: false
        '3':
            rank: admin
            whitelisted: true
        '4':
            rank: mod
            whitelisted: true
    

    Joomla and ccBoard (open)
    Warning! This one includes only the forum section! You will need to get the rest of the config from one above.


    What is new in version 2?
    This version has been completely written from scratch. It is extremely improved in performance, processing everything in a separate thread to avoid lag when someone logs in. Although this method waits for a non-whitelisted player to enter the game before kicking them, it does stop any lag from Warrant when anyone joins the game. You can now whitelist individual groups, and you can control which worlds Warrant alters Permissions in. You can also set Warrant to apply additional groups to players by looking into a comma separated list in of additional groups in one of your database fields. Please let me know if you want anything else from Warrant!

    What is new in version 3?
    Permissions support! Warrant now supports a large array of permissions plugins. Unfortunately because Warrant manipulates grouping of players, it means that it has to individually support the different plugins and the way that they change the player's groups, and since there is no standard here, I have to individually code in extra parts for any new permissions plugin that users want me to support, so please let me know if any more are wanted!

    Changelog

    4.0
    + Added support for the new Bukkit events system
    - Dropped support for Permissions 2.x
    - Dropped support for Permissions 3.x
    ~ Made some minor adjustments for speed and threading

    3.2
    ~ Fixed all the class not found errors

    3.1
    ~ Worked all the bugs out of using multiple permissions managers
    ~ Fixed most of the class not found errors

    3.0.4
    ~ After the trouble of getting my test server to work again, I can't even remember what I changed, but I remember adding something and fixing a few things lol)

    3.0.3
    ~ Checks Permissions version using string instead of double

    3.0.2
    ~ Compatible with CraftBukkit 1240
    ~ Fixed group naming (removed formatting for console)

    3.0.1
    ~ Compiled against JDK6
    ~ Fixed error with bPermissions

    3.0
    + Now works with bPermissions, PermissionsEx, Permissions 3 and partially (hopefully lol) Permissions 2
    + Requires a default-group node in the config to specify a group which a player should be assigned when they no longer get set by the forum to solve a security issue

    2.5
    ~ Fixed major security issue when players are demoted to the default group
    ~ Fixed spelling mistake and variable reference error when notifying additional groups

    2.4
    ~ Changed the getUserObject and getGroupObject methods to their safe counterparts to prevent an error for users who aren't registered in Permissions yet

    2.3.1
    ~ Fixed event register in onEnable to the correct event

    2.3
    ~ Changed event to player join instead of player login to avoid major error

    2.2.2
    + Check to see if Permissions world exists for worlds in the config

    2.2.1
    + Check to see if user has parent groups before trying to remove them

    2.2
    + Added phpBB3 functionality and the ability to set a separate table for group keys

    2.1
    + Added banning ability from forum table flag
    + Added on kick/on ban messages
    ~ Corrected an inverted boolean setting for whitelisting guests

    2.0
    ~ Complete recode of the plugin from scratch with efficiency at the heart of it
    ~ All Warrant processing is now threaded to prevent server lag when someone logs in
    + Added TONS of new features, most things that people had asked for from the new version

    Old Post (v1.2 and backward) (open)

    Go ahead and grab v1.2 for your server now...

    Download JAR: http://dl.dropbox.com/u/29840218/Warrant.jar
    Download MySQL Connector: http://dl.dropbox.com/u/29840218/mysql.jar

    Installation
    1. Place Warrant.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
    3. Requires EssentialsGroupManager.jar! Add this to your plugins folder too, from the Essentials plugin suite.
    4. It is suggested to add EssentialsGroupBridge.jar too, since this will give more compatability with plugins that only talk to Permissions instead of GroupManager. Do NOT use Permissions.jar with this plugin!
    Configuration








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


    IMPORTANT!

    You MUST create a "groups.properties" file in the plugins/Warrant folder!


    The groups.properties file takes the format of



    Code:
    #forum group id=GroupManager rank
    1=Admins
    2=Member
    Properties and explanations

    These are the properties needed to be set in the warrant.properties file...

    mysql-host - The MySQL server IP or URL

    mysql-port - Port of MySQL server (3306 by default)

    mysql-db - Database to find member data

    users-table - The table used for member data

    minecraftname-table - The OPTIONAL table used for extra data, where the user's minecraft username lies - perfect for forums that set "Minecraft username" as an additional profile field :) If left blank, the plugin will default to single table mode

    mysql-user - Name of MySQL User

    mysql-pass - Password for MySQL user

    minecraftname-field - The field which stores the user's minecraft player name. This is either on the specified table in "minecraftname-table", or it is in the default "users-table" if the former is left blank.

    group-field - The field that stores the group ids of users in "users-table"

    memberid-field - When in two table mode (see "minecraftname-table"), the field used to store the user's id in the "users-table" - used to join the two tables together

    minecraftname-table-memberid-field - When in two table mode (see "minecraftname-table"), the field used to store the user's id in the "minecraftname-table" - used to join the two tables together


    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]


    Any suggestions welcome!!

    Changelog
    • v1.2
      • Done my best to optimize the plugin in every way I can think and better error handling too
      • Updated for build 818
      • Stuck some code in ready for when Permissions add hooks to change groups. Waiting on the Permissions team now to be able to support their plugin
    • v1.1
      • Moved warrant giving method into it's own thread, therefore allowing a player to login with no lag caused by warrant to the server, and it will grant the warrant to the player when it's all finished. Max timeout of 1 minute
      • Added support to have the minecraft username on a seperate MySQL table, linked to the members' table through members' ID#s.
    • v1.0 alpha
      • Initial Release
    Want to whitelist players with forum groups instead? Use Albus
     
  2. Offline

    Ant59

    Lol yeah I will be releasing the source on GitHub when I develop the next version of Warrant for my server. You can all enjoy BukkitPerms compatibility too :D
     
  3. Offline

    darkcloud784

    This doesnt seem to be working with CB 1149 =(

    Doesnt error but doesnt promote/demote

    Heres my config, keep in mind I am using a joomla server with a phpbb3 forum bridge. This means the 'rank' fields get stored as such Registered, Author,Editor,Publisher,Manager,Administrator,Super Administrator. In that order.


    Code:
    forum:
        # Want to use information from a custom profile field instead of the user's forum username?
        multitable: true
        # Want to use a comma seperated list of additional groups to assign your member?
        use-additional-groups: false
        # If we're using phpBB3 or a forum system like it, then it's a pain in the arse to find a user's group! Are we using phpBB3?
        use-group-table: true
        # If you'd like, Warrant can look at if the member's "banned-field" is true or false and keep 'em out if it's true
        use-boolean-ban: true
        # Bung in the info on where to look for the member data
        usertable:
            # Name of the member data table
            name: jos_users
            # Field to find the group id to match those set in the "groups" section of this file. This can be left blank if you are using the group-table
            group-field:
            # If we're not using multitable mode, then which field should we look for the member's minecraft username in?
            username-field: username
            # And if "use-additional-groups" is enabled... where is the comma seperated list of additional groups?
            additional-groups-field:
            # Has a player been banned? If "use-boolean-ban" is true, this field will be used to determine if the user can come in or not. OVERRIDES WHITELIST!
            banned-field: block
            # If "use-additional-groups" is on, then we're going to need a way to link this user to their extra profile fields
            key-field: id
        # This part ONLY counts if you've used 'multitable'. Make sure to match the key-fields up!
        profiletable:
            # Name of the custom profile fields table
            name: jos_usermeta
            # If we're going to match up the custom fields to the user's member data, then we're going to need this to match the "key-field" in the other table for each member
            key-field: user_FK
            # Since we're in multitable mode, we can have a look in this table for their minecraft name instead. Clever isn't it?
            minecraft-name-field: minecraft
        # This ONLY applies if you want to use a phpBB3 style group table
        grouptable:
            name: jos_users
            key-field: id
            group-field: usertype
    # Stick your database info here
    database:
        host: '74.63.220.106'
        port: '3306'
        db: 'thehissi_jo151'
        user: 'thehissi_dark'
        pass: 'Mudracker1'
    # Which worlds on your server should Warrant affect the permissions for?
    worlds:
        - world
        - new_world
        - world_nether
        - skylands
    # What you gonna tell peeps that aren't whitelisted? (PS, telling them to go and register on the forum would be a good idea. Telling them to #"@! off, would not)
    kick-message: 'Sorry, you are not permitted to login to the server at your current rank'
    # What you gonna tell peeps that are banned by your forum? (Telling these guys to #"@! off may actually be a good idea lol)
    banned-message: 'Sorry, you are not permitted to login to the server as you are banned'
    # Tell players that they've been assigned ranks when they login, or just do it silently in the background?
    notify-group-on-login: true
    # Keep out those who aren't in any group stated below (false), or shall we let them in and assign them to the default permissions group (true)?
    whitelist-default: true
    # Stick all the mappings here for any groups you wish tp be auto-ranked
    # Make sure to surround the number in single quotes (''), else it may just self-destruct and noone wants that
    # If "whitelisted" is false, then you may ommit the rank, as there will be no need to assign a rank to disallowed players
    groups:
        'Registered':
            rank: Builder
            whitelisted: true
        'Author':
            rank: VIP
            whitelisted: true
        'Editor':
            rank: Moderator
            whitelisted: true
        'Publisher':
            rank: Moderator
            whitelisted: true
        'Manager':
            rank: Moderator
            whitelisted: true
        'Administrator':
            rank: Moderator
            whitelisted: true
        'Super Administrator':
            rank: Admins
            whitelisted: true
    Edit:
    I lied there is an error:
    Code:
    2011-09-20 09:15:29 [INFO] adamfaw1 [/204.117.91.134:49554] logged in with entity id 209541 at ([world] 1896.6586927730139, 67.0, 1009.4296023797491)
    2011-09-20 09:15:29 [INFO] [Warrant 2.5] Detected login of adamfaw1
    2011-09-20 09:15:29 [SEVERE] Exception in thread "Thread-29774"
    2011-09-20 09:15:29 [SEVERE] java.lang.NoSuchMethodError: com.alta189.sqlLibrary.MySQL.DatabaseHandler.<init>(Lnet/districtmine/warrant/WarrantSql;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    2011-09-20 09:15:29 [SEVERE] 	at net.districtmine.warrant.WarrantSql.initialize(WarrantSql.java:25)
    2011-09-20 09:15:29 [SEVERE] 	at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:38)
    2011-09-20 09:15:29 [SEVERE] 	at java.lang.Thread.run(Thread.java:722)
     
  4. Offline

    Ant59

    Okay, this is the second time that that error has appeared, so I'm guessing that the Bukkit API for handling MySQL database connections has changed somewhere. I will have an update sometime in the next few weeks once I've got through freshers week at uni.
     
  5. Offline

    robater

    Hey, i was all ready for this plugin, i setup mysql, websites, and much more... But at the end when i tried the plugin, it didnt make a folder (Warrant.etc) in my plugins folder. I'm guessing you didnt update the plugin for 1185 version of craftbukket. Would you please update because i really need this plugin fast.
     
  6. Offline

    Ant59

    Please read the OP. It will explain that Warrant does not create it's own folder, and you need to do that along with the config.yml file. Warrant works fine with CB#1185 currently.
     
  7. Offline

    tee jay

    Is there a WGET friendly download?

    Also, +1 for Permissions/BukkitPerms support.
     
  8. Offline

    Freedom67

    Hello !

    I have few problems with your plugin.. in particular with the case sensitive in the SQL query which select the username in the users table.
    Can you correct this please ? Or just send me a special version with this correction.

    Thanks you.
     
  9. Offline

    Kane

    @Ant59 this looking amazing but damn I don't know how to even start to get it to work right with Xenforo and the system I have. I don't know if you would be up for a "donation" for assistance hehe. But here is what I have.

    Xenforo:
    - Using Built In Upgrades System!
    I have 6 options right now:
    - Whitelist
    - PVP
    - Nether
    - VIP1
    - VIP2
    - VIP3

    I have not used any kind group system yet through xenforo example if you get VIP 1 you get to join Group VIP 1 on the forums as it seams to be broken my forum permissions mess up when you make a user part of a group even as secondary and i don't think you can even switch their main group.

    Pretty much instead I use this script to generate my permissions:

    Code:
    <?php
    $dbhost = 'localhost';
    $dbuser = 'xxxxxx';
    $dbpass = 'xxxxxx';
    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
    $dbname = 'xxxxxx';
    mysql_select_db($dbname);
    $q = mysql_query('SELECT u.username as username, up.user_upgrade_id as group_id
    FROM xf_user u, xf_user_upgrade_active up
    WHERE up.user_id = u.user_id
    AND (up.user_upgrade_id = 3 OR up.user_upgrade_id = 4 OR up.user_upgrade_id = 5 OR up.user_upgrade_id = 2 OR up.user_upgrade_id = 6)
    ORDER BY u.username asc') or die(mysql_error());
    $excludedPeople = array("kane_hart","sniper3","zach00123","quizzbee","madcat1030","electrobot","pjstorm12","kooj","bodydrag","sudohf","confuzzledyma","flqw");
    $groupUsers = array();
    $groupNameIndex = array();
    while($row2 = mysql_fetch_array($q)){
        $name = strtolower($row2['username']);
        $canWrite = 1;
        $existingEntry = 0;
        for ($i = 0; $i < (count($excludedPeople)); $i++) {
            if($name == $excludedPeople[$i]){
                $canWrite = 0;
            }
        }
        for($i = 0; $i < (count($groupNameIndex)); $i++){
            if($groupNameIndex[$i] == $name){
                $existingEntry = 1;
            }
        }
        if($existingEntry == 0 && $canWrite == 1){
            $groupNameIndex[count($groupNameIndex)+1] = $name;
        }
        if($canWrite == 1){
            $group_id = $row2['group_id'];
            $groupUsers[$name] .= ",".$group_id;
        }
    }
    for($i = 1; $i < count($groupNameIndex); $i++){
        if(strstr($groupUsers[$groupNameIndex[$i]],"5")){
            $group = "VIP3";
        }else if(strstr($groupUsers[$groupNameIndex[$i]],"4")){
            $group = "VIP2";
        }else if(strstr($groupUsers[$groupNameIndex[$i]],"3")){
            $group = "VIP1";
        }else{
            $group = "";
        }
        echo "&nbsp;&nbsp;&nbsp;&nbsp;'$groupNameIndex[$i]':</br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group:<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- $group<br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permissions:<br/>";
        if(strstr($groupUsers[$groupNameIndex[$i]],"2") || $group == "VIP3"){
            echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- stargate.network.PVP-NET<br />";
        }
        if(strstr($groupUsers[$groupNameIndex[$i]],"6") || $group == "VIP3"){
            echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- stargate.network.Nether<br />";
        }
    
    }
    The way the permissions system works my Moderators at the top of the permissions file was getting overridden by lower level stuff generated by this php script so I have a field here to filter them out...

    This works perfect but it has to be done by hand.

    Then I paste this script into my permissions.

    Here is a example of the generation it creates:
    Code:
        'fgdfgdf':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'abfdgfdstr':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'afsdgsdfgn':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'ahfgjfghk':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'ahhhhren':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'afsdgdfshdfgr':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'asdfrgdfgdfr':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'afsdgvsdfgdfgr':
            group:
            - VIP3
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'asrfdgsdfgdfb':
            group:
            - VIP3
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'asfgsfdgsfdr':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'afsdgsdfgsdfr':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'ansfdgsdfgffn':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'afsdgsdfgsdfn':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'angfdjgfjfdg0':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'angfdhgfhfgdr':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'argfdhfghdfgo':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
        'asgdfhfghdfgo':
            group:
            - VIP2
            permissions:
        'asdgfhdfghdfgn':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'ahgdfhdfgen':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'audgfhdfghfgm':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'augfdhfghdfgm':
            group:
            -
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
        'bdgfhfgfgde':
            group:
            - VIP3
            permissions:
            - stargate.network.PVP-NET
            - stargate.network.Nether
    Worst looking stuff ever but it does work. All I did is generate the php copy/paste and /pex reload
     
  10. Offline

    Ant59

    Will start looking into actually getting Warrant 3.0 coded sometime soon now that I have a bit of spare time again :) I'll try and fix any bugs that people have posted, and will include as many features that people have asked for as possible.

    • Bukkit Permissions will be the main new feature
    • Auto-generating config/folder
    • @Freedom67, I'll make it case-insensitive for you :)
    • @Kane, I'll look into the info you've posted here and look into Xenforo a bit more to make it do what you need it to do :)
    I'm not a magician, so give me some time and I'll try my best to get a new release out soon! :)
     
  11. Offline

    Daje

    Does this include looking into any potential phpBB3 compatibility errors? I appreciate all the work you do, and please take your time with this. I just want to make sure all bugs get addressed. It's just the same error I keep having, and others using phpBB as well keep having the same errors of an invalid SQL syntax.
     
    Ant59 likes this.
  12. Offline

    Ant59

    I will add it to my todo list for you :)
     
    Daje likes this.
  13. Offline

    Daje

    Thank you very much, I really appreciate you taking the time to look into everything :)
     
  14. Offline

    MuttsNuts

    This is Epic! Any chance of supporting the old and tired but trusty Phoenix Permissions 2.7.4. I was wandering the other day whether such a thing would be possible while creating SMF ranks and it actually seems it is possible :D
     
  15. Offline

    Ghezzo

    Is it possible to make this work with PermissionsEx?
     
  16. Offline

    Ant59

    On the todo list!

    Updated to version 3.0! Check out the changelog :) Now I'm off to bed haha :D

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

    jasvecht

  18. Offline

    Ant59

    Oops! I compiled against JDK7 accidentally. Will fix when i get home.
     
  19. Offline

    jasvecht

    On Java JRE 1.7 :

    12:53:11 [SEVERE] Error occurred while enabling Warrant v3.0 (Is it up to date?): null
    java.lang.NullPointerException
    at net.districtmine.warrant.WarrantPermissionsHandler.initialize(WarrantPermissionsHandler.java:33)
    at net.districtmine.warrant.Warrant.onEnable(Warrant.java:54)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:920)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:278)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:297)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:284)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:152)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)



    Edit: Using bPermissions by the way.
     
  20. Offline

    Ant59

    Fixed (I think). Try 3.0.1.
     
  21. Offline

    jasvecht

  22. Offline

    Ant59

    Third time lucky! 3.0.2 released to fix your error and updated for the new CraftBukkit build :)
     
  23. Offline

    K3V1N32

    Running 1240
    using EssentialsGroupManager
    in your permissions handler line 34 appears to be the line at which you check whether or not permissions is below 2.0, and permissions seems to have a version number formatted like this [#.#.#] not [#.#] :(
    I'm guessing GroupManager sends a differently formatted version through fake permissions.
    Show Spoiler

    Code:
    00:09:32 [SEVERE] Error occurred while enabling Warrant v3.0 (Is it up to date?)
    : multiple points
    java.lang.NumberFormatException: multiple points
            at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
            at java.lang.Double.parseDouble(Unknown Source)
            at net.districtmine.warrant.WarrantPermissionsHandler.initialize(Warrant
    PermissionsHandler.java:45)
            at net.districtmine.warrant.Warrant.onEnable(Warrant.java:54)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:906)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:278)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:173)
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:156
    )
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:297)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:284)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:152)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:348)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    
     
  24. Offline

    Ant59

    Fixed. 3.0.3 uses substring to check the version number instead now :)
     
    K3V1N32 likes this.
  25. Offline

    Delande

    I'm getting errors with this:

    Code:
    2011-10-04 13:44:00 [INFO] [Warrant 3.0] Detected login of Delande
    2011-10-04 13:44:00 [WARNING] [Warrant 3.0 SQL] Error at SQL Query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username = 'Delande'' at line 1
    2011-10-04 13:44:00 [WARNING] [Warrant 3.0 SQL] Error at SQL Query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username = 'Delande'' at line 1
    2011-10-04 13:44:00 [WARNING] [Warrant 3.0 SQL] Error at SQL Query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username = 'Delande'' at line 1
    2011-10-04 13:44:00 [SEVERE] Exception in thread "Thread-15"
    2011-10-04 13:44:00 [SEVERE] java.lang.NullPointerException
    2011-10-04 13:44:00 [SEVERE]     at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:59)
    2011-10-04 13:44:00 [SEVERE]     at java.lang.Thread.run(Thread.java:662)
    2011-10-04 13:44:00 [SEVERE] Exception in thread "Thread-17"
    2011-10-04 13:44:00 [SEVERE] java.lang.NullPointerException
    2011-10-04 13:44:00 [SEVERE]     at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:59)
    2011-10-04 13:44:00 [SEVERE]     at java.lang.Thread.run(Thread.java:662)
    2011-10-04 13:44:00 [SEVERE] Exception in thread "Thread-16"
    2011-10-04 13:44:00 [SEVERE] java.lang.NullPointerException
    2011-10-04 13:44:00 [SEVERE]     at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:59)
    2011-10-04 13:44:00 [SEVERE]     at java.lang.Thread.run(Thread.java:662)
    Clean bukkit install running only the latest versions of permissions stuff and warrant, with a clean install of phpbb3.
     
  26. Offline

    Ant59

    You have an extra ' after your username. You cannot use this as it isn't escaped in the SQL string.
     
  27. Offline

    strontkever

    hi i got a question:

    i use bpermissions and setup the config for warrant,

    my question is: is it possible to make warrant add a group to players instead of replacing their ranks with the single rank in the config, since i only want to change their rank as they register, and promote them in-game later on aswell

    becuase when i ran warrant, donators/member turned "newbie" (the rank everyone has on the smf forum) and lost their other ranks .. (adding newbie would not affect their "higher" rank)

    im not about sorting 2500+ members on the forum to know what rank they got


    i could take some more effort reading etc but i ran out of time for today ;)

    gr
     
  28. Offline

    patey

    been using warrant for almost 2 months, new version causes an errror, then it continues to fill my console with random errors untill it crashes
     
  29. Offline

    [qwerty]

  30. Offline

    Ant59

    Sorry but as of yet I haven't got around to programming additional groups for bPermissions. Will do it very soon for you :)

    Not good at all :( Sorry I've messed it up for your server. Can you please provide the error log though so that I ca fix it?

    You're about the gazillionth person to ask this. Yes, you just need to configure it correctly.
     
    [qwerty] likes this.
  31. Offline

    patey

    Code:
    2011-10-04 20:38:38 [INFO] [Warrant 3.0] Detected login of dsqed
    2011-10-04 20:38:39 [INFO] [Warrant 3.0] dsqed has not registered and belongs to default group
    2011-10-04 20:38:40 [WARNING] Can't keep up! Did the system time change, or is the server overloaded?
    2011-10-04 20:38:40 [SEVERE] java.lang.NullPointerException
    2011-10-04 20:38:40 [SEVERE]     at com.nijiko.permissions.PermissionWorld.safeGetGroup(PermissionWorld.java:113)
    2011-10-04 20:38:40 [SEVERE]     at com.nijiko.permissions.ModularControl.safeGetGroup(ModularControl.java:457)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantPermissionsHandler.setGroup(WarrantPermissionsHandler.java:103)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantProcess.putInDefault(WarrantProcess.java:25)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:115)
    2011-10-04 20:38:40 [SEVERE]     at java.lang.Thread.run(Unknown Source)
    2011-10-04 20:38:40 [INFO] [Warrant 3.0] Set group of dsqed to null
    2011-10-04 20:38:40 [SEVERE] java.lang.NullPointerException
    2011-10-04 20:38:40 [SEVERE]     at com.nijiko.permissions.PermissionWorld.safeGetGroup(PermissionWorld.java:113)
    2011-10-04 20:38:40 [SEVERE]     at com.nijiko.permissions.ModularControl.safeGetGroup(ModularControl.java:457)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantPermissionsHandler.setGroup(WarrantPermissionsHandler.java:120)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantProcess.putInDefault(WarrantProcess.java:25)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:115)
    2011-10-04 20:38:40 [SEVERE]     at java.lang.Thread.run(Unknown Source)
    2011-10-04 20:38:40 [INFO] [Warrant 3.0] Set group of dsqed to null
    2011-10-04 20:38:40 [SEVERE] Exception in thread "Thread-707"
    2011-10-04 20:38:40 [SEVERE] java.lang.NoClassDefFoundError: ru/tehkode/permissions/bukkit/PermissionsEx
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantPermissionsHandler.setGroup(WarrantPermissionsHandler.java:134)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantProcess.putInDefault(WarrantProcess.java:25)
    2011-10-04 20:38:40 [SEVERE]     at net.districtmine.warrant.WarrantProcess.run(WarrantProcess.java:115)
    2011-10-04 20:38:40 [SEVERE]     at java.lang.Thread.run(Unknown Source)
    havent found the main error yet (if there is one) it manages to repeat the [SEVERE] lines a lot before i can close it
     

Share This Page