thePEXinator - Handy PEX SQL manager

Discussion in 'Bukkit Tools' started by Brant Wladichuk, Jan 13, 2012.

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

    Brant Wladichuk

    nala3

    Nice. I'll be sure to fix that for the next release. Thanks for pointing it out! :)

    But for now, I added a note on the thread
     
  2. Offline

    nala3

    Brant Wladichuk is the group editor going to be implemented next update as well?
     
  3. Offline

    Brant Wladichuk

    nala3

    Workin on it. Gonna be delayed a bit :/
     
  4. Offline

    teku

    Love this! I appreciate your efforts and hope my small donation can help you.

    The only concern I have is if there were to be multiple people editing permissions at the same time, if something would happen.

    EDIT: Just saw the "Next update will include the ablilty to add new users to the panel" lol
     
  5. Offline

    Brant Wladichuk

    teku

    Thanks for the donation! I really appreciate it


    I'm trying to get the next update out as fast as possible. Real life has be just crazy for me lately :/
     
  6. Offline

    teku

    You deserve it.

    I had to rename formkey.class.php -> formKey.class.php and update index.php to match.

    I love the special error page too. Take your time, this is great.
     
  7. Offline

    zeeveener

    Waiting for the newest version to come out. Curious though, does it still work normally with the currently released version?

    EDIT: I tried installing it using BukkitHTTPD and I get this when clicking Next Step whilst installing...
    Show Spoiler
    Code:
    Warning: fopen(../includes/config.php) [function.fopen]: failed to open stream: No such file or directory in - on line 23
     
    Warning: fwrite() expects parameter 1 to be resource, boolean given in - on line 30
     
    Warning: fclose() expects parameter 1 to be resource, boolean given in - on line 31
     
    Warning: chmod() [function.chmod]: No such file or directory in - on line 33
     
    Warning: Cannot modify header information - headers already sent by (output started at -:23) in - on line 65
     
  8. Offline

    teku

    The file "config.php" appears to be missing. Check the includes directory for the file, maybe you need to create it. Here are the contents of mine (slightly edited):

    PHP:
    <?php
    $settings
    ['mysql']['host'] = 'localhost';
    $settings['mysql']['username'] = 'user';
    $settings['mysql']['password'] = 'password';
    $settings['mysql']['database'] = 'database_name';
    ?>
     
  9. Offline

    zeeveener

    I can assure you it's there lol. It just can't see the file. I don't know. I guess i will wait for an update or something.
     
  10. Offline

    Jimmy341

    Hey Brant awesome work with this! Install went well and now i have linked up web send every time i update something in group or player setting i get
    http://dev.bukkit.org/paste/6614/
     
  11. Offline

    avstudio1

    I'm having a little trouble getting this to work, probably something simple.

    I'm using WAMP server Chrome browser.

    Getting an error message:

    ( ! ) SCREAM: Error suppression ignored for
    ( ! ) Fatal error: SQL in C:\wamp\www\templates\home.php on line 214
    Call Stack
    #TimeMemoryFunctionLocation
    1 0.0005 148840 {main}( ) ..\index.php:0
    2 0.0156 227432 require( 'C:\wamp\www\templates\home.php' ) ..\index.php:78
    3 0.0162 227976 trigger_error ( ) ..\home.php:214


    Which config file are you referring to?
    >>>>>>>>>>>>>>>>>>>>>>>>>>
    Make sure the config has these lines:
    Code:
    PASS=yourpasswordhere
    WEBLISTENER_ACTIVE=true
     
  12. Offline

    WhitePhoenix0

    Okay, so I have a dedicated server that I only have ftp access to, can I still install this?
     
  13. Offline

    philulrich

    So I got this same error when installing. Seems to be a bug on clean install. Fixed it by manually editing/renaming config file. I'd like to know if you are still continuing development on this, it's so helpful! It's just missing the ability to add users or groups. Cheers mate!


    EDIT: Since this is so useful... and I love you... and I know a little PHP, I'm working on fixing things up. I'll post fixes here as I get them done.

    First Fix: Display Groups properly (will not allow you to edit [yet...])
    Show Spoiler

    In file: classes/pexinator.class.php

    Find:
    PHP:
    function groupListArray()
        {
            
    $this->connect();
            
    $query mysql_query("SELECT * FROM permissions WHERE permission = 'rank' ORDER BY id ASC");
            
    $groupArray = array();
            while(
    $data mysql_fetch_assoc($query))
            {
                
    $groupArray[] = $data['name'];
            }
            return 
    $groupArray;
            
    $this->disconnect();
        }

    Replace With:
    PHP:
    function groupListArray()
        {
            
    $this->connect();
            
    $query mysql_query("SELECT * FROM permissions_entity WHERE type = '0' ORDER BY id ASC");
            
    $groupArray = array();
            while(
    $data mysql_fetch_assoc($query))
            {
                
    $groupArray[] = $data['name'];
            }
            return 
    $groupArray;
            
    $this->disconnect();
        }


    Second Fix: Fix the insertion/deletion (groups will work now.)
    Show Spoiler

    In file: process.php

    Find:
    PHP:
    require(ROOT 'classes/formKey.class.php');
    Replace With:
    PHP:
    require(ROOT 'classes/formkey.class.php');


    Third Fix: (Ugly way to) Add World in permissions list:
    Show Spoiler

    In file: templates/groupEditor.php

    Find:
    PHP:
    if($info['permission'] === 'rank')
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission'] . '</span>';
    echo 
    '<div class="right redFont">Do Not Delete</div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
    else
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission']  . '</span>';
    echo 
    '<div class="right"><input type="checkbox" name="deleteGroupPerm[]" value="' $info['id'] . '" /></div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
    Replace With:
    PHP:
    if($info['permission'] === 'rank')
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission'] . ' | ' $info['world'] . '</span>';
    echo 
    '<div class="right redFont">Do Not Delete</div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
                    else
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission']  . ' | ' $info['world'] . '</span>';
    echo 
    '<div class="right"><input type="checkbox" name="deleteGroupPerm[]" value="' $info['id'] . '" /></div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
    In file: templates/home.php

    Find:
    PHP:
    if($info['permission'] === 'rank')
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission'] . '</span>';
    echo 
    '<div class="right redFont">Do Not Delete</div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
    else
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission']  . '</span>';
    echo 
    '<div class="right"><input type="checkbox" name="deleteUserPerm[]" value="' $info['id'] . '" /></div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
    Replace With:
    PHP:
    if($info['permission'] === 'rank')
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission'] . ' | ' $info['world'] . '</span>';
    echo 
    '<div class="right redFont">Do Not Delete</div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
                    else
    {
    echo 
    '<div class="'.$back.'">';
    echo 
    '<span class="left">' $info['permission']  . ' | ' $info['world'] . '</span>';
    echo 
    '<div class="right"><input type="checkbox" name="deleteUserPerm[]" value="' $info['id'] . '" /></div>';
    echo 
    '<div class="clear"></div>';
    echo 
    '</div>';
    }
     
  14. Offline

    ultimateaoe2

    So, I've installed everything correctly, but I have a problem.
    Every time I go to log into thePEXinator, it doesn't log in, and my url shows a "?error".
    It shows like this: http://localhost/pex/login/index.php?error
    Did I do something wrong?
     
  15. Offline

    philulrich

    If you look in your webserver error logs you should see something about it not being able to access a file. That file is the config file. Rename the config.example.php in the folder includes to config.php. Manually edit the config file with your settings. You should be good after that.
     
  16. Offline

    ultimateaoe2

    Doesn't work still. Still giving me the same ?error.

    I know I typed in my information correctly...

    Error Log in XAMPP Apache
    Code:
    127.0.0.1 - - [08/Aug/2013:17:36:39 -0700] "POST /pex/login/index.php HTTP/1.1" 302 1994 "http://localhost/pex/login/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36"
    127.0.0.1 - - [08/Aug/2013:17:36:40 -0700] "GET /pex/login/index.php?error HTTP/1.1" 200 1994 "http://localhost/pex/login/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36" 
    I have the WebSend plugin installed as well, (Named WSEvents?), But I do not see any errors for some reason.
     
  17. Offline

    philulrich


    The log you posted is the access log. The error log has a format like this:

     
  18. Offline

    ultimateaoe2

    My bad.
    This is the whole log, by the way/
     
  19. Offline

    philulrich

    I don't see any php script errors there that are relevant. Is it possible to screenshot the error message you are getting?
     
  20. Offline

    ultimateaoe2

    I would've done it by now, but it doesn't show any.

    Do you mind if you could upload your files?
    EDIT: Fixed it! Now, I get this error:

     
  21. Offline

    philulrich

    <Edit by Moderator: Redacted bit url>

    Please confirm that your database structure looks like this: http://d.pr/i/pyDV

    Pardon the tooltip.. you should get the point though.
     
    Last edited by a moderator: Feb 20, 2017
  22. Offline

    ultimateaoe2

    I only had this:
    http://imgur.com/CKiu7YJ

    Those two DBs were created whenPEX Installed.

    Getting this problem still: Fatal error: SQL in C:\xampp\htdocs\pex1\templates\home.php on line 214
     
  23. Offline

    philulrich

    You must have it installed in the same database that you have your PEX MySQL in.
     
  24. Offline

    ultimateaoe2

    Should I try creating themissing databases?
     
  25. Offline

    philulrich

    You need to either A) Move those tables to your PEX database and reconfigure or B) reinstall in your PEX database or C) If you are using flat-file on PEX, this is the wrong utility for you unless you want to migrate to MySQL.
     
  26. Offline

    ultimateaoe2

    I was using a flat file, but wanted to migrate to MySQL.
    By the way, thank you for the help. I really appreciate it, sorry for dragging you like this xD.

    How would I find the databases for PEX?
     
  27. Offline

    philulrich

    You just change the PEX config to mysql and it will create them. I think you also might be able to migrate it automatically to MySQL, but I have no clue if that s***storm works or not.
     
  28. Offline

    ultimateaoe2

    I got it :).

    I have to manually remake the permissions file but it'll be 10x faster than before.

    THANK YOU SO MUCH!!
     
  29. Offline

    philulrich

    No problem. If you use my files, you have the fixes implemented so you can edit groups too as well as actually edit anything at all. :)
     
  30. Offline

    crameep

    Looks awsome, have it installed, tables created, user in the table but when I attempt to login I just get redirected to page login/index.php?error with no display other than that of errors.

    After a bit of digging, looks like ( for me at least) the session's aren't being stored when I print them they are always blank.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
Thread Status:
Not open for further replies.

Share This Page