View Full Version : Hack to edit online config.php
CarCdr
09-05-2004, 02:24 PM
It is a pain to have to use FTP to modify config.php. Has anyone implemented an AdminCP online editor for it? It would re-use the same code as the template editor in AdminCP. Access would be restricted to Superadministrators.
Xenon
09-05-2004, 05:29 PM
Erwin has created a hack once to edit forums'php files from ACP, i'm sure it's easy to restrict it to just config.php :)
CarCdr
09-05-2004, 06:05 PM
Erwin has created a hack once to edit forums'php files from ACP, i'm sure it's easy to restrict it to just config.php :)
Well, we can compare notes Xenon, because I just wrote the damn thing. :)
Only hitch was giving the web server write access.
My problem was rolling out other config files. This is our policy for isolating local mods for config options that change infrequently. As a result, we have 3 or 4 XXX_config.php files in addition to the standard config.php. The editor handles any file listed in an assoc in the script.
Teaching administrators how to use secure FTP (we are HTTPS site) was more bother than writing the editor code.
The other problem we encountered was prople's editing tool. Sometimes we'd get whitespace outside of the PHP tags. The editor checks that this does not happen for .php files.
It's working fine, but I would like to add code to create XXX.bk (or whatever) to maintain at least one generation of backup.
Cheers
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.