Solved

Password programme wanted

Posted on 1997-05-30
2
139 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
ID: 1828156
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
ID: 1828157
Thanks, please contact me re full programme.Mike
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
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.
The viewer will learn how to dynamically set the form action using jQuery.
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 …

776 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