CMD_PLUGINS ability to skip user.conf write

Version 1.52

Feature
Finished

A plugin may need to make an API call to change a user.conf setting for the current User. This is a race condition, since the CMD_PLUGINS call to that plugin, follows up with a check on the user.conf timestamp (and related files), and if DA notices the timestamp changed, it will decide to overwrite it and log something like: 2017:06:11-01:05:53: ConfigFile::writeFile(./data/users/fred/user.conf) : Timestamp from when it was read is different, overwriting anyway The solution is to tell DA not to write to disk when you know you'll need to be doing that. To accomplish this, pass a GET request: user_conf_write=no eg: http://1.2.3.4:2222/CMD_PLUGINS/hello_world?user_conf_write=no http://1.2.3.4:2222/CMD_PLUGINS/hello_world/index.html?user_conf_write=no and this will stop the user.conf write for that call to CMD_PLUGINS. You'll then be able to make an API call within the plugin code, to alter the user.conf, without racing to write first.

Interested to try DirectAdmin? Get a 30-day Free Trial!