?
Solved

Password programme wanted

Posted on 1997-05-30
2
Medium Priority
?
143 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 150 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

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

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…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Suggested Courses

719 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