This function confirms whether a directory uses password protection.
uapi --output=jsonpretty \ --user=username \ DirectoryPrivacy \ is_directory_protected \ dir='/home/example/example.com'
{- "apiversion": 3,
- "func": "is_directory_protected",
- "module": "DirectoryPrivacy",
- "result": {
- "data": {
- "auth_name": "Protected 'example.com'",
- "auth_type": "Basic",
- "passwd_file": "/home/example/.htpasswds/example.com/passwd",
- "protected": 1
}, - "errors": null,
- "messages": null,
- "metadata": { },
- "status": 1,
- "warnings": null
}
}