FileManager: Only show protection enabled if htpasswd matches

Version 1.62.0

Bugfix
Finished

When viewing the password protection status of a directory, previously, only the presence of: required valid-user was needed in the .htaccess file. With imports of websites from other servers, this needs to be more specific. This change expands the checks to also validate the line: AuthUserFile "/home/admin/domains/domain.com/.htpasswd/public_html/protected/.htpasswd" where that path must match the path of the actual .htpasswd file that DA is working with. If there is no match, the checkbox will not be checked. ==== TROUBLESHOOTING If the checkbox is not being checked when you think it should be, run DA in debug mode, level 10 is sufficient, and check for one of these 2 messages: "FileManager::protection_enabled: FALSE because %s does not start with %s" "FileManager::protection_enabled: FALSE because %s != AuthUserFile %s" which should tell you which one is the cause. ---- T31375

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