JSON to list commands.allow/deny

Version 1.55


Evo needs the ability to know which commands shouldn't be allowed before they're shown/used. If there are commands.deny or commands.allow in effect for the current login (being per-user, global or login key), the restrictions/allowances will be included in: CMD_JSON_LANG?json=yes&domain=domain.com&request=global You'll always see this option: has_cmd_overrides=yes|no and if yes, then more info will be provided in: cmd_overrides eg: "cmd_overrides": { "commands.allow": [ "CMD_ALL_USER_SHOW", "CMD_JSON_LANG", "CMD_LOGOUT", "CMD_RESELLER_HISTORY ", "CMD_RESELLER_STATS", "CMD_SHOW_RESELLER", "CMD_SHOW_USER", "CMD_USER_HISTORY", "CMD_USER_STATS" ], "commands.deny": [ ] }, "has_cmd_overrides": "yes" Just as an example, where this would block all commands, except the listed commands.allow. Note, only 1 of commands.allow/commands.deny might be set with has_cmd_overrides, if only one of the 2 files exists. The commands.deny trumps commands.allow, so in your logic, check that first to decide if a command is blocked. If it's not denied, if the commands.allow exists, then the command MUST exist in that file. If commands.allow is set, but empty, all commands are blocked (and you wouldn't be able to view CMD_JSON_LANG anyway) So if you have commands in command.deny, but commands.allow is not set at all, then all commands are allowed, except the values in commands.deny. If commands.allow is set, but commands.deny is not set, then only the values in commands.allow are allowed. If both are set, commands.deny wins over commands.allow. Note, the bulk commands.* options: ALL_USER ALL_RESELLER ALL_ADMIN are removed and converted into the full list of values, so you don't need to worry about knowing which command belongs to which level. These 3 ALL_* values won't be listed. Just check the CMD_ you'r looking at against these lists, if they're set.

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