|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/softechgrp/login/new/ |
Upload File : |
----------------------------------------------------------------------------------------------------
TIP: If you're new to all this, and you want to get up and running as quickly as
possible, you might consider it more efficient to have DMscripts set it up, for
a reasonable fee of US$25.00
----------------------------------------------------------------------------------------------------
TIP: Post your questions and comments about DMpassword in our support forums at www.dmscripts.com
----------------------------------------------------------------------------------------------------
TIP: For convenience, you can use the page up/down buttons to view this file in Notepad.
----------------------------------------------------------------------------------------------------
DMpassword.zip should include the following files:
DMpassword.cgi
DMpassword.setup
sub-libShop.cgi
cgi-lib.cgi
template.html
----------------------------------------------------------------------------------------------------
Use the following directory structure. Directories in upper case, ordinary files in lower case.
Permissions.
|
|_ _ _CGI-BIN/ (0777) drwxrwxrwx
|_ _ _DMpassword.cgi (0755) -rwxr-xr-x
|_ _ _DMpassword.setup (0644) -rw-r--r--
|_ _ _cgi-lib.cgi (0755) -rwxr-xr-x
|_ _ _sub-libShop.cgi (0755) -rwxr-xr-x
|_ _ _template.html (0644) -rw-r--r--
|_ _ _pass.dat (0777) -rwxrwxrwx
--------------------------------------------------------------------------------------------
DEFINING THE PROGRAM VARIABLES FOR `DMpassword.cgi'. OPEN `DMpassword.setup' IN A TEXT EDITOR NOW.
--------------------------------------------------------------------------------------------
You must define the following variables to suit your own server's requirements. The
examples below can only take you as far as your `public_html' directory. This is where
your `index.html' is usually stored. Note that the names of these directories will
probably be different on your server. Your `cgi-bin' should hang off your `public_html'
directory. Study the directory structure above. Only your web host can provide you with
information about your individual server configuration. If you're new to all this, and
you want to get up and running as quickly as possible, you might consider it more efficient
to have DMscripts set it up, for a reasonable fee US$25.00
1. Template file. You can customize this html file to look like the rest of your site, or
just use it for your entire site.
$templatefile="/path/to_the/public_html/cgibin/template.html";
2. Path to password file. You must create this file yourself, create `pass.dat' in your
favourite text editor.
$pwFile="/path/to_the/public_html/cgibin/pass.dat";
3. Url of DMpassword.cgi.
$progUrl="http://www.yourdomain.com/cgibin/DMpassword.cgi";
4. Your server's mail program. Try this first, but it may be different on your server.
Find out from your web host.
$mailprog = '/usr/lib/sendmail'; (For UNIX)
5. Email address to receive new registration notices.
$recipient = '[email protected]';
6. Define which details you want the applicant to supply, when registering for a username
and password. Pay close attention to the structure of this list, it must remain *exactly*
the same. Modify the parts between the single quotes. Add or delete elements as required.
Each element is seperated by a comma, with no commas before the first element or after the
last element. The whole list of elements is enclosed within parentheses.
@regFieldnames=('First name','Surname','House No. and Street',
'Suburb','State','Postcode','Phone','Email','Choose a username');
7. Your web site address for a link back to your home page.
$domain="http://www.yourdomain.com/";
8. Files which you want to restrict access to. Define as many files as you need. Make sure you
change the extensions of the actual files to `*.txt' . It would be wise to keep your
originals local, and use copies for this.
eg: Change `filename.html' to `filename.txt', and put it in the hash list below. Then place
the link on your webpage as appropriate (more about this below). This document will now
be dealt with by DMpassword.cgi
%restricted_files=( "first_filename" => "/full/path/to/the/restricted/first_file.txt",
"second_filename" => "/full/path/to/the/restricted/second_file.txt",
"third_filename" => "/full/path/to/the/restricted/third_file.txt",
"fourth_filename" => "/full/path/to/the/restricted/fourth_file.txt");
The part on the left of the => is a name that you choose for the file. It could be any name,
including the file name itself, (which might be less confusing).
Place the same name at the end of a link which will point to the restricted file. Place it
after the = at the end of the link. eg:
<a href='http://www.yourdomain.com/cgi-bin/DMpassword.cgi?action=first_filename'>First</a>
<a href='http://www.yourdomain.com/cgi-bin/DMpassword.cgi?action=second_filename'>Second</a>
<a href='http://www.yourdomain.com/cgi-bin/DMpassword.cgi?action=third_filename'>Third</a>
<a href='http://www.yourdomain.com/cgi-bin/DMpassword.cgi?action=fourth_filename'>Fourth</a>
Note how the names in the list above correspond to the names at the ends of the links.
The part on the right of the => is the full path to the file on your server. DMforum will output
only these files on verification of the user's username and password.
Change only what is between the double quotes.
Notes on hash lists.
Shown above is a hash list. Pay attention to the structure. It consists of "key" => "value" pairs.
The "key" => "value" pairs are seperated by commas, with no comma before the first pair, and no
comma after the last. Add, delete or modify the pairs as required using the exact same syntax.
The entire list of "key" => "value" pairs is enclosed within parentheses.
---------
UPLOADING
---------
Follow the directory structure at the top of this page, and set the permissions as indicated.
Use your favourite ftp program. There are some freeware versions of `WSftp' and `cuteFTP'
on the web. Just type `ftp software' or something into your search engine.
Upload your files in ASCII mode. On some ftp programs, there is an option which lets the
program take care of this for you.
Don't forget, this lite version of DMpassword requires you to create your own `pass.dat'. Just
open a new file in a text editor such as Notepad, and name it `pass.dat'. That's it.
This is too easy. Just upload the following files to your cgi-bin directory, and set their permissions as in the diagram at the top of the page.
DMpassword.cgi
DMpassword.setup
sub-libShop.cgi
template.html
cgi-lib.cgi
pass.dat
YOU ARE RESPONSIBLE FOR THE PROTECTION OF YOUR OWN DIRECTORIES. IF YOU HAVE SENSITIVE
INFORMATION STORED ANYWHERE ON YOUR SITE, YOU ARE ADVISED TO DO AS MUCH AS YOU CAN TO
PROTECT IT.
-------
FINALLY
-------
Make sure the path to Perl is defined correctly in `DMpassword.cgi' and
`sub-libShop.cgi'.
Usually the top line of each of these programs must be #!/usr/bin/perl
or #!/usr/local/bin/perl . You can try these first. If they don't work, then only
your web host can help you.
With a little tweaking, DMpassword can be used in other ways.
Typically, the logon page is called from somewhere within the program dealing with
the pages you wish to restrict access to, or from one or more links on your site.
For example, you may wish to allow all visitors to browse your shop and see prices
and products. But when they try to use the shopping cart, some code within your
shop program brings up the logon page and asks for their username and password.
The logon page asks visitors for their username and password, when they request
a restricted page to be displayed. If they don't have these, they are shown a link
which will take them to the registration page, and sign them up as a member.
The password is generated, encrypted, stored in `pass.dat', and then sent to the
email address the user supplied. The user can then logon, and gain access to the page.
Ask your Perl programmer about this. You must identify the places in your program which
output pages.
Note that even if unauthorised access is gained to the user password file (pass.dat),
the passwords are encrypted, and cannot be used to log on. However, you may have other
sensitive information in that file. PLEASE MAKE AN EFFORT TO PROTECT YOUR DIRECTORIES.
----------------------------------------------------------------------------------------------------
TIP: If you're new to all this, and you want to get up and running as quickly as
possible, you might consider it more efficient to have DMscripts set it up, for
a reasonable fee of US$25.00
----------------------------------------------------------------------------------------------------