وهذا ما بداخل ملف admin_setup.cgi :
كود:
#!/usr/bin/perl
#######################################################
# Home Free v3.24n (Nearly null)
#
# Created by Solution Scripts
# Email: solutions@solutionscripts.com
# Web: http://solutionscripts.com
#
#######################################################
#
#
# COPYRIGHT NOTICE:
#
# Copyright 1999 Solution Scripts All Rights Reserved.
#
# Selling or redistributing the code for this program
# without prior written consent is expressly forbidden.
# In all cases copyright and header must remain intact.
#
#######################################################
$|=1;
require "variables.pl";
require "dblib.pl";
require "adminlib.pl";
$time = time;
($sec,$bmin,$hour,$bmday,$bmon,$byear,$bwday,$gy,$isdst) = gmtime($time);
$bmon++;
$byear += 1900;
$gnow = "$bmon.$bmday.$byear";
&initalize;
if ($INPUT{'setup'}) { &Header(0); &setup; }
elsif ($INPUT{'action'} eq "setup") { &verify_setup; }
elsif ($INPUT{'setup_check'}) { &setup_check; }
&print_login;
&Footer;
sub verify_setup {
unless (($access_level =~ /ALL ACCESS/) || ($access_level =~ /config/)) { &unauth; }
&Header(0);
&setup;
}
########## SETUP ##########
sub setup {
$bpass = $_[0];
unless ($url_cgi) {
$url_cgi = "http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'}";
$url_cgi =~ s/\/admin_setup\.cgi$//;
}
unless ($mime_path) {
$mime_path = "$ENV{'DOCUMENT_ROOT'}/mime";
}
unless ($url_mime) {
$url_mime = "http://$ENV{'HTTP_HOST'}/mime";
}
unless ($mail_prog) {
$cmdline = "which sendmail";
$out=`$cmdline 2>&1`;
$mail_prog = "$out";
}
unless ($domain) { $domain = $ENV{'SERVER_NAME'}; }
$current_path = $ENV{'SCRIPT_FILENAME'};
$current_path =~ s/admin_setup\.cgi//ig;
print <<EOF;
<TABLE CELLPADDING=5 CELLSPACING=0 WIDTH=100% BGCOLOR=white BORDER=0>
<TR><TD colspan=3 bgcolor=#336699 align=center>
<font face=arial size=3 color=white><b>Welcome To Home Free v3.24n</b></FONT></TD></TR>
<TR><TD> </TD><TD colspan=2><FORM METHOD=POST ACTION="$files::setup">
EOF
if ($error) {
print <<EOF;
$css_font
<font color=red>
There were errors configuring you variables. The following step(s) had errors:
<font color=black>$error</FONT>. The text in red below the step itself will tell
you what went wrong and possibly how to fix it. </FONT>
EOF
}
else {
print <<EOF;
$css_font
The absence of the navigation menu image at left is normal for first time installations, and before
you can start giving away free websites, we need to configure a few variables for this program to run
correctly on your server and know the installed locations of your dirs and images. This setup has been
built in such a way as to make the set-up go quickly and easily for you. <BR>
<BR>
I have also included a link that will <a href=perldiver.cgi target=new>list your server environment
variables</a> and determine your location for sendmail (opens new window).
EOF
}
print <<EOF;
<BR>
</TD></TR>
<TR><TD colspan=3 bgcolor=#336699>
$css_font
<b><font color=white> Step 1</FONT></b>
</TD></TR>
<TR><TD> </TD>
<TD align=left colspan=2>
<BR>$css_font
EOF
if ($passwords) {
print <<EOF;
Step 1 is where we usually ask you to set a login/password, but since yours is already set, all we need you to do
is enter them below, to verfiy that you have authorization to edit this configuration
EOF
$user_word="Username:";
$pass_word="Password:";
}
else {
print <<EOF;
We will first need to set your admininstrative USERNAME and PASSWORD. After you finish this setup, and
reload admin.cgi the next time, you will be asked for this username/password. Do not enter anything in
the reg key field below, and you will never see it again... -NnN-
EOF
$user_word="Set Username:";
$pass_word="Set Password:";
}
print <<EOF;
</TD></TR>
<TR><TD> </TD>
<TD align=left valign=top>
$css_font
<B>$user_word
</TD><TD valign=top>
<input type="text" name="username" value="$INPUT{'username'}" size="30" maxlength="50">
</TD></TR>
<TR><TD> </TD>
<TD align=left valign=top>
$css_font
<B>$pass_word
</TD><TD valign=top>
<input type="Password" name="password" value="$INPUT{'password'}" size="30" maxlength="50">
</TD></TR>
<TR><TD> </TD>
<TD align=left valign=top>
$css_font
<B>
Registration key:</B>
</TD>
<TD valign=top>
EOF
if ($passwords) {
print "<input type=\"Hidden\" name=\"ry\" value=\"$INPUT{'ry'}\">$css_font Skip to next step</FONT>\n";
}
else {
print "<input type=\"regkey\" name=\"ry\" size=\"33\" value=\"IGNORE THIS FIELD!- Nearly Null -\" maxlength=\"50\">\n";
}
print <<EOF;
<BR><BR>
</TD></TR>
<TR><TD colspan=3 bgcolor=#336699>
$css_font
<b><font color=white> Step 2</FONT></b>
</TD></TR>
<TR><TD> </TD>
<TD align=left colspan=2>
<BR>$css_font
$error_2
We will first start by giving a name to your Home Free program. So when members sign up amoung other times
they will see something like \"Welcome to Tim\'s Free Web Sites\", where Tim's Free Web Sites would be the name.
<BR><BR></TD></TR>
<TR><TD> </TD>
<TD align=left valign=top width=100%>
$css_font
<B>Your Free Sites name:</B>
</TD><TD align=center valign=top>
<input type="Text" name="setup_free_name" value="$free_name" size="50" maxlength="60">
<BR><font face=arial size=1>(edit to your own free sites name)</font>
<BR>
</TD></TR>
<TR><TD colspan=3 bgcolor=#336699>
$css_font
<b><font color=white> Step 3</FONT></b>
</TD></TR>
<TR><TD> </TD>
<TD align=left colspan=2>
<BR>$css_font
$error_3
Now we need your email address. This will be the "from" email address on all emails sent to members, and the
one that they will be refered to should they have a question or problem. In the second text box we need your Name or nickname that you go by.
This will also be used in emails sent to members, showing up in the From email field, along with the email address.<BR><BR>
</TD></TR>
<TR><TD> </TD>
<TD valign=top>
$css_font
<B>Your Email Address:</B>
</TD><TD valign=top>
<input type="Text" name="setup_email" value="$your_email" size="30">
<BR><BR></TD></TR>
<TR><TD> </TD>
<TD valign=top>
$css_font
<B>Your From nickname:</B>
</TD><TD valign=top>
<input type="Text" name="setup_email_name" value="$your_name" size="30">
<BR><BR></TD></TR>
<TR><TD colspan=3 bgcolor=#336699>
$css_font
<b><font color=white> Step 4</FONT></b>
</TD></TR>
<TR><TD> </TD>
<TD align=left colspan=2>
<BR>$css_font
$error_4
The next 2 steps require you to enter a path (the system of folders), so we can store the data files
and member's dirs in the correct spot. The path is <b>not the url and does not start with http://</B>.
I'll help you out a bit by showing that your document root path is: <font color=red>$ENV{'DOCUMENT_ROOT'}</FONT>
... and the path for this admin_setup.cgi script is: <BR>
<BR>
<center><font color=red><B>$current_path</FONT></B> </center>
<BR>
The first path we need is the location of were you want the members <b>DATA</b> stored (their emails
and other Home Free data files). This dir <B>should not</B> be readable from the web. Either below
your document root is good, or in a cgi-bin where text files can not be accessed by the browser...
of course the paths you need or want to use may be different... but in most cases, you can simply cut & paste this
script's path from above into this field, and then add the name of the dir that <b>you created</b>
to hold your data files to the end of this path: <BR>
<BR>
</TD></TR>
<TR><TD> </TD><TD valign=top>
$css_font
<B>Data Dir Path:</B>
</TD><TD align=center valign=top>
<input type="Text" name="setup_path" value="$path" size="50">
<BR><font face=arial size=1>(do not place a trailing slash at the end)</font>
<BR>
</TD></TR>
<TR><TD colspan=3 bgcolor=#336699>
$css_font
<b><font color=white> Step 5</FONT></b>
</TD></TR>
<TR><TD> </TD>
<TD align=left colspan=2>
<BR>$css_font
$error_5
Now we need the path to the <B>MEMBERS</B> dir that will hold their homepages... this dir should be readable
from the web at all times, and this dir will also become part of your member's url... in most cases you can simply
cut & paste this script's path from above into this field, and then add the name of the dir that
<b>you created</b> to hold your member's files to the end of this path:
</TD></TR>
<TR><TD> </TD><TD valign=top>
$css_font
<B>Members Dir Path:</B>
</TD><TD align=center valign=top>
<input type="Text" name="setup_free_path" value="$free_path" size="50">
<BR><font face=arial size=1>(do not place a trailing slash at the end)</font>
<BR>
</TD></TR>
<TR><TD colspan=3 bgcolor=#336699>
$css_font
<b><font color=white> Step 6</FONT></b>
</TD></TR>
<TR><TD> </TD>
<TD align=left colspan=2>
<BR>$css_font
$error_6
Now we need to set a few urls. This is the spot where they need to start with <b>http://</b>.
All urls should point to a directory. <BR>
<BR>
The first url is the url to where your cgi files are, the url to the directory where this file is.
If you are setting up Home Free for the first time, we took the liberty of entering this url for
you, if it is different from what is below, please change it.
</TD>
</TR>
تابع ...