Is it possible to restrict writing to the .htpasswd file ONLY if users belong to a specific role?
I want to provide protected, fast downloads, and after some investigation I believe this is the best way.
Thanks.
Is it possible to restrict writing to the .htpasswd file ONLY if users belong to a specific role?
I want to provide protected, fast downloads, and after some investigation I believe this is the best way.
Thanks.
Comments
Comment #1
hmmmstrange commentedYes it is.
In the htpasswd configure form there are radio buttons to select which roles you collect. Then in your htaccess you'd use "require group fidelixfastdownloads"
Comment #2
Fidelix commentedNo, that's not what I asked.
The way you are suggesting, it seems that it still writes to the htpasswd file ALL users, regardless of role, and then it just uses the htgroup directive to restrict groups.
I don't use apache, I use nginx, and it does not support htgroup directives, only the htpasswd. That's why I only want users of a specific role written to that file.
Is this possible?
Comment #3
hedac commentedI have the same problem using nginx. I think the solution is to maintain both files as they are, the users file with the passwords, and the groups file with the roles. Then, for nginx, add a third file (the one nginx would use instead), that only adds the users that are in the desired group (role)
Comment #4
hedac commentedI've made this temporary code added at the end of function _htpasswdsync_updategroup()
it updates a file with the same name and a _nginx suffix. This is the file to use by nginx.
it doesn't use the mail_domain setting but I'm not using that option.
I think it works. But please forgive the bad coding.
Comment #5
hedac commented