#!/usr/local/bin/perl # sample.cgi # Written By David S. Choi, dc@sitedeveloper.com # 15 June 1998 # # Sample cgi script utilizing dcprotect.pl # #------------------------------------------------------------------ # $path is directory path to the location of this program # Try using relative path $location = "http://www.nobleamaipa.com"; $path = "."; # require all library files require "$path/dclib.pl"; require "$path/dcprotect.pl"; require "$path/cgi-lib.pl"; require "$path/sitewrapper.pl"; # Print HTTP header but note it doesn't end here print "Content-type: text/html\n"; # Read in all the input data &ReadParse; # $thisurl is the URL of this script $thisurl = "http://www.nobleamaipa.com/cgi/sample11.cgi"; # $password_file_dir is the directory where all # authentication files will be created and kept # This directory must be set to 777 $password_file_dir = "$path/Data"; # Path to the template file used by dcprotect.pl $templatefile = "$path/dcprotect.htmlt"; # Platform "NT" or "UNIX" $platform = "UNIX"; # setup file name $in{'auth_setup_file'} = "auth_setup_file.txt"; # password file name $in{'password_file'} = "auth_user_file.txt"; # cookie expriation date if 'Remember My Password' is used $in{'expires'} = "Fri, 31-Dec-2010 12:00:00 GMT"; # Cookie name $in{'cookie_name'} = "DCProtectSessionID"; # Username, Password, and Group are always required # They are appended at the very beginning of @login_fields # and %field_input_type in dcprotect subroutine # Also, Status is appended at the end of @login_fields @login_fields = qw(Firstname Lastname EMail IPA); %field_form_type = ( Firstname => 'text|40|required', Lastname => 'text|40|required', EMail => 'text|40', IPA => 'select|nobleamaipa' ); # Following line adds authentication $r_userdata = dcprotect($thisurl,$password_file_dir,\%in, \@login_fields,\%field_form_type); # Be sure to print the end of HTTP Header print "\n"; # Below here you place your CGI code # Following links allow you and your users to # Login/Logout, etc... If you are 'Registering Via EMail' # You should have 'User Menu' available so that # your users can change their passwords if ($r_userdata->{'IPA'} eq "nobleamaipa") { print qq~