Merge pull request #3129 from Citadel-Station-13/upstream-merge-31254

[MIRROR] Hosts can lock config options from admins
This commit is contained in:
LetterJay
2017-10-04 18:43:55 -04:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
@@ -74,6 +74,10 @@ GLOBAL_PROTECT(config_dir)
if(copytext(L, 1, 2) == "#")
continue
var/lockthis = copytext(L, 1, 2) == "@"
if(lockthis)
L = copytext(L, 2)
var/pos = findtext(L, " ")
var/entry = null
var/value = null
@@ -96,6 +100,9 @@ GLOBAL_PROTECT(config_dir)
log_config("Found [entry] in [filename] when it should have been in [E.resident_file]! Ignoring.")
continue
if(lockthis)
E.protection |= CONFIG_ENTRY_LOCKED
var/validated = E.ValidateAndSet(value)
if(!validated)
log_config("Failed to validate setting \"[value]\" for [entry]")