[PHP] Nouse Web Tool Bundle V2.1

This is the place where you can find everything related to the dedicated server, control scripts and community tools.

Moderators: Pit Crew, TM-Patrol

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

[PHP] Nouse Web Tool Bundle V2.1

Post by nouseforname » 14 Sep 2009 14:54

  • Nouse Web Tool Bundle V2.1

    Updated 2.1
    - shell scripts modified to be more secure


    you have to add in /etc/sudoers:

    Code: Select all

    www-data ALL=(ALL) NOPASSWD: /path/to/shellscripts/* 
    usually the user is "www-data", in case you are using xampp, it's "nobody".

    this setting will change the permission of the web script user, to be able to execute the shell files in the given folder.
    in case you dont want to run the servers as root, create a user eg.: tmf and add

    sudo -u tmf

    in the shell scripts SAMPLExaseco:

    Code: Select all

    sudo -u tmf /usr/bin/php $NAME.php </dev/null >aseco.log 2>&1 &
    SAMPLEdedi:

    Code: Select all

     sudo -u tmf ./$DEDINAME /dedicated_cfg=$DEDICONF /game_settings=MatchSettings/$MATCHSETTINGS > /dev/null
    xampp users have to change some values in php.ini if original.
    i am not 100% sure if all are needed, but at least after set this it worked.
    php.ini:

    Code: Select all

    y2k_compliance = On
    safe_mode_gid = Off
    register_globals = Off
    session.use_trans_sid = 0
    
    remark again:
    the "control" script of the bundle only works in linux, cause it controls the shell files.


    for the other scripts it might be neccessary to set this in php.ini:

    Code: Select all

    php_admin_flag engine on
    php_admin_flag safe_mode off
    php_admin_value open_basedir none

    Update:
    - added function to view some pages without log in, must be enabled via user permissions of user "view"
    - added clan member online view, incl chat. (atm only available in bundle)
    - fixed (i hope) some security issues
    - fixed some style bugs

    how to update:
    i recommend to install it from scratch, but its possible to keep server.xml.

    remark:
    read the informations in readme.txt for the "view only" function. not all pages are available for that.

    Here we go,

    i created a bundle package of all my web tools. some are modified and improved. Also some new tools inside.
    all with user/server management via web interface.

    Whats inside:
    - Website Chat Log Viewer, now with seperate log file path for each server and track change display if checked
    - CheatRecordsDelete from DB, now with possibillity to delete single records of one given login and some more nice information. better than the original one.
    - Website Backup tracks, to backup tracks of online servers.
    - Prune tracks, delete older track data from database
    - State control bundle (linux only), with web interface to start/stop/restart dedicated and/or xaseco
    - a nice status view of all servers, with online players list
    - clan member server ranking list
    - more in the future possible

    installation:
    - read the readme.txt
    - copy all files to web server
    - call page in your browser
    - chmod neccessary files
    - login with Admin / admin
    - add/change user settings via interface
    - some settings must be set on your server itself, in case script dont work. specially for the state control interface.
    - you may have problems with Gbx.remote.inc.php, try one of the others gbx.remote files in "Classes" folder.

    also this information might be useful for the state control and other problems:
    viewtopic.php?p=161143#p161143

    it's quite easy to add tools/pages just by adding the name into the tools.xml. of course the page must be prepared too.

    download:
    Download here

    Have fun using it and let me know if you like it.

    thanks all
Last edited by nouseforname on 30 Dec 2010 15:57, edited 5 times in total.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by nouseforname » 03 Oct 2009 07:27

  • Released V2.0
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
jimos94
happy cruiser
happy cruiser
Posts: 122
Joined: 06 Jan 2007 22:52
Owned TM-games: TMUF
Manialink(s): fun
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by jimos94 » 03 Oct 2009 13:33

Great job nouse. It seems that everything is working correctly so far. I will let you know if something is going wrong. Thanks for sharing. :)
http://www.tm-planet.net/ Server hosting, Interviews, Events and more :)

Bikerben666
cyclist
cyclist
Posts: 32
Joined: 12 Dec 2008 02:59
Owned TM-games: TMUF

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by Bikerben666 » 11 Nov 2009 17:08

Looking great & loving it your "Web tool Bundle".

But don't know why that i got always the same results with the "prune records", looks like there is nothing changing in records.

If i click "Prune" i get always :
Selected challenges: 220 Records > 180 days & Players > 90 days 16 : [GR]Night Hawk -> pruning 340 old recs out of 609 ...
1 3 18 21 25 29 35 41 43 46 50 51 53 54 57 58 64 65 68 70 71 76 82 85 86 88 89 90 92 95 96 100 => 32 ranked 17 : The Jump -> pruning 363 old recs out of 597 ...
1 11 18 26 28 30 31 33 34 36 37 39 40 56 61 66 67 68 72 74 77 78 80 87 90 91 93 94 95 96 97 98 => 32 ranked 18 : Going Down -> pruning 364 old recs out of 593 ...

Even if i do this 5 times, i always get the same results.

The "cheatrecs" work like a charm. I can select a record from a player and delete it.
I can also repair & optimize the database.

thx

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by nouseforname » 15 Nov 2009 12:58

Bikerben666 wrote:Looking great & loving it your "Web tool Bundle".

But don't know why that i got always the same results with the "prune records", looks like there is nothing changing in records.
the prunerecs script is completely made by xymph, i just implemented it as web page.

good catch anyway, funny nobody found it yet.

go to '..tools/tools/Cheatrecs/prune.php'
in line ~ 99 find:

Code: Select all

$doit = ($argv[1] == 'DOIT');
and change it to:

Code: Select all

 $doit = 'DOIT';
that should do it.

sry for that.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

Xymph
Pit Crew
Pit Crew
Posts: 5652
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by Xymph » 15 Nov 2009 13:04

nouseforname wrote:go to '..tools/tools/Cheatrecs/prune.php'
in line ~ 99 find:

Code: Select all

$doit = ($argv[1] == 'DOIT');
and change it to:

Code: Select all

 $doit = 'DOIT';
that should do it.
Nope, the first sets $doit to a boolean, the second to a string. :roll: Try 'true' (without the quotes).
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by nouseforname » 15 Nov 2009 13:07

Xymph wrote: Nope, the first sets $doit to a boolean, the second to a string. :roll: Try 'true' (without the quotes).
thanks for your comment xymph.

Code: Select all

$doit = true;
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

Bikerben666
cyclist
cyclist
Posts: 32
Joined: 12 Dec 2008 02:59
Owned TM-games: TMUF

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by Bikerben666 » 19 Nov 2009 14:55

Indeed funny nobody seen this before.

That did the trick.Image

a Big THX

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by Ant » 24 Dec 2009 01:21

thanks for this mate

User avatar
xai
happy cruiser
happy cruiser
Posts: 162
Joined: 13 Nov 2008 15:46
Owned TM-games: TMU(F),TMN(F)
Manialink(s): xai

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by xai » 07 May 2010 11:48

You didn't respond to my pm about this issue. So well, then I'll just post it here won't I ;).

Server status display: I can convince the server admin to add a track which has html code in it. So also javascript. This way I can for example redirect the status page to a pornsite.
Chatlogviewer: Any html in the chatlog won't filter out. So you can do the same here.

Do I need to go on? Cause I bet there are a lot more non-html filter issues in your code.

How to fix this you ask? htmlspecialchars in the color parser
Weeeeeeeeeeee

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by nouseforname » 07 May 2010 12:29

xai wrote:You didn't respond to my pm about this issue. So well, then I'll just post it here won't I ;).

Server status display: I can convince the server admin to add a track which has html code in it. So also javascript. This way I can for example redirect the status page to a pornsite.
Chatlogviewer: Any html in the chatlog won't filter out. So you can do the same here.

Do I need to go on? Cause I bet there are a lot more non-html filter issues in your code.

How to fix this you ask? htmlspecialchars in the color parser

i got ur pm, but i wasnt able to do someting here for a while. now you just remind me.

so we are talking about one line to add in the colorparser.

colorparser ~line 212:

Code: Select all

$str = htmlspecialchars($str, ENT_QUOTES);
this is what you meant?
and of course some other checks in the scripts itself
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
xai
happy cruiser
happy cruiser
Posts: 162
Joined: 13 Nov 2008 15:46
Owned TM-games: TMU(F),TMN(F)
Manialink(s): xai

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by xai » 07 May 2010 12:33

Well, it comes down to this: add htmlspecialchars($str) around the input string BEFORE the colorparser does anything with it(if you do it after it filters out all html the colorparser just made of course). This will fix the problem

EDIT: that ENT_QUOTES isn't even needed
Weeeeeeeeeeee

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by nouseforname » 07 May 2010 12:59

xai wrote:Well, it comes down to this: add htmlspecialchars($str) around the input string BEFORE the colorparser does anything with it(if you do it after it filters out all html the colorparser just made of course). This will fix the problem

EDIT: that ENT_QUOTES isn't even needed
well ok, i checked now the whole bundle, and imo it just needs the colorparser fix. just at the beginning of function "toHTML"

Code: Select all

$str = htmlspecialchars($str);
this is right before anything happens anyway.

everything else should work fine already, i even tried it with ur sample code as nickname. for me nothing strange happens. but of course the nickname wasnt displayed before the fix.

so thanks anyway, i will add the fixed colorparser soon.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
keep_on_dreaming
pedestrian
pedestrian
Posts: 11
Joined: 10 May 2010 03:30
Owned TM-games: TMUF; TMU
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by keep_on_dreaming » 16 May 2010 20:47

Just wanted to say that I like those included shellscripts. They are great for creating crontabs.

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [PHP] Nouse Web Tool Bundle V2.0

Post by nouseforname » 16 May 2010 20:59

keep_on_dreaming wrote:Just wanted to say that I like those included shellscripts. They are great for creating crontabs.
thats why i made it, i use it with an crontab for auto check the state. and easy handling during server maintenance or updating.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

Post Reply