CMD_AJAX_SEARCH json

Version 1.51

Feature
Finished

New search tool to find data quickly. Command: CMD_AJAX_SEARCH GET options: search=your query Optional values: search_default=0|1 user_level=0|1 search_users=0|1 search_admins=0|1 search_resellers=0|1 search_domains=0|1 search_email=0|1 search_ftp=0|1 search_db=0|1 If set, the search_default will initialize all variables to 1 or 0. Else all search_* variables are initialized to 1. If user_level is passed, this applies the settings on email, ftp, and db. Doesn't touch Admin/Reseller items (users/domains) Any search_* value will set to that value, after all above conditions are finished being set. If only a basic "search" is done, without any variables: - Admin/Resellers: every thing is searched - Users: User Level items are searched. For any array type, if there are no items, the array won't be passed at all, so make sure to ensure the array exists before starting to read it. ----------------------------------------------------------------- directadmin.conf new variable: ajax_search_max_time=2.0 uses a floating point number to determine how long the search is allowed to run. It doesn't use an interrupt, but rather just does a check in between items, and inside loops. So for example, if the email search takes 3 seconds, ftp and databases won't be searched at all. ----------------------------------------------------------------- Sample output: ----------- { "users": { "CMD_SHOW_USER?user=testresell", "testresell", "CMD_SHOW_USER?user=testshared", "testshared", "CMD_SHOW_USER?user=testuser", "testuser" } , "resellers": { "CMD_SHOW_RESELLER?user=testresell": "testresell", "CMD_SHOW_RESELLER?user=testshared": "testshared" } , "domains": { "CMD_SHOW_USER?user=shareduser": "User shareduser : sharedomaintest.com", "CMD_SHOW_USER?user=templtes": "User templtes : templates-test.com", "CMD_SHOW_USER?user=testresell": "User testresell : testreseller.com", "CMD_SHOW_USER?user=testshared": "User testshared : testshared.com", "CMD_SHOW_USER?user=userofres": "User userofres : sub.testreseller.com" } , "dbs": { "CMD_DB?name=user_test": "Database user_test" } }

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