.htaccess WONT WORK

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
SA
Guest





PostPosted: Tue Nov 12, 2002 5:35 am    Post subject: .htaccess WONT WORK Reply with quote

I am trying to restrict access to my cgi-bin because a very important file in there has some passwords in it and whenever people click on the type of file it is the server ccrashes... I have win2k how can I cut access to cgi-bin and yet still have it used on my own personal webpage and certain people I permit...
Thanks,
Sean
Back to top
sa
Guest





PostPosted: Tue Nov 12, 2002 5:53 am    Post subject: k Reply with quote

It works lol but its not really what I am looking for... I need to get a file that is currently in a web accessible folder out of it but I have tried everything and nothing has worked... Let me add the code and explain...

I need to get passfile for a web community program out of cgi-bin... however whenever I move it the program just trys to re config... I tried switching the remote path and everything... What am I doing wrong?

[code:1:332128dae6]
#!/usr/local/bin/perl
#########
#Please set the path above to your perl path.
#The format is as follows: #!/path/to/perl
#The most common paths to perl are /usr/local/bin/perl or /usr/local/perl
#So you would either use #!/usr/local/bin/perl or #!/usr/local/perl
#If you are not sure of the perl path please contact your system administrator.
#If you get an error message, this is the first place to check.
#########
$giveawaysite = "My Site";
$giveawayurl = "http://members.elitehosts.com";
$giveawayhome = "Elite Hosts, Inc.";
$femail = "welcome\@elitehosts.com";
# Copyright(c) 1999 Avi Brender.
###### DO NOT EDIT BELOW THIS LINE!!
print "content-type:text/html\n\n";
#############################
$referer = "http:\/\/$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}";
$title = "Angoco Hosting";
unless ($ENV{'CONTENT_TYPE'} =~ m#^multipart/form-data#) {
&parse_form;
}
if ($ENV{'CONTENT_TYPE'} =~ m#^multipart/form-data#) {
require "prefs";
require "cgi-lib.pl";
$mailprog = "/usr/lib/sendmail";
&upload;
}
if (-e "prefs"){chmod(0777,"prefs");}
if (-e "$passfile"){chmod(0777,"$passfile");}

