| ★ wanayoo — archive 1999 http://getscript.com/register/index.html | Nouvelle recherche | Portail wanayoo |
![]() Support Our Sponsor! Company Menu CGI/Perl Scripts CGI Installation & Customization Tech Forums Message Board Hosting Service Freebie Scripts Tutorials Other Services CGI / Perl Bookstore ![]() [Click on Book] |
![]() [Home] [Company] [Hosting] [Scripts] [Support] [Forums] [Purchase] [Freebies] [Tutorials] [Services] [Advertising] Last Updated: Friday, 21-Jul-2000 14:19:16 EDT For those using the .htaccess and .htpasswd protection scheme, this script automates registering new users. You know it's the protection that uses the .... ![]() The script was developed to screen out spammers and off-topic posters on web boards. It records both username and password into the .htpasswd (password) file and sends the new user access information via email. The script also serves to offer privacy protection to the users of your board. It prevents web bots, email extractors and other outside sources from leaching off your board's posted email addresses. Newsgroups offer no privacy protection without having to post a bogus email address. This script offers the web board manager better control it's users greater privacy. However, the script could also be easily adapted for other areas of your site. Such as automated registration for both subscription and/or member's only areas.
Although this script was developed for use with the WWWBoard 2.0a with Add-On's script, other applications will allow webmasters to maintain password protected areas using the .htaccess and .htpasswd file configuration on their servers. This script is not the same type of password protection provided by Matt Wright's WWWBoard. Instead this script will require a popup box for both username and password. The Administrator's htpasswd.cgi File This is the adminstrator's control file where you can Add, Change Passwords, Remove Users and Show Users in a particular protect area. There is only 1 variable in the script that needs to be altered which is the path to the .htpasswd file. Be sure to use WebAdmin for the username and WebBoard as the password when [Clicking Here] for a working example of the Password Protection Administration Script. We have not placed this working example within a password protected area, however you would want to place the Administrator's script in a password protected directory on your server with only you knowing the username and password to access it. Automated Registration Script This script allows people to automatically register to a protected area of your site. It in turns sends their username and password to the valid email address they provided. It allows you handsoff capability as far as you having to register users manually. If you're a subscription (pay) site, you'll want to check out the Subscription Site option on the menubar to the left instead. Fairly simple configuration. Just be sure you change the path to your sendmail program along with your email address. $dbfile='/path/to/wwwboard/messages/.htpasswd'; $attachment='/path/to/wwwboard/forums.txt'; $mailprog = '/usr/lib/sendmail'; $administrator='youremail@domain.com'; $title='Message Board Title'; The Registration Form Below is the a working example of our forum's pre-registration form. [Click Here] to view the FORM in it's HTML format or [Click Here] to view the form in it's TEXT format and [F]ile [S]ave [A]s and save as regform.html. The Automated Email Response When a new user registers, they will be emailed the required access information to the board. You need to create a text file as shown below. The file has only 3 required formatting instructions. Below is the sample response provided by clicking here to download. <--name--> Your account has been established and you may now post in our message board located at ... http://www.yourdomain.com/wwwboard/ Where prompted for an email address and password. Please enter ... E-Mail : <--email--> Password: <--password--> Thanks! Your Name Here Your Web Site URL your@email.comThe comment tags <--name-->, <--email--> and <--password--> are the only required formatting instructions for the forums.txt file. It is recommended that you use this response to include posting instructions, rules and even a promo about other services you offer. We Do! The .htaccess File This is a text formatted file that should reside in the messages directory of your wwwboard. The name of the file should be .htaccess with permissions set at world readable. If you wish to restrict posting on your wwwboard, you should remove the "Post A Message" form located on your wwwboard and place it in the messages directory. You'll then be able to restrict viewing and posting to your board. AuthUserFile /path/to/wwwboard/messages/.htpasswd AuthName Your WWWBoard Title Here AuthType Basic <Limit GET> require valid-user </Limit> The .htpasswd File This is another text formatted file that MAY reside in the messages directory of your wwwboard. The name of the file should be .htpasswd with permissions set at world readable/writeable. The .htpasswd file is structured with each username:password appearing on separate lines like so ... webmaster@somedomain.com:aepTOqxOi4i8U foo@bar.com:aeVxKcrcWuh2. gates@msn.com:aeELg5kr4KHbIIf you're sensitive about a registered user typing in .htpasswd in their browser to retrieve the usernames of your registered users, you can protect your .htpasswd file by hiding it below your sites web root directory. Let's say that the path to your wwwboard is /usr/userid/public_html/wwwboard/ and you want to protect your .htpasswd file from being viewed over the net. You need to create a new directory at the same level as your public_html directory that would resemble /usr/userid/htaccess/wwwboard/ and place the .htpasswd file in the that directory. Be sure to change AuthUserFile path to /usr/userid/htaccess/wwwboard/.htpasswd in the .htacces file located at /usr/userid/public_html/wwwboard/messages/.htaccess But before trying this type of stealth protection, you should first setup the .htpasswd file in your messages directory as stated further above to make sure everything works fine at that level. Odds are that your registered users wouldn't think of trying to access the .htpasswd file to start with, so it's not that big of a security issue. Unless you're a paranoid schzoid like me. :-) Why Set Usernames As Email? You should use the registered user's email
address as the username for several reasons. First is that email addresses
will be stored in the .htpasswd file allowing you to easily extract
"registered" members email addresses if you need to contact them
concerning updates to your board. Another reason to use email addresses
is that you can insure that users are not posting anonymously by making
a modification to the wwwboard.cgi script as follows ....
Also, be sure to add the above SSI in your posts.html file,
which will be located in your messages directory, which will automatically
put your registered user's email address in the "Post A Message" form.
The HTML coding for automatically recording the email of those who
post using the "Post A Message" form is ..
<INPUT type=HIDDEN name="email" VALUE="<!--#echo var="REMOTE_USER"-->">
| |||||||||||||