Solved

Password programme wanted

Posted on 1997-05-30
2
136 Views
Last Modified: 2013-12-25
Does anyone know of a perl script that lets people register with username and password of their choice.  These are then written to the .htpasswd file so next time they log on they gain access.If fact exactly what is used in the Experts forum registration process.

I've searched the Perl script lists I've found and found one called register but at present it won't write to the .htpasswd file.

I have seen another one called Selina Sols Authorisation but it seems very complicated.

There must be more than one script like this around so any suggestions will be most welcome.
0
Comment
Question by:purcom
2 Comments
 

Accepted Solution

by:
walterk earned 50 total points
Comment Utility
Hi purcom,

I have actually written several scripts regarding this and am working on one now.

Basically you need to implement the following in the script which processes your form and redirect the output to add to your .htpassword file. Here is the (quite simple code) If you need a complete program, please let me know, but I thought this will help you underway.

#!/usr/bin/perl
# This perl script is used to create a password
# for a web-page user, use as makehtpassword <username> <password>
#
# Copyright 1997 Walter Klomp
#
($user,$pass1)=@ARGV;
if ( length($pass1) < 2 || length($user) < 2 ) {
  print "Usage: makehtpassword <username> <password>\n";
  exit;
}
$pass = crypt($pass1,substr($user,0,2));
  print "$user:$pass\n";
  exit;

It's called from the shell, but can be very easily implemented script called from the www-server.

Hope it helps.

Regards
Walter
0
 

Author Comment

by:purcom
Comment Utility
Thanks, please contact me re full programme.Mike
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now