make user-config-readonly explicit when writing to config.

This commit is contained in:
Ad Schellevis 2015-04-14 08:55:19 +00:00
parent 687097ab71
commit dcd71445c0

View File

@ -153,6 +153,8 @@ function write_config($desc = 'Unknown', $backup = true)
$user = getUserEntry($_SESSION['Username']);
if (is_array($user) && userHasPrivilege($user, "user-config-readonly")) {
session_write_close();
// okay, it's not very nice to check permissions here, but let's make it explicit while we do...
log_error(gettext("WARNING: User")." ".$_SESSION['Username']." ".gettext("may not write config (user-config-readonly set)"));
return false;
}
}