Westie's GCP - For Linux and Windows!
And now universal code too!
Introduction:
I originally created a control for my former company, which no longer exists. I was thinking of creating a free panel for all and sondre to use, because I just love stuff that is open for everyone to use, improve, masterbate to, what ever. Well hopefully not the last point anyway. Anyway, I thought that I had finished all my control panels, but then my grandad had a stroke - and I was literally forced down to Southampton (I went to Bournemouth too, so sorry I never went to your house and teabagged you, kc), so I had all the nights to myself, a really good steak pie and my laptop with PHP just installed when I left. Well, I've improved everything - better file-manager that is more user friendly, and some additions that everyone here will just love.
Requirements
You must have root/full administrator access to the server. This is so you can actually execute the commands... and install the damn thing. Don't even try installing this thing on a shared/free webhost, because you're most likely going to get dropped.
You must be running on your server Windows/Linux. If you know how to get the server running on an Intel Mac, then please, run it there if you want. :p
I'm not sure if safe_mode has to be disabled for the server to start, but I doubt it. If safe_mode is turned on and it doesn't work, then tell me and I'll try and find a solution.
You must have the 'taskkill' process process installed in your computer. If you don't have it, then look at the download section on how to install it.
Screenshots
http://asf.sterio.nl/panel1.jpg
http://asf.sterio.nl/panel2.jpg
http://asf.sterio.nl/panel3.jpg
Thank you [asf]watkijkje.
Changelog:
New in Version 1.1:
[size=9pt]
New and improved filemanager - to activate the options click on the file-type icon next to the file name, this will show the options. Double click the contents of the box or click the file-type icon in order to hide the options.
Windows no longer uses RCON in order to check if the server online. Instead, it tries to connect to the server - and no RCONis needed. The 'pidof' function in the Linux version has been removed in order to maximise portability.
I have added one line to the index.php file, I'll get on more about this later.
Configuration
Code
<?php
define("VERSION", "1.1");
define("TITLE", "Your name goes here");
define("FOOTER", "<a href="http://www.westie-cat.co.cc">Westie</a> made it, give him money.");
define("DEFAULT_THEME", "native");
define("_WEBURL", "./");
define("_DIRECTORY", DEFAULT_DIR);
define("SERVER_EXE", "samp-server.exe");
define("SERVER_ANN", "announce.exe");
define("FILEBLACKLIST", "data index.php log.html ".SERVER_EXE." ".SERVER_ANN);
define("EXEC_TMP_DIR", sys_get_temp_dir());
define("_HOST", "localhost");
define("LOGDATA", false);
?>
VERSION is the version of the software.
TITLE is the title you want to put as the header/title of the page.
FOOTER is the message you want to put at the bottom. Remember to put my link somewhere there.
DEFAULT_THEME should really be ignored unless you know PHP.
_WEBURL shouldn't really change, as it should work as it is.
_DIRECTORY is the reason for the change for the index.php, because index.php grabs the directory, so you can use all your files and access the filemanager. This should only be kept if you have the server files in the same directory as the main .php file. If you have the folder in a different directory, make sure that the HTTP deamon can read the server files.
SERVER_EXE and SERVER_ANN should remain untouched, unless you run more than one process called 'samp022svr' on your box.
FILEBLACKLIST and EXEC_TMP_DIR forces you to leave these alone or these will kill you.
_HOST is the address of the server, this will be okay if you don't change it.
LOGDATA asks you if you want to log all the IP addresses of everyone using your control panel.
FAQ's and Problems:
All the code is universal. You can use the code on Windows and Linux - without having to use seperate PHP scripts. All you need to do now to switch platform is replace the server running files.
There's still permission errors, but if you're using Linux, then you should be smart enough in order to sort it out. Try making the files read/writable by the HTTP process.
RCON is no longer used, so no spamming your logs. Yay! ;)
If you want to rip the code - please die. Why? Go figure.
Now that's sorted, you can use my code in what ever fashion you want, because it is covered by the GPL. I don't believe that the GPL has a section about killings, but you never know...
If you decide to keep the server files in the same directory as your index.php file as downloaded, then please prohibit other people accessing the control panel, okay?
I use proc_open for Linux, so yeah - I hope you have balls and good protection!
You will need to make the file 'data/core.php' +x, and also protect your files with this link.
Downloads:
Note that there is now a patch to enable folder creation. Just get the core.php and overwrite it - nothing should be changed from the frontend. In fact, only one line has been changed.
Linux:
- SkyDrive
- core.php folder creation patch Windows:
- SkyDrive
- core.php folder creation patch
'taskkill' for Windows XP and Vista:
- XP Professional (English)
- XP Professional (German)
- Vista version (English)
- Vista version (German)
* To make it accessible from the command line move it to C:/WINDOWS/system32 or any other quick start folder.
Well, thanks for using my control panel. I hope you can figure out how to use it, and thanks! :3