[mod_python] Re: Bad penny returns

Chad Whitacre chad at zetaweb.com
Fri Dec 17 23:36:08 EST 2004


> In fact, anyone got a piece of work they want doing with mod_python (bearing
> in mind that it will arrive at hobbyist speeds)?

Well heck, since you asked ... ;-)

Here's a simple little project for you: write a web front end for 
htpasswd. Htpasswd is a utility for managing Unix passwd(5) files; it 
comes with Apache (inline docs are below). I need a web front end for it 
so that users of my svn server can change their password themselves.

The mini-app should really just need one web page, a form with these fields:

   - username

   - current (old) password

   - new password

   - new password confirmation

Should be pretty straightforward to take these in a script ttw and 
manipulate htpasswd on the back end. My preference would be to have the 
whole transaction handled by a single script, htpasswd.py (and I would 
use SimpleTAL for templating, but suit yourself of course). This would 
post to itself, so the user's url never changes while using the app.

I've actually been looking for a little mod_python starter project 
myself, and this is what I came up with. And I'll need to write it 
myself in the next couple weeks if you're not interested. If you are 
interested I'd be happy to host it in my svn repo for you ... once 
you're done. ;-)

Ok, take it or leave it, just thought I'd throw that out there!


chad


============================

# htpasswd
Usage:
         htpasswd [-cmdpsD] passwordfile username
         htpasswd -b[cmdpsD] passwordfile username password

         htpasswd -n[mdps] username
         htpasswd -nb[mdps] username password
  -c  Create a new file.
  -n  Don't update file; display results on stdout.
  -m  Force MD5 encryption of the password.
  -d  Force CRYPT encryption of the password (default).
  -p  Do not encrypt the password (plaintext).
  -s  Force SHA encryption of the password.
  -b  Use the password from the command line rather than prompting for it.
  -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.



More information about the Mod_python mailing list