More JSON

Version 1.521

Feature
Finished

add json=yes to the GET or POST for the regular requests. Global change: All "Select Box" type json output used to have: "selected ": "yes" if a given value was selected, where a trailing space was added after "selected". This has been changed to no longer have the trailing space, so a selected selectbox item will now be: "selected" : "yes" ============================== CMD_MOVE_USERS creator - selectbox selectcreator - selectbox data_list - array of creators, with values being list of users below that creator. ============================== CMD_ADMIN_SETTINGS admin_settings - array email_settings - array security_settings - array server_settings - array ============================== CMD_CUSTOM_HTTPD tokens should match the skin value, so ensure they're all accounted for, even if blank. Be sure to test for both httpd and nginx, as token names can change. Applies to both: domain=domain.com&json=yes and,eg: user=username&php-fpm=5.6&json=yes other save actions return the standard dynamic output. The plain list: CMD_CUSTOM_HTTPD?json=yes returns the json table structure, but a sample row looks like: { "domains": { "0": { "domain": "configdomain.com", "info": { "php-fpm1": "5.6", "user": "newconfig" } }, ... where php-fpm1 (and possibly php-fpm2) will show up, if they're present on the system. Else, the info array column would only have the user entry (eg: for mod_php) ============================== CMD_MULTI_SERVER CLUSTER_ON=ON|OFF - if the feature is enabled or not port=2222 current DA port, just used for auto-fill for new server form. servers - array of remote server IPs or hostnames. If a hostname, it should also include the "ip" it resolves to in the sub-array. ============================== CMD_PHP_SAFE_MODE domains - table, searchable/filterable Then the 4 top level variables: "have_openbasedir": "1", - if the system supports openbasedir "have_safemode": "0", - if the system supports safemode (newer dropped at 5.3) "open_basedir": "ON", - default setting for newly added domains "safemode": "OFF" - default value for newly added domain. ============================== CMD_ADMIN_CRON_JOBS crons - table, similar to CMD_CRON_JOBS?json=yes currently no actions on this page, just viewing. ============================== CMD_LOG_VIEWER Various ways a file can be viewed, be sure to test them all. All cases: files - array, filename as index, sub-array with size in bytes, text, and optionally "selected ": "yes" lines = 50 - changes if specific number of lines are set. - only json=yes, just the above. - raw file - not json output, literally raw, with given settings affecting the output. - not raw, other options should be listed: LOGDATA - contents of the log GREPVAL - if grep is used, th value entered ignore_case=0|1 case sensitivity for grep invert_grep=0|1 negation of grep output. ============================== CMD_SYSTEM_BACKUP Note, all of the options from the /usr/local/sysbk/conf.sysbk are shown, but not all are really relevant. Also, there are if-then-else statements in the conf.sysbk, but DA reads over them, so ignore the case-depenent variables. See skin for what DA actually uses. ============================== CMD_PROCESS_MONITOR Straight forward display of info, else post for auth or killing processes. With json, we'll leave the refresh to the skin, so timers, etc are not part of the json out. Just reload the json as needed when it refreshes. ============================== CMD_BRUTE_FORCE_MONITOR Be sure to test with all possible combinations of: - the presense/absence of block_ip.sh, unblock_ip.sh - user_brutecount=0 being disabled shows text instead of json table: "USERLOGINFAILURES": "user_brutecount disabled", - fresh install, no logs yet, sets text to table tokens. The "Clear Message System" table loads in the same tokens as were set in the Message System for the same action. By default, only the LOGINFAILURES is search/sortable. However, if you specify the take token in the "show" varilable, eg: show=USERLOGINFAILURES only this table (of the 5) is included, but can then be searched/sorted using standard table variables. You will still get some other tokens, but they're not resource intensive to build. ============================== CMD_PLUGIN_MANAGER returns array of plugins, index being the plugin name, and value being the array of entries from the plugin.conf. DA also adds the "available_version" via the URL for you, and uses a cache so it's not doing an external request each query.

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