All code posted here, unless otherwise specified, is licensed under a BSD 2 Clause license. The only note is that these snippets do not have the BSD copyright notice - so you are exempt from including them.
I took in a few of these suggestions, and did a little reading. From what I've seen people are saying that using system(anything) uses more resources then just getting it done more pure, so I took a while to find some ways to replace using my system functions, along with adding a remove user function and came up with this.
Next up is how to use php to execute a batch file on my system. I wrote a small batch that essentially executes another program for FastDL sync (as gmod caps DL at 20kb/s) but this program can take a while to complete compressing and copying files. Does something like system("C:\program.bat") work? This particular program requires me to press enter when it is finished, is there a way I could get a program to do this for me? And would the program have to hold up the entire PHP while it takes its 10+ minutes to complete? Any ways around this if it is the case? I feel like all the things I'm trying to do have horri
I'm not using HTTP authentication, but I already have a openid/steam authentication in place before people can access this page. It's part of a larger project. The main thing I wanted was to make sure it would be impossible for anyone to send malicious POST data to transverse the directory tree to somewhere I didn't want them to, even though in theory only authorized users would have access to this resource to start with.
So I could take the realpath substring length of the POSTed directory, and make sure that it is C:\sg\darkrp\garrysmod\addons? And + is the correct concatenation operator? I was using . or something I think... I was also confused why they named the function unlin
This is a topic that is always argued but first off I would recommend using htaccess/IIS to have a basic auth prompt - if it's not using SSL it will be in clear text but it will prevent random people from accessing it.
The options have no value so this as is wouldn't work. And if you are thinking what I think you are thinking - you should set the value options to the subdirectory and do a rrmdir on C:\sg\darkrp\garrysmod\\ + $_POST['file']. Also to check to make sure they aren't trying to traverse through the filesystem you could use http://php.net/manual/en/function.realpath.php to check if $_POST["file"] == realpath($_POST['file']). If it's not equal then you