I am using a webhotel which offers a very simple Linux + PHP setup, and does not allow many administration privileges; however, it seems that the server PHP setup there allows for running shell programs via shell_exec
.
So what I'm looking for, is a simple PHP-based tool, which:
- Accepts a path for a .htpasswd file
- Shows an HTML form that allows for:
- Adding a user with a password in the .htpasswd file
- Changing the password of an existing user in the .htpasswd file
- Deleting a user from the .htpasswd file
- These operations are done either through a PHP class, or by
shell_exec
'ing Linux commands (although PHP class is preferred, because I might not have permissions to runhtpasswd
and similar commands) - Does not offer to change any
.htaccess
files (I prefer to write those manually) - Preferably, comes in a single .php file (both the PHP code logic, and the HTML form, excluding libraries) - which I can put in a directory of choice, and then it handles the access to only that directory and below (i.e. if I want to manage a different directory, I'd have to copy the .php manager file there)
Basically, I guess it would look something like "Manage Users" of DirectoryPass:
http://www.directorypass.com/screenshots.php
... and AFAIK, there is a similar HTML form-based GUI in cPanel and such; but DirectoryPass is not for me because:
- It is written in Perl, and needs to run from
cgi-bin
- In principle, it manages the whole filesystem, instead of just directory it is in (and below)
- Offers to write .htaccess files, which I don't want
Some other "almost there" stuff I found:
- http://enfoldit.com/index.php/2011/09/htpasswd-change-script/
- http://innvo.com/1311865299-htpasswd-manager/
- not OK: is just a PHP class, no HTML form
- http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=110 (with http://www.thewebmasters.net/oldphp/Htpasswd-0_9.tar.gz)
There are also some suggestions on http://www.debianhelp.co.uk/htaccessweb.htm - but most of those refer to websites that do not exist anymore...
So is there anything out there, that would fit the requirements I've listed in this question/post?