Solved

Password programme wanted

Posted on 1997-05-30
2
140 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Modifying Powershell script to get the size of the directory ? 2 63
Need to Modify a Script I found 5 108
AWS CLI issues with Tags 3 88
change the windows script file to BAT 10 49
Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

830 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