$action=$input{'action'};
unless ($action eq "Finish" || $action eq "saveid" || $action eq "confirm") {
if (!-e "prefs") {
&setup;
}else {
open(prf,"prefs") ;
$prf = <prf>;
if ($prf eq "1\;" || $prf eq ""){
&setup;
}}
require "prefs";
}
require "cgi-lib.pl";
unless($action eq "" || $action eq "Add User" || $action eq "Delete User") {
if ($ENV{'HTTP_REFERER'} =~ "$referer") {
}else {

unless ($referer eq "http://members.elitehosts.com/index.html" || $referer eq "http://members.elitehosts.com"){
&top;
print "You can't call this script from: $ENV{'HTTP_REFERER'}<BR>It must be called from: $referer";
&bottom;
exit 0;
}}}
$username = $input{'userid'};
$usern = "$username";
@days = ('Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
$time = sprintf("%02d:%02d:%02d",$hour,$min,$sec);
$year += 1900;
$tdate = "$days[$wday], $months[$mon] $mday, $year";
$action = $input{'action'};
$url = "http://" . $ENV{SERVER_NAME} . $ENV{'SCRIPT_NAME'};
$cgi_script = $url;
$userlogon = $input{'userid'};
$u = $input{'userid'};
if ($u eq "") {
$u = $input{'userlogon'};
}
open(PS, "$passfile");
@fl = <PS>;
foreach $ent (@fl) {
($suserid, $pass, $stat, $disk, $first, $last, ,$email, $CENSORED, $expire, $vlogon, $ext, $maxfiles, $maxdirs, $log, $header, $footer, $homedir, $homeurl, $changepass) = split(/\:\:/,$ent);
if ($suserid eq "$u") {
$usrdir = $homedir;
$userurl = $homeurl;
$vext = $ext;
}}close (PS);
if ($action eq "saveid"){&saveid;}
if ($action eq ""){&logonform;}
if ($action eq "Logon"){&logon_user;}
if ($action eq "Log Out"){&logout;}
if ($action eq "Delete File"){&deleteform;}
if ($action eq "Delete Now"){&delete;}
if ($action eq "Rename The File"){&rename;}
if ($action eq "Get File"){&getfile;}
if ($action eq "Get The File"){&uploadnow;}
if ($action eq "Copy File"){&copyform;}
if ($action eq "Copy The File"){&copyfile;}
if ($action eq "copyfile"){&copyfile;}
if ($action eq "Change Your Password"){&changepform;}
if ($action eq "changepass"){&changepass;}
if ($action eq "Add User"){&adduser;}
if ($action eq "adduser"){&addnow;}
if ($action eq "Edit HTML File"){&editfileform;}
if ($action eq "Create New HTML File"){&newfileform;}
if ($action eq "editfile"){&editfile;}
if ($action eq "Save File"){&savefile;}
if ($action eq "Change Password"){&changepasswordform;}
if ($action eq "Change Users Password"){&changeupassword;}
if ($action eq "Fix List Of Files"){&fixform;}
if ($action eq "Delete User"){&deleteuser;}
if ($action eq "Finish"){&stp2;}
if ($action eq "Move The File"){&movefile;}
if ($action eq "delnow"){&deluser;}
if ($action eq "copy") {&copyform;}
if ($action eq "save"){&save;}
if ($action eq "move"){&moveform;}
if ($action eq "back"){&good_logon;}
if ($action eq "chdir") {&good_logon;}
if ($action eq "rename") {&renameform;}
if ($action eq "delete") {&deleteform;}
if ($action eq "edit") {&editfile;}
if ($action eq "Create New Directory"){&createdir;}
if ($action eq "Make Directory"){&makedir;}
if ($action eq "View Suspended Users") {&vsu;}
if ($action eq "Previous Directory"){&prevdir;}
if ($action eq "Setup Script"){&setup;}
if ($action eq "confirm"){&conf;}
if ($action eq "am"){&am;}
if ($action eq "lostpass"){&lp;}

# If no action was selected

print "<H1><B>Error 197</B><HR></H1>This command is unknown. Please go back and try again.";
exit 0;
sub lp {

&top;
if ($input{'sub'} ne "send") {
print "<BR><BR><font color=\"navy\">If you forgot your password (if not, why are you here?), type in the email address and a new password
will be emailed to you.<input type=\"hidden\" name=action value=lostpass>
<input type=hidden name=sub value=send><BR>
Email:<input type=\text\ name=\"email\"><BR>
Username:<input type=\text\ name=\"userid\">
<BR><input type=submit value=\"Send My New Password\">
";}
else {
srand;
$total = "10";
$rpass1 = int(rand($total));
$rpass2 = int(rand($total));
$rpass3 = int(rand($total));
$rpass4 = int(rand($total));
$rpass5 = int(rand($total));
$rpass6 = int(rand($total));
$rpass7 = int(rand($total));
$rpass = "$rpass1$rpass2$rpass3$rpass4$rpass5$rpass6$rpass7";
open(PSF, "$passfile");
@en = <PSF>;
foreach $entr (@en) {
($userid, $pass, $sus, $disk, $firs, $las, $email) = split(/\:\:/,$entr);
if ($userid eq $input{'userid'} && $email eq $input{'email'}) {
$okk = "52";
open(MAIL,"|$mailprog -t");
print MAIL "To: $email\n";
print MAIL "From: lostpassword\@fixit.com\n";
print MAIL "Subject: Your New Password\n";
print MAIL "Dear $firs, $las\n";
print MAIL "You have requested to have your password changed because you forgot it.\n";
print MAIL "Here is your new user information:\n";
print MAIL "Userid: $input{'userid'}\n";
print MAIL "Password: $rpass\n";
print MAIL "If you did not request to have your password changed, please logon with the new password and change it.\n";
close (MAIL);

open(DATA,"$passfile")|| &ERROR("CANT OPEN1");
@lines = <DATA>;
close(DATA);
open(DATA,">$passfile") || &ERROR("CANT OPEN2");
foreach $line (@lines)
{
($loginname, $password, $a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l,
$m, $n, $o, $p, $q) = split(/\:\:/,$line);
if ($input{'userid'} eq $loginname && $input{'email'} eq "$e")
{
$confirm = crypt($rpass,time);
print DATA ("$userid\:\:$confirm\:\:$a\:\:$b\:\:$c\:\:$d\:\:$e\:\:$f\:\:$g\:\:$h\:\:$i\:\:$j\:\:$k\:\:$l\:\:$m\:\:$n\:\:$o\:\:$p\:\:$q");
}else{print DATA $line;}}
}}
unless ($okk eq "52") {
print "Sorry, your record was not found in our database. Make sure that the email address you entered corrisponds with the userid you entered.";
&bottom;
exit 0;
}
print "Your new password was emailed."; }
&bottom;
exit 0;
}
sub ext {
$var = @_[0];
if ($var =~ "\/" || $var =~ /^\.\./){

&top;
print "<BR>The filename that you have chosen ($var) is not valid.";
&bottom;
exit 0;}
@ex = split(/\,/,$vext);
foreach $exte (@ex){
if ($var =~ /$exte$/){
$ge = "1";
}}unless ($ge eq "1") {

&top;
print "<BR>Sorry, but your file must have a valid file extention.";
&bottom;
exit 0;
}}

sub setup {

print <<SSMM;
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Scripts In The Making</title>
<style>
.bl:hover{color:red;text-decoration:underline}
a{text-decoration:none}

</style>
</head>

<body bgcolor="#FFFFFF">
<div align="center"><center>
<form method="post" action="$url">

<table border="1" cellpadding="0" cellspacing="0" width="50%"
bordercolor="#000000" bordercolordark="#000000"
bordercolorlight="#000000">
<tr>
<td align="center" colspan="1" bgcolor="#000091"><font
color="#FFFFFF" face="verdana">Angoco Hosting - Main Page</font></td>
</tr>
<tr>
<td bgcolor="#CFCFCF" valign="top"><BR><font face="verdana" size="-1">
<BR><font face="aria" size="-1" color="darkblue">Please Note:
This script may not be sold.<BR>
This script may not be re-distributed<BR>
This script may not be edited<BR>

</font><font face="verdana" size="-1" color="blue">Step 1: Setup Your Main Account.<BR>
Please enter a username and password for your main account. Through this main account,
and only this account, will you be able to setup users preferences and script
settings.<BR><font color="green">
UserID:<input type="text" Name="userid" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="30"><BR>
Password:<input type="password" Name="password" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="30"><BR>
<CENTER>
<input type="hidden" name="action" value="saveid">
<input type="submit" name="submit" STYLE="background-color:#eeeeee;font:verdana;font-weight:bold;
color:#000080;font-size:xx-small;width:134;" value="Save!"></td>

</tr>
</table>
</div></center></body></form></html>
SSMM
exit 0;
}
sub am {

print <<AMM;
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Scripts In The Making</title>
<style>
.bl:hover{color:red;text-decoration:underline}
a{text-decoration:none}
</style>
</head>
<body bgcolor="#FFFFFF">
<div align="center"><center>
<form method="post" action="$url">
<input type="hidden" name="action" value="am">
<table border="1" cellpadding="0" cellspacing="0" width="85%"
bordercolor="#000000" bordercolordark="#000000"
bordercolorlight="#000000">
<tr>
<td align="center" colspan="2" bgcolor="#000091"><font
color="#FFFFFF" face="verdana">Angoco Hosting - Main Page</font></td>
</tr>
<tr>
<td width="24%" bgcolor="#CFCFCF" align="center" valign="top"><BR
<br><BR>
<INPUT TYPE="SUBMIT" name="sub" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:134;" value="User Settings"><BR><BR>
<input type="submit" name="sub" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:134;" value="Change Password"><BR><BR>


</td>
<td bgcolor="#CFCFCF" valign="top"><BR><font face="verdana" size="-1">
AMM
$sub = $input{'sub'};
$al = 0;
$s = "Save Settings For";
unless ($sub eq "Save Password File Path" || $sub eq "Save URL To Home Directories"
||$sub eq "Save Path To Home Directories" || $sub eq "Save Default Disk Space"
|| $sub eq "Save Default Settings" || $sub eq "User Settings" || $sub =~ /^Edit/
|| $sub =~ /^$s/ || $sub eq "Save New User Settings"){

open(prf, "prefs");
while (<prf>) {
@pf = split(/\n/);
foreach $ln (@pf) {
if ($ln =~ /^\$passfile/) {
$pass = 1;
}}}
close (prf);
unless ($pass eq "1") {
$al = "1";
print <<AMM;
Congradulations, you have successfully began setting up Elite Web Page Builder.<BR>
Now you have to setup some easy options. First, lets setup the path to your password file.<BR>
<BR>
<font color="red">Please enter the full path to your password file. (i.e. /usr/local/etc/httpd/htdocs/elite/passfile)
<BR>For security reasons, we recommend that you keep this file in a directory that is not web-accessible.
If not, that is ok too.<BR><font color="blue">If this file does not exist, the script will
create it. (We will create the file NOT the directory.) The directory in which the password
file resides MUST exist!<BR>
<input type="text" Name="passfile" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="50" value="/usr/local/etc/httpd/htdocs/avi/passfile"><BR>
<input type="submit" name="sub" value="Save Password File Path" style="background-color:white
;font-weight:bold;color:#000080;font-face:verdana;font-size:xx-small;">
AMM
&bo;
}if ($al ne "1"){
open(prf, "prefs");
while (<prf>) {
@pf = split(/\n/);
foreach $ln (@pf) {
if ($ln =~ /^\$nusrdir/) {
$udir = 1;
}}}close (prf);
unless ($udir eq "1") {
$al = "1";
print <<AMM;
Please enter the full path to the directory where the users files will be held.
<BR>For example if you enter /home/users in the box below, and a user signs up with the username
avib, his home directory will be /home/users/avib
<BR><BR><B>No trailing slash (/), and
MUST be web-accessible.<BR>If this directory does not exist, we will create it for you.<BR>
</b>
<input type="text" Name="userdir" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="50" value="/home/users"><BR>
<input type="submit" name="sub" value="Save Path To Home Directories" style="background-color:white
;font-weight:bold;color:#000080;font-face:verdana;font-size:xx-small;">
AMM
&bo;
}}if ($al ne "1"){
open(prf, "prefs");
while (<prf>) {
@pf = split(/\n/);
foreach $ln (@pf) {
if ($ln =~ /^\$nuserurl/) {
$uurl = 1;
}}}
close (prf);
unless ($uurl eq "1") {
$al = "1";
print <<AMM;
Please enter the URL corrisponding to the full path of the directory where the users
files will be held (the path you previously entered.)
<BR>For example if you previously entered /home/users, and a user signs up with the username
avib, his home directory will be /home/users/avib and his url will be: http://yoursite.com/users/avib
(assuming the http://yoursite.com pointed to /home";
<BR><BR><B>No trailing slash (/), and
MUST be web-accessible.<BR>
</b>
<input type="text" Name="userurl" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="50" value="http://yourisite.com/users"><BR>
<input type="submit" name="sub" value="Save URL To Home Directories" style="background-color:white
;font-weight:bold;color:#000080;font-face:verdana;font-size:xx-small;">

AMM
&bo;
}}if ($al ne "1"){
open(prf, "prefs");
while (<prf>) {
@pf = split(/\n/);
foreach $ln (@pf) {
if ($ln =~ /^\$diskspace/) {
$disks = 1;
}}}close (prf);
unless ($disks eq "1") {
$al = "1";
print <<AMM;
Please enter the default amout of disk space that each new use should be alloted.
(You can customize each user's disk space by clicking on "Users Settings" when setup
is done.)<BR>You should enter the number in bytes. Remember 1,000,000 bytes = 1mb.<BR>
For unlimited space, enter: 0<BR>
<input type="text" Name="diskspace" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="50" value="11,000,000"><BR>
<input type="submit" name="sub" value="Save Default Disk Space" style="background-color:white
;font-weight:bold;color:#000080;font-face:verdana;font-size:xx-small;">
AMM
&bo;
}}

if ($al ne "1"){

open(prf, "prefs");
while (<prf>) {
@pf = split(/\n/);
foreach $ln (@pf) {

if ($ln =~ /^\$passchange/) {
$pc = 1;
}
if ($ln =~ /^\$minpass/){
$mip = "1";
}
if ($ln =~ /^\$maxpass/){
$map = "1";
}
if ($ln =~ /^\$minuser/){
$miu = "1";
}
if ($ln =~ /^\$maxuser/){
$mau = "1";
}
}}
if ($pc eq "1" && $mip eq "1" && $map eq "1" && $miu eq "1" || $mau eq "1"){
$def = "1";
}
close (prf);

if ($def ne "1") {

$al = "1";
print <<AMM;
Last Step. This one is pretty easy. (These are just defaults, and can be changed later.)<BR><BR>

Can A New User Change His/Her Password?<BR>
<input type="radio" Name="passchange" style="background-color:#CFCFCF;font-face:verdana;
font-size:xx-small;color:black" value="yes">Yes
<input type="radio" Name="changepass" style="background-color:#CFCFCF;font-face:verdana;
font-size:xx-small;color:black" value="no">No
<br>Minimum Password Length:
<input type="text" Name="minuser" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="5" value="4"><BR>
Maximum Password Length:
<input type="text" Name="maxuser" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="5" value="8"><BR>
<BR>
Minimum Username Length:
<input type="text" Name="minpass" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="5" value="4"><BR>
Maximum Username Length:
<input type="text" Name="maxpass" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="5" value="8"><BR>
<INPUT TYPE="SUBMIT" name="sub" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:134;" value="Save Default Settings"><BR>

AMM
&bo;
}}
}if ($al ne "1" && $sub eq ""){
print <<NOO;
<font face="verdana" style="font-size:small;color:darkblue">Dear Beta Testers,<BR>
Please read the readme file!<HR><BR><BR>Congradulations, your script is set
up and you are now ready to go. Now, you may make, edit or delete users by click on User Settings
on the left side.<BR><BR><font color="red">We have worked really hard on this script, so please
just take 1 minute out of your time and rate it below. Thanks.<BR>
<table border="0" cellpadding="0" cellspacing="0" width="300">
<tr>
<td><font face="verdana"><img
src="http://cgi-resources.com/images/rate/remote_red.gif"
alt="Rate this Script @ The CGI Resource Index!"
width="300" height="11"></font></td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="300">
<tr>
<td width="20">&nbsp;</td>
<td width="260" bgcolor="#FF3232"><div align="center"><center><table
border="0" cellpadding="0" cellspacing="0">
<tr>
<td><form
action="http://cgi-resources.com/rate/index.cgi"
method="POST">
<input type="hidden" name="referer"
value="http://cgi-resources.com/"><input
type="hidden" name="link_code" value="03840"><input
type="hidden" name="category_name"
value="Programs and Scripts/Perl/Homepage Communities/"><input
type="hidden" name="link_name"
value="Angoco Hosting"><p><font
size="2" face="verdana"><b>Script Rating: </b></font><font
face="verdana"><select name="rating" size="1">
<option selected>-- </option>
<option>10 </option>
<option>9 </option>
<option>8 </option>
<option>7 </option>
<option>6 </option>
<option>5 </option>
<option>4 </option>
<option>3 </option>
<option>2 </option>
<option>1 </option>
</select> </font></p>
</form>
</td>
<td><font face="verdana"><input type="image" name
src="http://cgi-resources.com/images/rate/remote_red_sub.gif"
alt="Rate It!" align="bottom" border="0"
width="59" height="18"></font></td>
</tr>
</table>
</center></div></td>
<td width="20">&nbsp;</td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="300">
<tr>
<td colspan="3" width="300"><font face="verdana"><img
src="http://cgi-resources.com/images/rate/remote_red_bot.gif"
width="300" height="11"></font></td>
</tr>
</table>


NOO
exit 0;
}

if ($sub =~ /^Change Now/){
$new = $input{'password'};
$new2 = $input{'confirm'};

if ($new ne $new2){
print "Your passwords do not match.";
&bot;
exit 0;
}if ($new eq ""){
print "Your new password cannot be blank.";
&bot;
exit 0;
}
$npass = crypt($input{'password'},time);

open(prff, "prefs");
@ffl = <prff>;
close (prff);

open(prff, ">prefs");
foreach $nl (@ffl) {
unless ($nl =~ "adminpass" ){
print prff "$nl";
}
else {
print prff "\$adminpass = \"$npass\"\;\n";
}
}

print <<FRM;

Your Password Has Been Changed

FRM

}



if ($sub =~ /^Change Password/){
print <<FRM;

New Password:
<input type="password" name="password"
style="background-color:orange;font-size:xx-small;"><BR>

Confirm:
<input type="password" name="confirm"
style="background-color:orange;font-size:xx-small;"><BR>
<BR>
<input type="submit" name="sub" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;" value="Change Now">

FRM
}

if ($sub =~ /^Edit/) {
($com, $user) = split(/ /,$sub);
open(pass, "$passfile");
while(<pass>) {
@ps = split(/\n/);
foreach $uid (@ps){
unless (uid eq "" || $uid eq " " || $uid eq "\n"){
($userid, $pass, $stat, $disk, $first, $last, ,$email, $CENSORED, $expire, $vlogon, $ext, $maxfiles, $maxdirs, $log, $header, $footer, $homedir, $homeurl, $changepass) = split(/\:\:/,$uid);
if ($userid eq "$user") {
if ($disk eq "0") {
$ndisk = "Unlimited";
}
if ($stat eq "yes") {
$nstat = "Suspended.";
}
if ($stat eq "no") {
$nstat = "Normal.";
}if ($maxfiles eq "0") {
$nmaxfiles = "Unlimited";
}if ($maxdirs eq "0"){
$nmaxdirs = "Unlimited";
}
print <<dd;
<table border="0"><TR><TD align="right">Userid:</td><TD>
<input type="text" name="userid"
style="background-color:orange;font-size:xx-small;" value="$userid"><BR>

</td></tr><TR><Td align="right">New Password:</td><TD>
<input type="password" name="password"
style="background-color:orange;font-size:xx-small;"><BR>

</td></tr><TR><Td align="right">Confirm:</td><TD>
<input type="password" name="confirm"
style="background-color:orange;font-size:xx-small;"><BR>

</td></tr><TR><Td align="right">Name:</td><TD>
<input type="text" name="name"
style="background-color:orange;font-size:xx-small;" value="$CENSORED $first $last" ><BR>

</td></tr><TR><Td align="right">Account Dissabled?</td><TD>
dd
if ($stat eq "yes") {
print <<dk;
<input type="radio" value="yes" name="sus" checked>Yes
<input type="radio" value="no" name="sus">No
dk
}
else {
print <<dk;
<input type="radio" value="yes" name="sus">Yes
<input type="radio" value="no" name="sus" checked>No
dk
}
print <<dd;
<BR>
</td></tr><TR><Td align="right">Home Dir: </td><TD>
<input type="text" name="homedir"
style="background-color:orange;font-size:xx-small;width:250" value="$homedir" ><BR>

</td></tr><TR><Td align="right">Home URL: </td><TD><input type="text" name="homeurl"
style="background-color:orange;font-size:xx-small;width:250" value="$homeurl" ><BR>

</td></tr><TR><Td align="right">Disk Space (type 0 for unlimited):</td><TD><input type="text" name="disk"
style="background-color:orange;font-size:xx-small;" value="$disk" >bytes. (1,000,000 bytes=1mb)<BR>

</td></tr><TR><Td align="right">Change Password? </td><TD>
dd
if ($changepass eq "yes") {
print <<dk;
<input type="radio" value="yes" name="changepass" checked>Yes
<input type="radio" value="no" name="changepass">No
dk
}
else {
print <<dk;
<input type="radio" value="yes" name="changepass">Yes
<input type="radio" value="no" name="changepass" checked>No
dk
}
print <<dd;
<BR>
</td></tr><TR><Td align="right">Email:</td><TD> <input type="text" name="email"
style="background-color:orange;font-size:xx-small;" value="$email" ><BR>

<input type=hidden name="expire" value="0">
<input type=hidden name="vlogon" value="0">


</td></tr><TR><Td align="right">Valid Extentions:</td><TD><input type="text" name="ext"
style="background-color:orange;font-size:xx-small;width:250" value="$ext" ><BR>


</td></tr><TR><Td align="right">Max Files (0 = unlimited):</td><TD><input type="text" name="maxfiles"
style="background-color:orange;font-size:xx-small;" value="$maxfiles" ><BR>

</td></tr><TR><Td align="right">Max Dirs (0 = unlimited): </td><TD><input type="text" name="maxdirs"
style="background-color:orange;font-size:xx-small;" value="$maxdirs" ><BR>

</td></tr>
dd

print <<dd;
<input type=hidden name="log" value=no>

<input type="hidden" name="footer" value="none">
<input type="hidden" name="header" value="none">

<TR><TD colspan="2" align="center">
<input type="submit" name="sub" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;"value="Save Settings For $userid"><BR><BR> </table>
dd
}}}}
}
if ($sub eq "") {
print "nothing todo.";
exit 0;
}
$sp = "Save Settings For ";
if ($sub =~ /^$sp/) {
$f = " For ";
($com, $user) = split(/$f/,$sub);
print "Save Settings For $user...<BR>";
if ($input{'disk'} =~ "\,"){
$input{'disk'} =~ s/\,//g;
}
if ($input{'password'} ne "$input{'confirm'}"){
print "<BR>The new passwords don't match. Please go back and try again.";
exit 0;
}
($nsex, $nfirst, $nlast) = split (/ /,$input{'name'});

$npassword = crypt($input{'password'},time);
open (PS, "$passfile");
@pass = <PS>;
close (PS);
open (PS,">$passfile");
foreach $line (@pass) {
($useridd, $password, $sus, $disk, $first, $last, $email, $CENSORED, $expire, $vlogon,
$ext, $maxfiles, $maxdirs, $log, $header, $footer, $path, $url, $changepass)
= split(/\:\:/,$line);
if ($input{'password'} eq "") {
$pass = $password;
}else {
$pass = $npassword;}

if ($useridd eq $user){

print PS "$input{'userid'}\:\:$pass\:\:$input{'sus'}\:\:$input{'disk'}\:\:$nfirst\:\:$nlast\:\:$input{'email'}\:\:$nsex\:\:$input{'expire'}\:\:$input{'vlogon'}\:\:$input{'ext'}\:\:$input{'maxfiles'}\:\:$input{'maxdirs'}\:\:$input{'log'}\:\:$input{'header'}\:\:$input{'footer'}\:\:$input{'homedir'}\:\:$input{'homeurl'}\:\:$input{'changepass'}\n";
}else {
print PS "$line";
}
}
if (!-d "$input{'homedir'}") {
print "<B><font color=red>Warning: $user's home directory ($input{'homedir'}) does not exist! Please create it!";
}print "<BR>Your settings were saved.";

close (PS);
exit 0;
}
if ($sub eq "User Settings") {
$nu = "0";
if ($input{'subb'} eq "Save New User Settings") {
if ($input{'nexpmonth'} eq "00" || $input{'nexpmonth'} eq "0"){
$input{'nexpmonth'} = "0";
}if ($input{'starthour'} eq "0") {
$vlog = "0";
}else {
$vlog = "$input{'starthour'}:$input{'startminute'}:$input{'startap'}-$input{'endhour'}:$input{'endminute'}:$input{'endap'}";
}
$exp = "$input{'nexpmonth'}\/$input{'nexpdate'}\/$input{'nexpyear'}";
open(prff, "prefs");
@ffl = <prff>;
close (prff);

open(prff, ">prefs");
foreach $nl (@ffl) {
unless ($nl =~ "1\;"
|| $nl =~ /^\$nchangepass/
|| $nl =~ /^\$nnexpire/
|| $nl =~ /^\$nvalid/
|| $nl =~ /^\$nfext/
|| $nl =~ /^\$nmaxfiles/
|| $nl =~ /^\$nmaxdirs/
|| $nl =~ /^\$nlog/
|| $nl =~ /^\$nheader/
|| $nl =~ /^\$nfooter/
|| $nl =~ /^\$exp/
){
print prff "$nl";
}}
print prff "\$nchangepass = \"$input{'npasschange'}\"\;\n";
print prff "\$nnexpire = \"$exp\"\;\n";
print prff "\$nvalid = \"$vlog\"\;\n";
print prff "\$nfext = \"$input{'nfext'}\"\;\n";
print prff "\$nmaxfiles = \"$input{'mfiles'}\"\;\n";
print prff "\$nmaxdirs = \"$input{'mdirs'}\"\;\n";
print prff "\$nlog = \"$input{'log'}\"\;\n";
print prff "\$nheader = \"$input{'header'}\"\;\n";
print prff "\$nfooter = \"$input{'footer'}\"\;\n";
print prff "\$exp = \"$input{'exp'}\"\;\n";

print prff "1\;\n";
print "Thank you, your preferences were saved. Click <a href=\"$url?action=am&sub=User Settings\">here</a> to continue.";
&bo;
exit 0;
}
unless ($input{'subb'} eq "Save New User Settings") {

open(prf, "prefs");
while (<prf>) {
@pf = split(/\n/);
foreach $ln (@pf) {
if ($ln =~ /^\$nchangepass/){$a = 1;}
if ($ln =~ /^\$nnexpire/){$b = 1;}
if ($ln =~ /^\$nvalid/){$c = 1;}
if ($ln =~ /^\$nfext/){$d = 1;}
if ($ln =~ /^\$nmaxfiles/){$e = 1;}
if ($ln =~ /^\$nmaxdirs/){$f = 1;}
if ($ln =~ /^\$nlog/){$g = 1;}
if ($ln =~ /^\$nheader/){$h = 1;}
if ($ln =~ /^\$nfooter/){$i = 1;}
if ($ln =~ /^\$exp/){$j = 1;}
if ($a eq "1" && $b eq "1" && $c eq "1" && $d eq "1" && $c eq "1" && $f eq "1" && $g eq "1"
&& $h eq "1" && $i eq "1" && $j eq "1"){
$nu = "1";
}}}
close (prf);
unless ($nu eq "1") {
$al = "1";
print <<AMM;

You are about to set up your default preferances for new users. When a new users signs up,
the settings you enter below will be applied to new users. You can configure each user seperatly
after they sign up, by clicking on users settings then find their entry, and click the button
labeled "Edit"<BR><BR><font face="verdana,verdana,verdana" size="-1">
Can New Users Change Their Password? <select name="npasschange"
style="font-size:xx-small;font-face:verdana"><option>yes</option>
<option>no</option></select><BR><BR>
Date For New Accounts To Expire (mm/dd/yy)
(Don't worry, it's y2k compliant. 00 will translate as 2000 and 01 will be 2001 and etc.)
<input type="text" name="nexpmonth" size="1" maxlength="2" style="font-size:xx-small;font-face:verdana ">
/
<input type="text" name="nexpday" size="1" maxlength="2" style="font-size:xx-small;font-face:verdana ">
/
<input type="text" name="nexpyear" size="1" maxlength="2" style="font-size:xx-small;font-face:verdana ">
- Enter 00 in the month field for no experation.
<BR><BR>
What should happen to expired accounts? <select name="exp"
style="font-size:xx-small;font-face:verdana "><option>delete</option><option>
suspend</option></select><BR><BR>
Accounts Can Log on Between (Select 0 for the start hour to dissable):
<BR>
<select name="starthour" size="1" style="font-size:xx-small;font-face:verdana "><option>
0</option>
<option>1</option><option>2</option><option>3</option><option>4</option><option>5</option>
<option>6</option><option>7</option><option>8</option><option>9</option><option>10</option>
<option>11</option><option>12</option></select><select name="startminute" size="1"
style="font-size:xx-small;font-face:verdana ">
<option>00</option><option>01</option><option>02</option><option>03</option><option>04</option>
<option>05</option><option>06</option><option>07</option><option>08</option>
<option>09</option><option>10</option><option>11</option><option>12</option>
<option>13</option><option>14</option><option>15</option><option>16</option>
<option>17</option><option>18</option><option>19</option><option>20</option>
<option>21</option><option>22</option><option>23</option><option>24</option>
<option>25</option><option>26</option><option>27</option><option>28</option>
<option>29</option><option>30</option><option>31</option><option>32</option>
<option>33</option><option>34</option><option>35</option><option>36</option>
<option>37</option><option>38</option><option>39</option><option>40</option>
<option>41</option><option>42</option><option>43</option><option>44</option>
<option>45</option><option>46</option><option>47</option><option>48</option>
<option>49</option><option>50</option><option>51</option><option>52</option>
<option>53</option><option>54</option><option>55</option><option>56</option>
<option>57</option><option>58</option><option>59</option>
</select><select name="startap" size="1"
style="font-size:xx-small;font-face:verdana ">
<option>am</option>
<option>pm</option>
</select> - <select name="endhour" size="1"
style="font-size:xx-small;font-face:verdana ">
<option>1</option><option>2</option><option>3</option><option>4</option>
<option>5</option><option>6</option><option>7</option><option>8</option>
<option>9</option><option>10</option><option>11</option><option>12</option>
</select><select name="endminute"
style="font-size:xx-small;font-face:verdana " size="1">
<option>00</option><option>01</option><option>02</option><option>03</option>
<option>04</option><option>05</option><option>06</option><option>07</option>
<option>08</option><option>09</option><option>10</option><option>11</option>
<option>12</option><option>13</option><option>14</option><option>15</option>
<option>16</option><option>17</option><option>18</option><option>19</option>
<option>20</option><option>21</option><option>22</option><option>23</option>
<option>24</option><option>25</option><option>26</option><option>27</option>
<option>28</option><option>29</option><option>30</option><option>31</option>
<option>32</option><option>33</option><option>34</option><option>35</option>
<option>36</option><option>37</option><option>38</option><option>39</option>
<option>40</option><option>41</option><option>42</option><option>43</option>
<option>44</option><option>45</option><option>46</option><option>47</option>
<option>48</option><option>49</option><option>50</option><option>51</option>
<option>52</option><option>53</option><option>54</option><option>55</option>
<option>56</option><option>57</option><option>58</option><option>59</option>
</select><select name="endap" size="1"
style="font-size:xx-small;font-face:verdana ">
<option>am</option>
<option>pm</option>
</select><BR><BR>
Valid File Extentions (Type 0 to allow all extentions):
<input type="text" name="nfext" style="font-size:x-small;font-face:verdana;width:250"
value=".html,.htm,.txt,.gif,.jpg,.mpeg,.gif,.wav,.midi"><BR><BR>
Max Number Of Files: <input type="text" name="mfiles"
style="font-size:xx-small;font-face:verdana"
value="0" size="3">
Directories: <input type="text" name="mdirs"
style="font-size:xx-small;font-face:verdana"
value="0" size="2">(0 for unlimited)<BR><BR>
Do you wish to log a new users actions? <select name="log"
style="font-size:xx-small;font-face:verdana">
<option>yes</option><option>no</option></select><BR><BR>
If you wish to put a header and/or footer on a users page, type the filename
of the file containing the header and one containing the footer. (type "none" for none)
Header: <input type="text" name="header"
style="font-size:xx-small;font-face:verdana"
value="none" >
Footer: <input type="text" name="footer"
style="font-size:xx-small;font-face:verdana"
value="none" ><BR>
<CENTER><input type="hidden" name="sub" value="User Settings">
<input type="submit" name="subb" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:160;"
value="Save New User Settings"><BR><BR>
AMM
&bo;
}}


open(pass, "$passfile");
while(<pass>) {
@ps = split(/\n/);
foreach $uid (@ps){
unless (uid eq "" || $uid eq " " || $uid eq "\n"){
($userid, $pass, $stat, $disk, $first, $last, $email, $CENSORED, $expire, $vlogon, $ext, $faxfiles, $maxdirs, $log, $header, $footer, $homedir, $homeurl, $changepass) = split(/\:\:/,$uid);
if ($stat eq "no") {
$stat = "Normal";
}if ($stat eq "yes") {
$stat = "Dissabled";}
print <<DD;
<table border="1" cellpadding="0" cellspacing="0" width="99%"
bgcolor="#FFFFFF" bordercolor="#808080" bordercolordark="#808080"
bordercolorlight="#808080">
<tr>
<td width="50%"><font size="-1" face="verdana,verdana">Name: <font color="red" size="-1"><B>$CENSORED $first $last</td>
<td width="50%"><font size="-1" face="verdana,verdana">UserID: <font color="red" size="-1"><B>$userid</td>
</tr>
<tr>
<td width="50%"><font size="-1" face="verdana,verdana">Status: <font color="red" size="-1"><B>$stat</td>
<td width="50%"><input type="submit" name="sub" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:134;" value="Edit $userid"></td>
</tr>
</table><BR>

DD
}}}
print "</form>";
print <<DD;
<form method="post" action="$url">
<input type="submit" name="action" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:134;" value="Add User">
<input type="submit" name="action" STYLE="background-color:#eeeeee;
font:verdana;font-weight:bold;color:#000080;font-size:xx-small;width:134;" value="Delete User">
<BR></form>
DD
}
if ($sub eq "Save Path To Home Directories") {

open(prf, "prefs");
@fl = <prf>;
close (prf);

open(prff, ">prefs");
foreach $l (@fl) {
unless ($l =~ "1\;" || $l =~ /^\$usrdir/){
print prff "$l";
}
}

print prff "\$nusrdir = \"$input{'userdir'}\"\;\n";
print prff "1\;\n";
print "Thank you, your preferences were saved. Click <a href=\"$url?action=am\">here</a> to continue.";
&bo;
exit 0;
}
if ($sub eq "Save Default Disk Space") {
$input{'diskspace'} =~ s/\,//g;
$input{'diskspace'} =~ s/[a-z]//g;
$input{'diskspace'} =~ s/[A-Z]//g;

open(prf, "prefs");
@fl = <prf>;
close (prf);

open(prff, ">prefs");
foreach $l (@fl) {
unless ($l =~ "1\;" || $l =~ /^\$diskspace/){
print prff "$l";
}
}

print prff "\$diskspace = \"$input{'diskspace'}\"\;\n";
print prff "1\;\n";
print "Thank you, your preferences were saved. Click <a href=\"$url?action=am\">here</a> to continue.";
&bo;
exit 0;
}




if ($sub eq "Save Default Settings") {
open(prf, "prefs");
@fl = <prf>;
close (prf);

open(prff, ">prefs");
foreach $l (@fl) {
unless ($l =~ "1\;" || $l =~ /^\$passchange/ || $l =~ /^\$maxuser/
|| $l =~ /^\$minpass/
|| $l =~ /^\$maxpass/
|| $l =~ /^\$minuser/){
print prff "$l";
}
}

print prff "\$minpass = \"$input{'minpass'}\"\;\n";
print prff "\$maxpass = \"$input{'maxpass'}\"\;\n";
print prff "\$minuser = \"$input{'minuser'}\"\;\n";
print prff "\$maxuser = \"$input{'maxuser'}\"\;\n";
print prff "\$passchange = \"$input{'passchange'}\"\;\n";
print prff "1\;\n";
print "Thank you, your preferences were saved. Click <a href=\"$url?action=am\">here</a> to continue.";
&bo;
exit 0;
}
if ($sub eq "Save Password File Path") {

print "Saving path...<BR>\n";
open(prf, "prefs");
@fl = <prf>;
close (prf);

open(prff, ">prefs");
foreach $l (@fl) {
unless ($l =~ "1\;" || $l =~ /^\$passfile/){
print prff "$l";
}}
close(prf);
$pass = $input{'passfile'};
print prff "\$passfile = \"$pass\"\;\n";
print prff "1\;\n";
close(prff);
if (!-e "$input{'passfile'}") {
open(PS,">$input{'passfile'}");
close(PS);
print "creating password file at $input{'passfile'}<BR>\n";
}
$time = "0";
print "Thank you. Your preferences were saved. Click <a href=\"$url?action=am\">here</a> to continue.";
&bo;
exit 0;
}

if ($sub eq "Save URL To Home Directories") {
open(prf, "prefs");
@fl = <prf>;
close (prf);

open(prff, ">prefs");
foreach $l (@fl) {
unless ($l =~ "1\;" || $l =~ /^\$userurl/){
print prff "$l";
}
}

print prff "\$nuserurl = \"$input{'userurl'}\"\;\n";
print prff "1\;\n";
print "Thank you, your preferences were saved. Click <a href=\"$url?action=am\">here</a> to continue.";
&bo;
exit 0;
}
if ($sub eq "Save Password File Path") {

print "Saving path...<BR>\n";
open(prf, "prefs");
@fl = <prf>;
close (prf);

open(prff, ">prefs");
foreach $l (@fl) {
unless ($l =~ "1\;" || $l =~ /^\$passfile/){
print prff "$l";
}
}
close(prf);
$pass = $input{'passfile'};
print prff "\$passfile = \"$pass\"\;\n";
print prff "1\;\n";
close(prff);
if (!-e "$input{'passfile'}") {
open(PS,">$input{'passfile'}");
close(PS);
print "creating password file at $input{'passfile'}<BR>\n";
}
$time = "0";
print "Thank you. Your preferences were saved. Click <a href=\"$url?action=am\">here</a> to continue.";
&bo;
exit 0;}
exit 0;}
sub bo {

print <<AMM;

</td>
</tr>
</table>
</center></div><hr><a href="http://www.elitehosts.com/scripts">
©1999 Avi Brender.</a> All rights reserved.
</body>
</html>
AMM
exit 0;
}
sub conf {

$nuserid = $input{'nuserid'};
$npassword = $input{'npassword'};

$userid = crypt($input{userid},time);
$password = crypt($input{password},time);
if ($time eq "1") {
$time = "0";
}else {
$time = "2";
}
unless ($userid eq "$nuserid" && $password eq "$npassword") {

print <<SSMM;
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Scripts In The Making</title>
<style>
.bl:hover{color:red;text-decoration:underline}
a{text-decoration:none}

</style>
</head>

<body bgcolor="#FFFFFF">
<div align="center"><center>
<form method="post" action="$url">
SSMM
print <<TGBL;
<table border="1" cellpadding="0" cellspacing="0" width="50%"
bordercolor="#000000" bordercolordark="#000000"
bordercolorlight="#000000">
<tr>
<td align="center" colspan="1" bgcolor="#000091"><font
color="#FFFFFF" face="verdana">Angoco Hosting - Main Page</font></td>
</tr>
<tr>
<td bgcolor="#CFCFCF" valign="top"><BR><font face="verdana" size="-1">
Sorry, but your new UserID or password does not match the UserID and password
you first entered. Please try again.<BR><BR><font face="aria" size="-1" color="darkblue">Please Note:
<BR>This script may not be sold.<BR>
This script may not be re-distributed<BR>
This script may not be edited<BR>
You may not remove the link from the bottom of the page<BR>
<B>Without permission from the <a href="mailto:abmusic99\@aol.com">author.</a><BR><BR>

</font><font face="verdana" size="-1" color="blue">Step 2: Confirm Main Account (Again).<BR><BR>
<font color="red">Please confirm your UserID and password for your main account.<BR><font color="green">
UserID:<input type="text" Name="userid" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="30"><BR>
Password:<input type="password" Name="password" style="background-color:orange;font-face:verdana;
font-size:xx-small;color:black" size="30"><BR>
<input type="hidden" name="nuserid" value="$nuserid">
<input type="hidden" name="npassword" value="$npassword">
<CENTER><input type="hidden" name="action" value="confirm">
<input type="submit" name="submit" STYLE="background-color:#eeeeee;font:verdana;font-weight:bold;
color:#000080;font-size:xx-small;width:134;" value="Save!"></td>

</tr>
</table>
TGBL
}else {
open (FILEY, ">prefs");
print FILEY "\$adminname = \"$userid\"\;\n";
print FILEY "\$adminpass = \"$password\"\;\n";
print FILEY "1\;\n";

&am;
}

print <<SSMM;
</center></div>
</body></form>
</html>
SSMM
exit 0;
}
sub saveid {

$nuserid = crypt($input{userid},time);
$npassword = crypt($input{password},time);

print <<SSMM;
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Scripts In The Making</title>
<style>
.bl:hover{color:red;text-decoration:underline}
a{text-decoration:none}

</style>
</head>
</form>
<body bgcolor="#FFFFFF">
<div align="center"><center>
<form method="post" action="$url">
<table border="1" cellpadding="0" cellspacing="0" width="50%"
bordercolor="#000000" bordercolordark="#000000"
bordercolorlight="#000000">
<tr>
<td align="center" colspan="1" bgcolor="#000091"><font
color="#FFFFFF" face="verdana">Angoco Hosting - Main Page</font></td>
</tr>
<tr>
<td bgcolor="#CFCFCF" valign="top"><BR><font face="verdana" size="-1">
Welcome. You are seeing this screen because this is the first time that you
are using this script.<BR><BR><font face="aria" size="-1" color="darkblue">Please Note:
<BR>This sc
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Nov 12, 2002 2:01 pm    Post subject: Re: k Reply with quote

sa wrote:
It works lol but its not really what I am looking for... I need to get a file that is currently in a web accessible folder out of it but I have tried everything and nothing has worked... Let me add the code and explain...

I need to get passfile for a web community program out of cgi-bin... however whenever I move it the program just trys to re config... I tried switching the remote path and everything... What am I doing wrong?

We really apologize, but if you have problems with the script, please contact the script's author. It is the best person to provide support for it.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group