php-apache2-basic-auth-manager
php-apache2-basic-auth-manager copied to clipboard
Adding User/Group breaks .htpasswd
Whenever you add a user or a group, the .htpasswd file gets reset. So far so good.
But (!) whenever the Service class writes it puts a whitespace in front of the password which renders the file unusable.
Works: test:$apr1$wG4BORKw$6ylmzwwbtgDvH7l13Y5QH1
Fails: test: $apr1$wG4BORKw$6ylmzwwbtgDvH7l13Y5QH1
This is easily fixed by changing the method "formatHT" in the user & group class, so that the return string does not contain a whitespace after double-point:
/**
* Format to HT write
* @return string
*/
public function formatHT()
{
return "{$this->getUsername()}:{$this->getHash()}";
}
Would've filed a Pull request, but haven't done so in quite a while. ;)
This is not an issue with rafaelgou/php-apache2-basic-auth-manager but an issue with the rafaelgou/php-apache2-basic-auth project and should be moved to the issue queue of that project.
The code referred to is in the rafaelgou/php-apache2-basic-auth project.