Home Ask Login Register

Developers Planet

Your answer is one click away!

Stantastic February 2016

Prevent a user from changing a specific line in a textfile

I'm working on a Control Panel for my communities minecraft servers. I want to keep the option to give away servers to other people too. Minecraft servers have a configfile which has the option IP/Port in it. Since people will have direct access to the file via FTP i still dont want them to change the port however the rest of it must be editable. Is there any good way to prevent users from doing so? The only idea i have at the moment is to grab the prot for each server from a database which only root users can access and then echo the port into the file just before each server start/restart.

Answers


daxro February 2016

To reply on your title: "Prevent a user from changing a specific line in a textfile". This is unfortunately not possible.

Keep all editable data in one file where you grant them write-access, or create a simple GUI where the port is set, but the rest is editable (and then make sure they don't have access to change the actual settings file).


Bug February 2016

Get the users to enter the data via a html form and build the txt file with php when the user submits the form

Post Status

Asked in February 2016
Viewed 1,869 times
Voted 4
Answered 2 times

Search




Leave an answer


Quote of the day: live life