Solved

Password programme wanted

Posted on 1997-05-30
2
141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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
powershell command to get a dll version remotely for many server 12 136
SSRS - Powershell 7 80
List all Printers with anmes and Ip address 3 47
size of file 1 37
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

739 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